p:dataTable with converters/validators. Rows being editted on other than the first page do not stay in edit mode on conversion/validation violation

霸气de小男生 提交于 2020-01-05 12:50:37

问题


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:


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.



来源:https://stackoverflow.com/questions/26373251/pdatatable-with-converters-validators-rows-being-editted-on-other-than-the-fir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!