Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JSF BackingBean organization

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I seem to be a little confused about the ordering for a JSF Backing Bean. I know that I have the getters and the setters for the different methods that correspond to the different components on the page. Now the confusing part, if I am trying to incorporate ajax into the mix .. how or where do I add the code to perform the server-side processing for this Backing Bean. As an example, suppose I have a page connected to a backing bean. And lets suppose that I would like ajax to validate as the user typed information into the textbox component. As the request is sent to the "action" for this page .. I would imagine the logic for determining if an error occured and sending the appropriate message back to the user would have to go somewhere in the backing bean so it could get called. I know usually this logic would go into an event that is connected to a button or other component on the page, but this seems to be a little bit different for ajax based apps. Should this all occur in the constructor for the backing bean or is there another place this code should go? Any examples or code snippets would be greatly appreciated as I am thoroughly confused on this one.
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know nothing about this...but Apache has a Ajax Input Suggest box...source is as always open to all...you might want to check out their implementation..
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are using Ajax components in our jsf pages.
For Eg:

<h:selectOneMenu id="usage" value="#{registrationBean.usage}" styleClass="labelTextBlack" >
<f:selectItems value="#{registrationBean.usageList}"/>
<a4j:support event="onchange" action="#{registrationBean.changeUsage}" reRender="plateType,plateClass,expiration,issueYear1"></a4j:support>
</h:selectOneMenu>
<h:outputText value="#{registrationBean.usage}" styleClass="labelTextBlack" rendered="#{!registrationBean.usageEditable}"></h:outputText>

In the above example, we used the a4j:support component, to reRender only some particular fields in the page(to avoid submitting the whole page) and the action method, "changeUsage()" is defined in the backing bean.

Hope this is what you are looking for


Thanks
Rajani
 
rajani varma
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or you can check this link for Ajax for JSF developer guide

https://ajax4jsf.dev.java.net/nonav/documentation/ajax-documentation/developerGuide.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic