dynamically rendering a component
brysona May 24, 2007 9:30 AMI have a drop down list that hides and shows 2 sections. This works ok. I also have a similar drop down list in the 2nd section but that does not work. Is it not possible to nest in this way so that you can render a section and then within that section render a sub part of that section depending on options selected. I have tried a variety of options but to no avail.
<h:panelGrid columns="3" id="runSchedulePanel1" width="50%">
<a4j:region renderRegionOnly="false">
<h:outputLabel for="runSchedule" value="Run Schedule" />
<h:selectOneMenu value="#{RouteBean.schedule.runSchedule}"
id="runSchedule" required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItem itemLabel="Every Day" itemValue="daily" />
<f:selectItem itemLabel="Specific Days" itemValue="weekly" />
<a4j:support ajaxSingle="true" event="onchange" reRender="dailySchedPanel, weeklySchedPanel" />
</h:selectOneMenu>
<h:message for="runSchedule" />
</a4j:region>
</h:panelGrid>
Section 1
<a4j:outputPanel id="dailySchedPanel" layout="block">
<h:panelGrid columns="6" id="runSchedulePanel2" width="50%" rendered="#{RouteBean.schedule.runSchedule == 'daily'}">
<h:outputLabel for="dailyStartTime" value="Start Time" />
<h:selectOneMenu value="#{RouteBean.schedule.dailySchedule.dailyStartTime}"
id="dailyStartTime">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{FcfmConstants.hoursOptions}" />
</h:selectOneMenu>
<h:message for="dailyStartTime" />
<h:outputLabel for="dailyEndTime" value="End Time" />
<h:selectOneMenu value="#{RouteBean.schedule.dailySchedule.dailyEndTime}"
id="dailyEndTime">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{FcfmConstants.hoursOptions}" />
</h:selectOneMenu>
<h:message for="dailyEndTime" />
</h:panelGrid>
</a4j:outputPanel>
Section 2
<a4j:outputPanel id="weeklySchedPanel" layout="block" >
<h:panelGrid columns="1" rendered="#{RouteBean.schedule.runSchedule == 'weekly'}">
<h:outputText value="Select the days and times that you wish files to be transfered" />
<f:verbatim>
</f:verbatim>
<a4j:region renderRegionOnly="false">
<h:outputLabel for="runSchedule" value="XXXX" />
<h:selectOneMenu value="#{RouteBean.createReceivingTransferDetails.operateSystem}"
id="receiving_operateSystem" required="false">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItem itemLabel="Unix" itemValue="Unix" />
<f:selectItem itemLabel="Windows" itemValue="Windows" />
<f:selectItem itemLabel="AS400" itemValue="AS400" />
<a4j:support ajaxSingle="true" event="onchange" reRender="monSchedPanelx" />
</h:selectOneMenu>
</a4j:region>
<a4j:outputPanel id="monSchedPanelx" layout="inline">
<h:outputFormat value="zz#{RouteBean.createReceivingTransferDetails.operateSystem}" /> <t:dataTable value="#{FcfmConstants.dummyOne}" var="row" rendered="#{RouteBean.createReceivingTransferDetails.operateSystem == 'Unix'}" >
<t:columns value="#{FcfmConstants.hours}" var="column" width="20">
<h:outputText value="#{column}"/>
<h:inputText value="#{RouteBean.supportLevel.monSuppLevel[column-1]}" id="suppLevel" maxlength="1" style="background-color:lightblue; width:15px" />
<h:message for="suppLevel" />
</t:columns>
</t:dataTable>
</a4j:outputPanel>
</a4j:outputPanel>