You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sunilmanu <su...@gmail.com> on 2007/01/02 20:17:59 UTC

How to read Hidden Value in Tapestry Page class ?

Hi,

I open a new window ('child window')  from my Tapestry application (parent
page)...and put an object into session. 
When the user Closes the 'child' window, i change in the 'Parent page' a
Hidden Value of a property to TRUE and then do a refresh to that page. 

Now I want to be able to READ the Value of Hidden Property during the
PageBeginRender but Somehow the new Value is not getting updated. I do the
following

I am injecting this in java class
	@InjectObject("service:tapestry.globals.HttpServletRequest")
	public abstract HttpServletRequest getRequest(); 

.... String isPreview= getRequest().getParameter("isPreviewMode");

HTML file :
	<form jwcid="@Form" >
		<input jwcid="@Hidden" value="ognl:isPreviewMode" id="isPreviewMode" />
	</form>


But I confirmed that the HTML has the new value because I do alert the value
on body unload and it shows the new value.


What am I doing wrong here ? Any idea anyone ?

Thanks for the help in advance..

- Sunil M
-- 
View this message in context: http://www.nabble.com/How-to-read-Hidden-Value-in-Tapestry-Page-class---tf2909551.html#a8128999
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: How to read Hidden Value in Tapestry Page class ?

Posted by sunilmanu <su...@gmail.com>.
Thanks Shing....  I was simply reloading the page. I changed the javascript
to do a Form Submit and works like a charm..

Thanks once again..

- Sunil M



Shing Hing Man wrote:
> 
> I presumed  when you said 'refresh' the parent page,
> you mean you have submitted the form on the parent
> page.
> When the form is submitted, the pageBeginRender is
> called twice.
> 1) PageBeginRender method is called in rewinding mode.
> None of the submitted values from the form are
> available yet(including the hidden value).
> 2) Form rewinded.
> 3) PageBeginRender mthod is called again to render the
> page(in rendering mode). The hidden value is
> available. now.
> 
> If you want to do something as soon as the hidden
> value is available, you could try using the listener
> parameter of the Hidden component.
> 
> http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Hidden.html
> 
> Shing  
> 
> 
> 
> 
> --- sunilmanu <su...@gmail.com> wrote:
> 
>> 
>> Hi,
>> 
>> I open a new window ('child window')  from my
>> Tapestry application (parent
>> page)...and put an object into session. 
>> When the user Closes the 'child' window, i change in
>> the 'Parent page' a
>> Hidden Value of a property to TRUE and then do a
>> refresh to that page. 
>> 
>> Now I want to be able to READ the Value of Hidden
>> Property during the
>> PageBeginRender but Somehow the new Value is not
>> getting updated. I do the
>> following
>> 
>> I am injecting this in java class
>> 
>>
> @InjectObject("service:tapestry.globals.HttpServletRequest")
>> 	public abstract HttpServletRequest getRequest(); 
>> 
>> .... String isPreview=
>> getRequest().getParameter("isPreviewMode");
>> 
>> HTML file :
>> 	<form jwcid="@Form" >
>> 		<input jwcid="@Hidden" value="ognl:isPreviewMode"
>> id="isPreviewMode" />
>> 	</form>
>> 
>> 
>> But I confirmed that the HTML has the new value
>> because I do alert the value
>> on body unload and it shows the new value.
>> 
>> 
>> What am I doing wrong here ? Any idea anyone ?
>> 
>> Thanks for the help in advance..
>> 
>> - Sunil M
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/How-to-read-Hidden-Value-in-Tapestry-Page-class---tf2909551.html#a8128999
>> 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
>> 
>> 
> 
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-read-Hidden-Value-in-Tapestry-Page-class---tf2909551.html#a8143270
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: How to read Hidden Value in Tapestry Page class ?

Posted by Shing Hing Man <ma...@yahoo.com>.
I presumed  when you said 'refresh' the parent page,
you mean you have submitted the form on the parent
page.
When the form is submitted, the pageBeginRender is
called twice.
1) PageBeginRender method is called in rewinding mode.
None of the submitted values from the form are
available yet(including the hidden value).
2) Form rewinded.
3) PageBeginRender mthod is called again to render the
page(in rendering mode). The hidden value is
available. now.

If you want to do something as soon as the hidden
value is available, you could try using the listener
parameter of the Hidden component.

http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Hidden.html

Shing  




--- sunilmanu <su...@gmail.com> wrote:

> 
> Hi,
> 
> I open a new window ('child window')  from my
> Tapestry application (parent
> page)...and put an object into session. 
> When the user Closes the 'child' window, i change in
> the 'Parent page' a
> Hidden Value of a property to TRUE and then do a
> refresh to that page. 
> 
> Now I want to be able to READ the Value of Hidden
> Property during the
> PageBeginRender but Somehow the new Value is not
> getting updated. I do the
> following
> 
> I am injecting this in java class
> 
>
@InjectObject("service:tapestry.globals.HttpServletRequest")
> 	public abstract HttpServletRequest getRequest(); 
> 
> .... String isPreview=
> getRequest().getParameter("isPreviewMode");
> 
> HTML file :
> 	<form jwcid="@Form" >
> 		<input jwcid="@Hidden" value="ognl:isPreviewMode"
> id="isPreviewMode" />
> 	</form>
> 
> 
> But I confirmed that the HTML has the new value
> because I do alert the value
> on body unload and it shows the new value.
> 
> 
> What am I doing wrong here ? Any idea anyone ?
> 
> Thanks for the help in advance..
> 
> - Sunil M
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-read-Hidden-Value-in-Tapestry-Page-class---tf2909551.html#a8128999
> 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
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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