You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by emaybert <em...@ix.netcom.com> on 2007/02/03 19:21:44 UTC

Clearing/Resetting @Input control

I have a T4 app which has a User object in session. (Injected from a
hivemodule.xml application state object ) 

The app is a WML app, so has no "Form" component, but uses wml:Input
componnets. 

The "form" has it's fields defined with implicit components, for example,: 

<wml> 
... 
<card jwcid="@wml:Card" id="example"> 
... 
First Name:<input jwcid="fnameInput@wml:Input" name="fname"
value="ognl:user.firstName"/> 
... 

<do type="accept" label="Query"> 
<go jwcid="@wml:Go" stateful="ognl:false"
listener="ognl:listeners.submitForm"> 
<postfield jwcid="@wml:Postfield" name="ognl:components.fnameInput.name"
value="ognl:user.firstName"/> 
... 

As a side-note, the reason the "go" element's stateful attribute is set to
"ognl:false" is I need to suppress the default HTML 
sesison-expired page, and am checking for a null User sesison object in the
"pageValidate" method and throwing 
a PageRedirectException which directs to a WML version of the
session-timeout page. 


In any event, this all works fine. The only problem I have is that when the
user returns to this page 
( BTW - the page extends the class org.apache.tapestry.wml.Deck ) I want the
form to revert to a blank slate. 
That is to say, I want the wml:Input element to be blank. 


I have tried the following to no avail: 

1. Setting no-cache in the page : 
<meta http-equiv="Cache-Control" content="no-cache"/> 

2. killing the session on a subsequent page via: 
<span jwcid="@ServiceLink" service="literal:restart">Logout</span> 
and 
<span jwcid="@ServiceLink"
service="ognl:@org.apache.tapestry.Tapestry@RESTART_SERVICE">Logout</span> 

3.Manually overwrite the in-session User object data 

In fact, if the user first enters in the form "JOE" as the first name, and
then, I manually update the session 
object with the name "STEVE", and then put the following components on the
page: 

<span jwcid="@Insert" value="ognl:user.firstName"/> 
<input jwcid="fnameInput@wml:Input" name="fname"
value="ognl:user.firstName"/> 

The @Insert componenet will correctly print "STEVE" but the @wml:Input
element prints the old name "JOE" 

I have cleared the browser cache, etc. but no luck.It seems the the Input
component will not "refresh" itself 
with new data from the in-session object it's bound to. 

Am I missing something basic here? 

How do I get the @wml:Input element to refresh its data from the in-session
object its bound to? 

Sorry for the long post. 

Any help would be greatly appreciated. 
~e 
-- 
View this message in context: http://www.nabble.com/Clearing-Resetting-%40Input-control-tf3166952.html#a8785214
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