it is because of the way tapestry handles component requests!

if a component fires an action (from a submit or link or...) tapestry
will first resolve the action methods and invoke them. after the action
methods have been invoked tapestry determines the page the 
component is located in and generates a redirect to this page.
So a HTTPResonse goes back to the client and tells it to issue 
a new request to the determined page and tapestry returns the 
rendered page with the response. 

because 2 requests are issued and field data is not persisted between 
requests (they are discarded) your field will be blank. therefore you need 

the persist annotation. if you use "session" your data will be stored in 
the 
session and stay there for subsequent requests. if you use "flash" your 
data 
will be stored ONLY  for the period of the 2 request so tapestry can 
render this 
data. 


please re-read the documentation (or watch one of the screencasts... 
its explained and shown in the first i think) and search the mailinglist 
for further details

g,
kris




Angelo Chen <[EMAIL PROTECTED]> 
25.10.2007 12:25
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
T5: Select won't retain value when it rejects by the server







Hi,

I have a simple form as follows, if it can not pass onValidate, errors 
were
shown, and the value in the 'Name' field was retained, but the 'Gender' 
will
not retain the selected value, always goes back to blank unless I declare
gender field @Persist, why? Thanks.

 <t:form  t:id="regForm">
                 <input t:type="textfield" t:id="name" size="40"
t:validate="required,minlength=8" /><br />
                  <input t:type="select" name="gender"  t:id="gender"
model="genderModel" t:validate="required" t:label="gender" 
t:value="gender"
/><br />
                  <input type="submit" name="Submit" id="Submit" 
value="Submit" /><br />
                         <t:errors />
 </t:form>
-- 
View this message in context: 
http://www.nabble.com/T5%3A-Select-won%27t-retain-value-when-it-rejects-by-the-server-tf4689919.html#a13403938

Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to