File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Error message and Bean

 
Tanu Gulati
Ranch Hand
Posts: 113
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsf page where I have several text boxes. some of the text boxes have validation in JSF for maximum number of characters

<h:inputText id="resZipCodeEF" styleClass="formEntryTextNormal"
value="#{pc_application_primaryInsured.address.zip}"
style="width: 90px" maxlength="9">
<f:convertNumber type="zip" integerOnly="true"
pattern="#{property.zipPattern}" />


Now I did following things
1. ) entered 11 in first text box i.e "resZipCodeEF"
2. ) change the value for SECOND text box from "aa" to "bb" (both the text box are in different jsp but included in one page)
3.) refresh the page

I see that on refreshing the page an error message is generated asking me to enter the value in first text box i.e. "resZipCodeEF" in proper format ..that is fine I should enter atleast 9 characters in the field.


BUT TO MY SURPRISE...the SECOND text box (mention in step above) automatically changes back to original value and did not take the new value provided by me ....

If there is no Error generated from jsp and i refresh the page SECOND text box will have the new value


NOTE : I am not saving the page in to database here only page refresh.
IN summary : on refresh of page when there is an error other text boxes on page does not hold the new value BUT when there is not jsp validation error and i refresh the page i can see all text boxes holding new value

please let me know if i can provide more information
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you don't show the second text box, but you said "other JSP".

To me, that sounds like the 2 text boxes are in 2 different forms - one on one JSP (View) and one on another. And, since a basic rule of the HTML system that underlies JSF is that only one form can be submitted at a time, I would be unsurprised to see the second form revert to the values in its backing bean(s).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic