This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Setters not being called when using ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Setters not being called when using ajax" Watch "Setters not being called when using ajax" New topic
Author

Setters not being called when using ajax

Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 152

Hi,

I have a selectOneMenu where a user can pick what type of Person they are; Patient or Student. Depending on what they select a certain option is displayed... Patients can be smokers or non-smokers and Students can select their SchoolType (Highschool, College, etc). Can someone explain to me why when I use ajax the setter methods on my backing bean aren't being called. Ajax is rendering the correct options related to each Person depending on the current value in the select box. When I click the commandButton though, the values aren't being sent to the beans setters.

Thanks,
Alan

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

I'm not an expert on the JSF2 ajax tag, bug its equivalent for RichFaces has the option to post only the attached control value OR the entire form containing the control (including other control values). I seem to recall that the default using the JSF2 ajax tag may be only the attached control value. So check the attribute options on the ajax tag.


Customer surveys are for companies who didn't pay proper attention to begin with.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

Hello!

Please read my explanation of ajax at http://www.coderanch.com/t/594176/JSF/java/dynamic-div-reset#2708812


True person is moral, false is right!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setters not being called when using ajax
 
Similar Threads
Strange behaviour with h:selectOneMenu value
Problem using valueChangeListener and onchange
Selectmanylistbox disables submit button
JSF + Tomahawk + subform
Cant get my datatable to update [PRIMEFACES]