Pergunta

Is it somehow possible to have a form for a single row in a panelGrid? If I just put the specific columns in a form-Tag they are (of course) rendered in one single column of my parent panelGrid.

Is there a possibility to solve this problem? It does not matter if a solution use the jsf-tag or the primefaces-tag

I am using Mojarra 2.1.26 and Primefaces 4.0

Foi útil?

Solução

use partial process/update.

if your requirement is to send only data in specific row (and not sending other http parameters, even if they are not processed) add partialSubmit feature:

<h:form>
    <p:panelGrid id="grid">
        <p:row id="row1">
            <p:column>
                <p:inputText value="#{someBean.someProperty}"/>
            </p:column>
            <p:column>
                <p:inputText value="#{someBean.anotherProperty}"/>
            </p:column>
        </p:row>
        <!-- other rows -->
    </p:panelGrid>

    <p:commandButton action="#{someBean.someAction}" process="@this row1" 
        update="grid" partialSubmit="true" value="submit"/>
</h:form>

this behave the same (almost) as having a form just for row1.

note that you have to update grid because p:panelgrid renders its child components on its own.

however your desired behavior (exactly) is not possible using plain html either.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top