I have a pretty simple composite component which toggles back and forth between two images when it is clicked. When I click it the first time, it works fine. Every time after that, nothing happens. The "toggleSingleSelect" is called, but the panel itself is not re-rendered.
singleMultiSelectText.xhtml:
<cc:interface componentType="singleMultiSelect">
</cc:interface>
<cc:implementation>
<h:panelGroup id="singleMultiSelectPanel" styleClass="field" layout="block">
<h:commandButton styleClass="toggle"
image="#{cc.singleSelect ?
'/resources/img/expand-single.gif' :
'/resources/img/collapse-single.gif'}">
<f:ajax listener="#{cc.toggleSingleSelect}"
execute="@this" render="singleMultiSelectPanel"/>
</h:commandButton>
</h:panelGroup>
</cc:implementation>
singleMultiSelect.java:
@FacesComponent(value = "singleMultiSelect")
public class SingleMultiSelect extends UINamingContainer {
private boolean singleSelect = true;
public void toggleSingleSelect(AjaxBehaviorEvent event) {
singleSelect = ! singleSelect;
}
}
The console has the following output when I click it the first time:
update["assetSearchForm:j_idt112:_t113"]: <input class="toggle" id="assetSearchFor....
update["javax.faces.ViewState"]: -4115183671224810146:2892643767875659913....
Every time after that, though, I just get:
update["javax.faces.ViewState"]: -4115183671224810146:2892643767875659913....