primefaces datatable selectionMode multiple not working with mojarra

穿精又带淫゛_ 提交于 2020-01-14 03:18:10

问题


Recently I switched to mojarra from myfaces and noticed that primefaces datatable checkbox multiple row selection is not working.

I have tried the exact sample program available at http://www.primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf

With myfaces both single and multiple selection are working ,but with mojarra multiple selection is not working(selectedCars.length is 0 in setSelectedCars method)

I have tried with mojarra 2.0.3 and mojarra 2.1.0 with primefaces 2.2.1


回答1:


Adding 'f:view contentType="text/html"' solved the problem.

Read this in http://www.primefaces.org/faq.html




回答2:


           <p:column sortBy="#{tup.docTypeAndDirection}" >
                                <f:facet name="header">
                                <h:outputText value="Document Type"/>

                                </f:facet>
                                <h:outputText value="#{tup.docTypeAndDirection}"/>
          </p:column>

          <p:column sortBy="#{tup.partnerEDIAddress}" >
                                <f:facet name="header">
                                <h:outputText value="Partner Trading Address"/>
                                </f:facet>
                                <h:outputText value="#{tup.partnerEDIQual}:#{tup.partEDIAddr}"></h:outputText>
          </p:column>                   
        </p:dataTable>


来源:https://stackoverflow.com/questions/5569502/primefaces-datatable-selectionmode-multiple-not-working-with-mojarra

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