p:dataTable with converters/validators. Rows being

2019-08-09 08:44发布

Consider any simple <p:dataTable> with any JSF validator(s) / converter(s). Given below a cut-down version as an example to reduce complexity.

<p:column>
    <p:cellEditor>
        <f:facet name="output">
            <h:outputText value="#{row.value}"/>
        </f:facet>
        <f:facet name="input">
            <p:inputText value="#{row.value}" required="true"/>
        </f:facet>
    </p:cellEditor>
</p:column>

The given <p:inputText> is mandatory. Naturally, if a <p:row> is edited (using a <p:rowEditor>) and the given validation is violated on clicking the link (indicated by a tick mark by default), then the row should stay in edit mode unless the validation passes. This happens correctly only on the first page of <p:dataTable>.

If the table has pages and if a page is changed to other than the first page, then row which is being edited will go in display mode even though the validation is not satisfied once the edit link is pressed.

Actually, the validation is internally performed correctly but the editing row does not stay in edit mode, if any validation(s) is violated. It goes in display mode as soon as the edit link is clicked. This certainly should not happen.

Coming back to the first page from another page of <p:dataTable> would again surprisingly look normal (in short, the expected behaviour happens only on the first page of <p:dataTable>).

Is there a solution to this?

Given it a try on PrimeFaces 5.0 and 5.1 alternatively (community releases).


Update : This does happen in PrimeFaces 5.2 final too (community release).

1条回答
▲ chillily
2楼-- · 2019-08-09 09:24

This issue is no longer reproducible in PrimeFaces 5.3 final (community release).

Therefore, I assume it is fixed irrespective of the issue status (which is "Review") on the frozen issue tracker.

Other than that the only solution is to modify the source code, if using that (or higher) version is not an option.

查看更多
登录 后发表回答