0

这是代码的一部分

<p:dataTable styleClass="sectionTable" id="licenseslist" var="item" 
    value="#{licenseController.items}" paginator="true" rows="10" 
    emptyMessage="empty" rowsPerPageTemplate="10,20,50,100" lazy="true" 
    paginatorAlwaysVisible="false" paginatorTemplate="{RowsPerPageDropdown}
    {FirstPageLink} {PreviousPageLink} {CurrentPageReport} 
    {NextPageLink} {LastPageLink}" >  

    <p:column selectionMode="multiple" style="width:2%" disabledSelection="#{item.bisPurchaseExpired()}"/>

    <p:column  styleClass="td_name"  headerText="{bundle.memoq_licenses_table_head_display_name}">
        <h:outputText value="#{item.productVersion.product.displayName}" />
    </p:column>

    // more table data...

    <f:facet name="footer">  
             <h:commandLink id="submit" action="#{licenseController.pay()}" styleClass="button  button_black button_fieldValue">
             <span class="button_start"/>
             <h:outputText value="checkout" styleClass="button_end"/>
        </h:commandLink>>
    </f:facet>
</p:dataTable>

如果我点击链接:

javax.servlet.ServletException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
hu.weblib.kilgray.ev.CharEncodingFilter.doFilter(CharEncodingFilter.java:52)

root cause

java.lang.NullPointerException
org.primefaces.component.datatable.feature.SelectionFeature.decodeMultipleSelection(SelectionFeature.java:50)
org.primefaces.component.datatable.feature.SelectionFeature.decode(SelectionFeature.java:39)
org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:53)
javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787)
org.primefaces.component.api.UIData.processDecodes(UIData.java:224)
javax.faces.component.UIForm.processDecodes(UIForm.java:225)
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:933)
com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
hu.weblib.kilgray.ev.CharEncodingFilter.doFilter(CharEncodingFilter.java:52)

如果我放弃多个部分,它会起作用。所以也许缺少一些东西......但我不知道,什么......

(getRowKey 在lazymodel 中定义)我尝试了这个建议:primefaces dataTable 上的 selectionMode -> not working

4

1 回答 1

0

getRowData中缺少该 lazymodel方法,在实现此方法后,该功能就像魅力一样工作。

于 2014-05-29T07:32:07.757 回答