• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Are AJAX fetched values available during post ?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Saloon Keeper
Posts: 28469
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Squanch that. And squanch this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic