File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF BackingBean organization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF BackingBean organization" Watch "JSF BackingBean organization" New topic
Author

JSF BackingBean organization

Anthony Taylor
Greenhorn

Joined: May 04, 2006
Posts: 26
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.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
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..
rajani varma
Ranch Hand

Joined: Dec 21, 2006
Posts: 30
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>
<hutputText value="#{registrationBean.usage}" styleClass="labelTextBlack" rendered="#{!registrationBean.usageEditable}"></hutputText>

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

Joined: Dec 21, 2006
Posts: 30
Or you can check this link for Ajax for JSF developer guide

https://ajax4jsf.dev.java.net/nonav/documentation/ajax-documentation/developerGuide.html
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: JSF BackingBean organization
 
Similar Threads
How to add ajax behavior to synamically created component?
jsf 1.2 Facelets - Double clicks on a selectManyListbox
modeling JSF managed beans on component diagram
JavaScript to JSF
PLEASE HELP????? jsf + form population