Reputation: 1590
I am developing an application using JSF 1.2 (sun RI) and richFaces 3.3.
I want to display a panel when a list value is changed in select list,below the select list.
Following is the code for the same :
> <a4j:form ajaxSubmit="true">
>
<h:panelGrid id="videoServiceTab"> <h:outputLabel for="deviceSelect" value="Select Device :"/>
>
> <h:selectOneMenu id="deviceId" value="#{deviceBean.deviceId}" valueChangeListener="#{deviceBean.startLiveStream}">
> <f:selectItems value="#{deviceBean.userDevices}"/>
> <a4j:support event="onchange" reRender="videoPanel" />
> </h:selectOneMenu>
> <rich:panel id="videoPanel" rendered="#{deviceBean.showPane}">
> My Panel..
> </rich:panel> </h:panelGrid>
</a4j:form>
1)When a list value is selected , valueChangeListener is called , which updates the showPane value in a method (sets to true , default value is false)
2)But even though showPane value is set to true , rich panel is not getting displayed.
3)Following is the log , with jsf's "PhaseListener" incorporated,it clearly indicates that , before "RENDER_RESPONSE" is completed , showPane value is set to true Still rich panel with id videoPanel is not getting displayed.
4)The backing bean (deviceBean) is request scoped.
-------------log for phase listener ----------
START PHASE PROCESS_VALIDATIONS 3
is show pane called..false
inside startLiveStream
returning from service method..
END PHASE PROCESS_VALIDATIONS 3
START PHASE UPDATE_MODEL_VALUES 4
is show pane called..true
END PHASE UPDATE_MODEL_VALUES 4
START PHASE INVOKE_APPLICATION 5
END PHASE INVOKE_APPLICATION 5
START PHASE RENDER_RESPONSE 6
is show pane called..true
is show pane called..true
END PHASE RENDER_RESPONSE 6
Upvotes: 0
Views: 2723
Reputation: 1590
I tried following code and it worked. As evident from documentation of a4j:outputPanel,it wraps the component which needs to be updated/modified , which is true for panelGrid as shown below
<a4j:outputPanel layout="none">
<h:panelGrid id="videoPanel" rendered="#{deviceBean.showPane}">
Display Panel..
</h:panelGrid>
</a4j:outptPanel>
Upvotes: 0