• Post Reply Bookmark Topic Watch Topic
  • New Topic

Repopulating data on a page?  RSS feed

Marcello Tiso
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this web app that allows users to enter information about an item, lets say they are entering information about Ducks.
Info is something like :
Duck Name :
Duck Color:
Duck Description:

If at the time they are in the screen for entering info about a new duck but they type the same duck name as a previous duck, then I need to get all the Duck information and populate the screen.

I am able to do most of this BUT what happens is that when I determine that I need to get the old duck info , I get the Duck object but because of the JSF life cycle my Old Duck Info is not populated on the screen ( the duck object is equal to the found old duck but the screen doesn't refresh itself with those values.
I am not sure if I should do something in the phase listener ( and I'm not sure what) . Any thoughts / ideas are greatly appreciated.

Some code
<h:inputText id="nameInput" value="#{visit.currentDuck.name}" valueChangeListener="#{createDuckBean.checkForExistingDuck}" >

<h:inputTextarea id="duckDesc" rows="4" cols="80"
value="#{visit.currentDuck.description}" >
The checkForExistingDuck sets the currentDuck to the foundDuck and executes a facesContext.renderResponse().

Again thanks.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!