0
I am trying to post a part of the form but I have tried it in some ways and I still have problems.
Follow a screen print click to see the image
<h:form id="QuestaoCreateForm">
<h:panelGroup id="display">
<p:panelGrid columns="4" rendered="#{questaoController.selected != null}" layout="grid" styleClass="ui-panelgrid-blank" style="border:0px none; background-color:transparent;">
<p:outputLabel value="#{bundle.CreateQuestaoLabel_enunciado}" for="enunciado" />
<p:inputTextarea id="enunciado" rows="6" cols="33" value="#{questaoController.selected.enunciado}" title="#{bundle.CreateQuestaoTitle_enunciado}" required="true" requiredMessage="#{bundle.CreateQuestaoRequiredMessage_enunciado}"/>
<p:outputLabel value="#{bundle.CreateQuestaoLabel_orientacao}" for="orientacao" />
<p:inputTextarea id="orientacao" rows="6" cols="33" value="#{questaoController.selected.orientacao}" title="#{bundle.CreateQuestaoTitle_orientacao}" />
<p:outputLabel value="#{bundle.CreateQuestaoLabel_assunto}" for="assunto" />
<p:selectOneMenu id="assunto" value="#{questaoController.selected.assunto}" required="true" requiredMessage="#{bundle.EditQuestaoRequiredMessage_assunto}">
<f:selectItem itemLabel="#{bundle.SelectOneMessage}" noSelectionOption="true" />
<f:selectItems value="#{assuntoController.itemsAvailableSelectOne}"
var="assuntoItem"
itemValue="#{assuntoItem}"/>
</p:selectOneMenu>
<p:outputLabel value="#{bundle.CreateQuestaoLabel_tipoQuestao}" for="tipoQuestao" />
<p:selectOneMenu id="tipoQuestao" value="#{questaoController.selected.tipoQuestao}" required="true" requiredMessage="#{bundle.EditQuestaoRequiredMessage_tipoQuestao}">
<f:selectItem itemLabel="#{bundle.SelectOneMessage}" noSelectionOption="true" />
<f:selectItems value="#{tipoQuestaoController.itemsAvailableSelectOne}"
var="tipoQuestaoItem"
itemValue="#{tipoQuestaoItem}"/>
</p:selectOneMenu>
</p:panelGrid>
<p:panel header="Associar itens à Questão" >
<p:panelGrid columns="2" >
<p:outputLabel value="#{bundle.CreateItemQuestaoLabel_textoItem}" for="textoItem" style="color: red" />
<p:inputText id="textoItem" value="#{questaoController.itemQuestao.textoItem}" title="#{bundle.CreateItemQuestaoTitle_textoItem}" />
<p:outputLabel value="Nota:" for="nota" />
<p:inputNumber id="nota" value="#{questaoController.itemQuestao.nota}" title="Nota" decimalPlaces="2" />
</p:panelGrid>
<p:commandButton id="btn_add" value="Adicionar" update="itens_da_questao,:growl @parent" action="#{questaoController.reinit}" >
<p:collector value="#{questaoController.itemQuestao}" addTo="#{questaoController.selected.itemQuestaoList}" unique="false"/>
</p:commandButton>
<p:commandButton id="btn_reset" value="Limpar" type="reset"/>
</p:panel>
<p:panel header="Itens da Questão" id="itens_da_questao" >
<p:dataTable style="width:200px;" value="#{questaoController.selected.itemQuestaoList}" var="itemQuestao" id="booksTable" rendered="#{not empty questaoController.selected.itemQuestaoList}" >
<p:column headerText="Item Adicionado">
<h:outputText value="#{itemQuestao.textoItem}" />
</p:column>
<p:column headerText="Action">
<p:commandLink value="Remove" update=":QuestaoCreateForm:itens_da_questao" process=":QuestaoCreateForm:itens_da_questao">
<p:collector value="#{itemQuestao}" removeFrom="#{questaoController.selected.itemQuestaoList}" unique="false"/>
</p:commandLink>
</p:column>
</p:dataTable>
</p:panel>
<p:commandButton actionListener="#{questaoController.create}" action="/jsf/questao/List.xhtml" value="#{bundle.Save}" update="display,:growl"
process=":QuestaoCreateForm:enunciado, :QuestaoCreateForm:orientacao, :QuestaoCreateForm:assunto, :QuestaoCreateForm:tipoQuestao"
partialSubmit="true"
/>
<p:commandButton value="#{bundle.Cancel}" action="/jsf/questao/List.xhtml" immediate="true"/>
</h:panelGroup>
</h:form>
The ideal would be to work with 2 Forms ? Nested forms ? I have tried several ways in setting the boot..
It would be interesting [Dit] your answer with more information, not everyone will be able to open the image to be able to help you
– Denis Rudnei de Souza