Hello!
I'm trying to make this thing: when user make choice from the of the radio buttons, application should fill list of the combobox from database.
Here is my code:
[JSP]
<table width="100%" border="0">
<tr>
<td>
<h:selectOneRadio id="selectFilterType" layout="lineDirection" value="#{projNewsListBacking.filterType}">
<f:selectItem itemValue="all-news" itemLabel="All news"/>
<f:selectItem itemValue="my-news" itemLabel="My news"/>
<f:selectItem itemValue="other-user-news" itemLabel="News by"/>
<a4j:support event="onselect" reRender="selectUser" action="#{projNewsListBacking.selectFilterAction}"/>
</h:selectOneRadio>
</td>
<td>
<h:selectOneMenu id="selectUser" value="#{projNewsListBacking.selectedUser}">
<f:selectItems value="#{projNewsListBacking.usersList}"/>
</h:selectOneMenu>
</td>
public String selectFilterAction() {
if (filterType.equals("other-user-news") == true) {
if (usersList.size() == 0) {
loadUsersList();
}
}
return null;
}
Hello,
According to documentation, "onselect" event is fired when the user selects text from component. Try onclick/onchange.