• 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:

Integrating AJAX and JSF

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen a few examples out showing how to either integrate AJAX using a PhaseListener approach, and also how to integrate AJAX using IBM/JSF implementation that allows you specify panels to be updatable via AJAX.

The example I'm trying to work through is where a user enters some key piece of information into a form, and that data is then used to query the database and populate other fields on the form.

The PhaseListener approach doesn't seem to make easy use of the Java bean, and it's functionality. However, it does give the user a single point of entry to get all of the data and return it as a JSON object at which point the HTML can be updated.

The second approach doesn't seem doesn't seem to allow the individual components on the form to be tied to the Java bean, because any values which may be prepopulated have to be individual function calls. This would be a ton of overhead if you had to make 10 calls to get the values for 10 compenents. However this approach does keep everything within JSF, and allows for minimal java scripting.

Does anyone have any additional suggestions/recommendations on performing an autofill type feature within JSF?

Regards,

Kevin
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried Ajax4JSF? I'm not sure if it will meet your requirements exactly, but it enables you to make an Ajax call from a standard JSF component, and you simply identify the component to rerender when the response is received. Trivial access to the bean data therefore.

I hate anything in JSF where I have to pull apart the lifecycle and apply phase listeners.

 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic