This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes JSF and the fly likes Are AJAX fetched values available during post ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Are AJAX fetched values available during post ?" Watch "Are AJAX fetched values available during post ?" New topic
Author

Are AJAX fetched values available during post ?

Naveen Sampra
Ranch Hand

Joined: Jun 11, 2003
Posts: 70
Tim and others,

Are the partial updates done on page after AJAX call available on a post (i.e JSF submit) ?



In my example above initially data table is empty. Clicking on "Populate People Table" link renders 3 rows in the table. However when I click "Save" the bean property dataBean.peopleList does not get set with 3 items.

I'm using requestScope bean and JSF1.2

Appreciate if you can help me understand why this happens.
Also how to post values that are only available on client after AJAX call and not on the Server(i.e component tree) ?


Thanks.


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

I don't think an "id" attribute containing spaces is legal, so that may be part of the problem.

When you do an AJAX request, it's basically the same thing as doing a regular action, except that only part of the View and part of the Model are affected. In your particular case, while I'm not sure why you chose an actionListener over an action method, what you are doing -or should be doing - is updating the peopleList datamodel to fetch the lines of interest, which then get displayed when the table is re-rendered.

Once that is done, the net effect is the same as if you'd done all that work on the original page display. Changes to the inputText items in the table should be posted to the row objects in the datamodel automatically, providing that the request has passed validation. And it has to pass validation or the action method won't fire.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are AJAX fetched values available during post ?