Hide show components which are created dynamically using PrimeFaces

102 views Asked by At

I have the following code which generates the radio button properly.

<c:forEach items="#{sampleController.modelVo.valuesList}" var="valueVo">
                             <p:selectOneRadio 
                                id="pickedSdlp_#{valueVo.id}" 
                                value="#{sampleController.selectedValue}" 
                                layout="responsive" 
                                columns="1" 
                                converter="omnifaces.SelectItemsConverter" >
                                    <f:selectItem 
                                        id="valueVo#{valueVo.id}" 
                                        itemLabel="#{valueVo.valueVoDesc}" 
                                        itemValue="#{valueVo}">
                                    </f:selectItem>
                            </p:selectOneRadio>
                             <p:selectManyCheckbox 
                                id="timeBlocks_#{valueVo.id}" 
                                value="#{valueVo.timeId}" 
                                layout="responsive" 
                                columns="1">
                                <f:selectItems value="#{valueVo.subValueList}" var="valueVoTime" itemLabel="#{valueVoTime.from} #{valueVoTime.to}" itemValue="#{valueVoTime.id}" />
                            </p:selectManyCheckbox>
                        </c:forEach>

Is it possible to hide/show p:selectManyCheckbox based on the value selected? the value is actually based on voList.canShow == 'Y', if Y then show else hide it.

Radio buttons are dynamically created so not sure how to achieve this.

I am able to generate the following and highlighted the radio selected under each radio button check boxes are generated but how to hide/show them based on the radio value(ON/OFF):

enter image description here

0

There are 0 answers