File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Are AJAX fetched values available during post ?" Watch "Are AJAX fetched values available during post ?" New topic

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) ?


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Are AJAX fetched values available during post ?
It's not a secret anymore!