You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by paolo <ma...@gmail.com> on 2007/04/03 12:00:56 UTC

pageBeginRender and submit

Hi, I'm quiet new of tapestry.
I have a problem in calling a page.
My form in MyPage.html is

<form jwcid="add@Form" listener="ognl:listeners.submitMainForm"
delegate="ognl:beans.delegate">		<input type="submit" jwcid="submit@Submit"
value="Salva" selected="ognl:mainSubmitType"    
                 tag="saveDay" />
</form>

In MyPage.java I have a method submitMainForm(IRequestCycle cycle) and the
pageBeginRender method.
When I press submit button, I see that is called:
pageBeginRender method, 
submitMainForm 
pageBeginRender again.
When is there a listener on form Is pageBeginRender method called before
listener method?
Which is the problem?

Thanks a lot in advance



-- 
View this message in context: http://www.nabble.com/pageBeginRender-and-submit-tf3510853.html#a9806821
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: pageBeginRender and submit

Posted by Martino Piccinato <ma...@gmail.com>.
You can look here:

http://tapestry.apache.org/tapestry4.1/faq.html#submit-lifecycle

on form submit pageBeginRender is called before the form submit listener
discarding output in order to set page and page components in the proper
status before your listener is called.
As your next question might be "what if I don't want to execute some code in
my pageBeginRenderr during first call?"


The answer is check for cycle.isRewinding()

use

if(cycle.isRewinding()) { // This is the first "rewind no output"
pageBeginRenderer call code
 /// Code
} else { // This is the second "real output" pageBeginRenderer call code
// Code
}


:-)

On 4/3/07, paolo <ma...@gmail.com> wrote:
>
>
> Hi, I'm quiet new of tapestry.
> I have a problem in calling a page.
> My form in MyPage.html is
>
> <form jwcid="add@Form" listener="ognl:listeners.submitMainForm"
> delegate="ognl:beans.delegate">         <input type="submit" jwcid="
> submit@Submit"
> value="Salva" selected="ognl:mainSubmitType"
>                  tag="saveDay" />
> </form>
>
> In MyPage.java I have a method submitMainForm(IRequestCycle cycle) and the
> pageBeginRender method.
> When I press submit button, I see that is called:
> pageBeginRender method,
> submitMainForm
> pageBeginRender again.
> When is there a listener on form Is pageBeginRender method called before
> listener method?
> Which is the problem?
>
> Thanks a lot in advance
>
>
>
> --
> View this message in context:
> http://www.nabble.com/pageBeginRender-and-submit-tf3510853.html#a9806821
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>