Could you show more code, controller for both component and the views
associated

Richard


On Wed, Mar 6, 2013 at 4:49 PM, Riccardo C <[email protected]> wrote:

> Thank you very much, that is exactly what I needed... I didn't know
> components!
>
> I have component related question know.
> I have a first component that generate the first form (form1) based on
> tableA and a second component that list all the post and a second form
> (form2) generate on the same tableA.
> Now in the firstcomponent.load file, I've included the second
> component...something along these lines:
> {{=form1}}
> load('controller','functionsecondcomponent','two')
> <div id="two"><div>
> And the i call this component in the main page "index.html".
>
> Everything is rendered correctly: form1 and form2 appears correctly but do
> not work has I was expected. If I submit through form2, the content of the
> post is correctly recorder in the tableA, if I try to use form1 it doesn't
> work. When I press the submit button the index.html is refreshed but
> without any effect on tableA. Any suggestions?
>
> Thanks a lot.
>
> Riccardo
>
>
>
> Il giorno giovedì 28 febbraio 2013 21:47:46 UTC, Richard ha scritto:
>>
>> I don't understand your problem very well... Do you have a problem
>> refreshing the post? As far as I understand, you have write your own ajax
>> call to update the stuff in your page...
>>
>> You could try someting like that in your view (read about web2py LOAD()
>> and component) :
>>
>> # Your insert form
>> {{=form}}
>>
>> {{=LOAD(..., yourFunctionThatListThePost, ...)}}
>>
>> You can then in you main function/page calling a refresh of you component
>> like that :
>>
>> if form.accepts(request.vars, session):
>>     ...
>>     response.js="web2py_component(**'%s','two');" %
>> URL('yourController','**yourFunctionThatListThePost', args='ifRequired')
>>
>>
>> About web2py_component :
>>
>> https://groups.google.com/d/**msg/web2py/RSDIwe8BDxA/**chcikCg0RpkJ<https://groups.google.com/d/msg/web2py/RSDIwe8BDxA/chcikCg0RpkJ>
>>
>>
>> Hope it helps!
>>
>> Richard
>>
>>
>> On Thu, Feb 28, 2013 at 1:30 PM, Riccardo C <[email protected]> wrote:
>>
>>> Good evening,
>>>
>>> I am trying to do a very simple 'twitter like' message board with the
>>> simple aim to learn to program and get used to web2py framework.
>>> The problem is that I decided (I don't know if it is the best choice) to
>>> use one single table for both the new messages and the answers.
>>>
>>> What I do is showing on top of the index.html page, the form to
>>> introduce new messages and below all the new messages (without the answers)
>>> followed by a link associated with a ajax callback (replies.html).
>>> This second function return to me all, if any, messages associated to
>>> 'main text' AND a form that is generated from the same table with the
>>> refSms field set (and not showed) to the id of the main message.
>>>
>>> What happens? when I reply to a message and I click on submit the page
>>> refresh without insert in the db the new row. Can someone help me to *
>>> understand* what is wrong?
>>>
>>> Thanks
>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to