This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

valuechangelistener with a4j rerendering

 
Peter Luci
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,i have a problem with h:selectoneradio valuechangelistener and ajax.

---jsf--

<h:selectOneRadio valueChangeListener="#{gradeBean.checkSettingSelection}" value="#{gradeBean.settingSelection}">
<f:selectItem itemLabel="Automate" itemValue="1"/>
<f:selectItem itemLabel="Manual" itemValue="2" />
<a4j:support reRender="auto,manual" event="onclick"/>
</h:selectOneRadio>

<a4jutputPanel id="auto" rendered="#{gradeBean.autoCheck}">
<h:inputText value="gradeBean.value"/>
</a4jutputPanel>

<a4jutputPanel id="manual" rendered="#{gradeBean.manualCheck}">
<h:inputText value="gradeBean.value1"/>
</a4jutputPanel>

--backingbean-
public void checkSettingSelection(ValueChangeEvent vce){
String check = (String)vce.getNewValue();
if(check.equalsIgnoreCase("1")){
this.setAutoCheck(true);
this.setManualCheck(false);
}
if(check.equalsIgnoreCase("2")){
this.setManualCheck(true);
this.setAutoCheck(false);
}
}

what im trying to do here is .. there is 2 radiobutton and when a user select option 1, option 1 with all the fields will appear while option 2 will not appear. vice versa.
my problem is im tryin to use a4j support so that only portion of the page is rerender and not the whole page to reload. however it is not working. anyone can help me?

thanks alot!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"bionicl bionicl",
Welcome to the ranch. You may not be aware of the ranch Naming Policy. Please read it carefully and change your name accordingly (obviously fake name are not allowed). Thank you.
 
Peter Luci
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry abt that..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic