• Post Reply Bookmark Topic Watch Topic
  • New Topic

redisplay value h:inputbox after SUBMIT (not page reload)

 
Joe Shannow
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I know how to redisplay value of <h:inputtext> after reload page using by redisplay="true" attribute.
But how to keep the value in the <h:inputText> after using Submitt button???

Do you have some suggestions?
Thank you
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you submit an action to JSF, the JSF server will run through the JSF lifecycle. That includes validating the data, updating the backing bean, executing the action method, and finally generating the new View and sending it back to the client.

Whatever value is in the referenced backing bean property of the inputText control at the time the action method completes will be the value displayed in the inputText on the updated page. You don't need to do anything further.
 
Joe Shannow
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I understand what did you tell me, but I not able to use it for now.
Could you tell me exactly how can I do this?
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, when you submit a page and it goes through all phases, the value that's in the bean property (bound via #{bean.name}) will be rendered into the page. If a conversion or validation error occur, then the value the user entered will be redisplayed automatically.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!