I have a problem with the following code.
When the form is submitted my form displays a message advising if the email
is valid or not.
When the message is displayed I start another browser and I access the same
page. The message
is still displayed the first time the "second" user accesses this page. I
solved the problem by having the caller of UserDetails to call
setFeedbackMessage("") but I am not happy with this approach.
Is there a better approach for both feedbackMessage and formUserDetails ?
~~~~~~~~~~ UserDetails.html ~~~~~~~~~~~~~~~~~~~~~~~
<t:formUserDetails>
${feedbackMessage}
<input t:type="TextField" t:id="email" size="30"/>
</t:formUserDetails>
~~~~~~~~~~ UserDetails.java ~~~~~~~~~~~~~~~
@Persist("flash")
private String feedbackMessage = null;
@Component
private Form formUserDetails;
Object onSuccessFromFormUserDetails(){
if (!isValid(getEmail())){
formUserDetails.recordError("InvalidEmail");
}else{
feedbackMessage = "Valid Email";
}
}
~~~~~~~~~~~~~~~~ AppModule.java ~~~~~~~~~~~~~~~~~~~
public void contributeApplicationDefaults(MappedConfiguration<String,
String> configuration) {
configuration.add("tapestry.persistence-strategy", "flash");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
View this message in context:
http://www.nabble.com/Form-Validation-tf3900603.html#a11057776
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]