I have a SelectOneMenu in my xhtml view. In it I have an onchange that on clicking calls a p: dialog to fill a form. Follow selectOneMenu
<p:column headerText="Mecânica">
<div id="mecanicasAll">
<p:selectOneMenu onchange="PF('cadastraMecanica').show();"
id="mecanica" rendered="#{document.type == 'Pergunta'}"
value="#{bancoPerguntasMBean.mecanicas}" effect="fold">
<f:selectItem itemLabel="Selecione a mecânica"
noSelectionOption="true" />
<f:selectItems value="#{bancoPerguntasMBean.mecanicas}" />
</p:selectOneMenu>
</div>
</p:column>
No p: dialog I have this here
<h:form id="cadastraMecanica">
<p:dialog style="text-align: center" header="Cadastrar Mecânica"
widgetVar="cadastraMecanica" resizable="false" modal="true"
width="1050" height="630">
<c:if test="#{bancoPerguntasMBean.mecanicas == 'QUIZ'}">
<ui:include src="bancoPerguntasQuestaoQuiz.xhtml" />
</c:if>
<c:if test="#{bancoPerguntasMBean.mecanicas == 'VERDADEIROFALSO'}">
<ui:include src="bancoPerguntasQuestaoVerdadeiroFalso.xhtml" />
</c:if>
<c:if test="#{bancoPerguntasMBean.mecanicas == 'DESCRITIVA'}">
<ui:include src="bancoPerguntasQuestaoDescritiva.xhtml" />
</c:if>
<c:if test="#{bancoPerguntasMBean.mecanicas == 'ASSOCIACAO'}">
<ui:include src="bancoPerguntasQuestaoAssociacao.xhtml" />
</c:if>
<c:if test="#{bancoPerguntasMBean.mecanicas == 'ARRASTASOLTA'}">
<ui:include src="bancoPerguntasQuestaoArrastaSolta.xhtml" />
</c:if>
</p:dialog>
</h:form>
What I really need is that depending on the value that is selected in SelectOneMenu it makes the include of the file relative to the selected one.
Someone to help with this logic?