8
In my application I have three dropdown menu (p:selectOneMenu), say A, B, C. Among them two are dependent, say B and C. By changing the value of B I am dynamically loading values to C. Also there is a textbox. The value of the textbox is generating by ajax when the on-change event is firing from these three dropdowns.
Here is the xhtml:
<p:selectOneMenu id="customerMenu" value="#{adminController.activityDTO.customerId}" required="true" label="Customer Name" style="width: 200px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{adminController.customers}" var="customer" itemLabel="#{customer.customerName}" itemValue="#{customer.customerId}" />
<p:ajax listener="#{adminController.generateActivityName}" update="activityId" />
</p:selectOneMenu>
<p:selectOneMenu id="activityTypeMenu" value="#{adminController.activityDTO.activityParentType}" required="true" label="Activity Type"
style="width: 200px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{adminController.activityTypes}" var="activityType" itemLabel="#{activityType.parent}" itemValue="#{activityType.parent}" />
<p:ajax listener="#{adminController.updateDependentActivity}" update="activitySubType" />
</p:selectOneMenu>
<p:selectOneMenu id="activitySubTypeMenu" value="#{adminController.activityDTO.activitySubType}" required="true" label="Activity Sub Type"
style="width: 200px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{adminController.activitySubTypes}" var="activityType" itemLabel="#{activityType.name}" itemValue="#{activityType.id}" />
<p:ajax listener="#{adminController.generateActivityId}" update="activityId" />
</p:selectOneMenu>
<p:inputText id="activityId" autocomplete="off" readonly="true" value="#{adminController.act