私のフォームには繰り返し値があります。私は<ui:repeat>
タグを使用しています。jsfで繰り返される値<ui:repeat>
マイコード:
<h:panelGroup id="alvs">
<ui:repeat value="#{encuestaController.newEncuesta.preguntas}" var="preg">
<h:outputLabel for="preg" value="add question:" style="font-weight:blue" />
<p:inputText id="preg" value="#{preg.pregunta}" />
<h:outputLabel for="value2" value="The question is option:" style="font-weight:bold" />
<p:selectBooleanButton id="value2" value="#{preg.opcional}" onLabel="Si" offLabel="No" onIcon="ui-icon-check" offIcon="ui-icon-close" style="width:60px">
<p:ajax update="f1:growl2"/>
</p:selectBooleanButton>
<h3 style="margin-top:2px">Question Type</h3>
<p:selectOneMenu value="#{preg.tipo}">
<f:selectItem itemValue="1" itemLabel="one option" />
<f:selectItem itemValue="2" itemLabel="many option" />
</p:selectOneMenu>
<h:panelGroup id="aux">
<ui:repeat value="#{preguntaController.newPregunta.opciones}" var="opc">
<h:panelGroup id="pn11" rendered="#{preg.tipo eq 1}">
uno<p:inputText value="#{opc.descripcion}"/>
</h:panelGroup>
<h:panelGroup id="pn12" rendered="#{preg.tipo eq 2}" >
dos<p:inputText value="#{opc.descripcion}"/>
</h:panelGroup>
</ui:repeat>
</h:panelGroup>
</ui:repeat>
</h:panelGroup>
<p:commandButton class="btn-floating btn-large waves-effect waves-light red" actionListener="#{preguntaController.addOcion}" update="f1:growl2" value="Add" >
<f:ajax execute="pn11 pn12" render="alvs" />
</p:commandButton>
私は<p:commandButton/>
これは、前の質問などのために同じオプションを追加して、質問(pregunta)に新しいオプション(opciones)を追加したいときに問題があります新しいもののために。
多分、エラーはajaxですか? <f:ajax execute="pn11 pn12" render="alvs" />
ヘルプme !!!
VEOファイルQUEestás于山マテリア、ASI QUE TE advierto QUE tengas cuidado CON EL funcionamientoデロスcomponentes puesto QUEらHACER UN 、Javascriptファイルのマテリアルをマテリアル化する要素。不特定多数の要素は、コンポーネントのリアリティコンポーネントをマテリアライズする機能を果たします。エスケープ・エンセロ・エンピリオ。 –