引起:java.lang.IllegalStateException:TextSearchFilter应该只有一个子组件 - 搜索组件

时间:2015-03-01 15:09:14

标签: jsf wildfly openfaces

我使用openfaces 3.0和wildfly 8.2.0

我在数据表

中遇到过滤器问题

当我使用过滤器正常工作

在wildfly 8.1.0中,这个问题不会发生

<o:dataTable
    var="row" 
    useAjax="true"
    value="#{docController.docs}"
    styleClass="table table-striped" pageSize="2"> 
    <o:column id="col1"
          sortingExpression="#{row.stringField1}">
        <f:facet name="header">
            <h:outputText id="id2" value="stringField1"/>
        </f:facet>
        <f:facet name="subHeader">
            <o:inputTextFilter expression="#{row.stringField1}"/>
        </f:facet>
        <h:outputText id="outputCol1" value="#{row.stringField1}"/>
    </o:column>
</o:dataTable>

-

  Caused by: java.lang.IllegalStateException: TextSearchFilter should have exactly one child component - the search component. children.size = 0
    at org.openfaces.component.filter.TextSearchFilter.getSearchComponent(TextSearchFilter.java:46) [openfaces-3.0.jar:3.0.0]
    at org.openfaces.renderkit.filter.TextSearchFilterRenderer.decode(TextSearchFilterRenderer.java:66) [openfaces-3.0.jar:3.0.0]
    at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:831) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1226) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at org.openfaces.component.OUIData.process(OUIData.java:959) [openfaces-3.0.jar:3.0.0]
    at org.openfaces.component.OUIData.processColumnFacets(OUIData.java:853) [openfaces-3.0.jar:3.0.0]
    at org.openfaces.component.OUIData.processDecodes(OUIData.java:766) [openfaces-3.0.jar:3.0.0]
    at org.openfaces.component.table.AbstractTable.processDecodes(AbstractTable.java:966) [openfaces-3.0.jar:3.0.0]
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1221) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIForm.processDecodes(UIForm.java:225) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1221) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1221) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:929) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89) [deltaspike-jsf-module-impl-1.0.2.jar:1.0.2]
    at javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:77) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    ... 47 more

1 个答案:

答案 0 :(得分:0)

它看起来像Openfaces的ajax错误。尝试删除&#34; useAjax&#34;和&#34;表达&#34;来自inputTextFilter:

<o:dataTable  var="row" value="#{docController.docs}"
styleClass="table table-striped" pageSize="2"> 
<o:column id="col1" sortingExpression="#{row.stringField1}">
    <f:facet name="header">
        <h:outputText id="id2" value="stringField1"/>
    </f:facet>
    <f:facet name="subHeader">
        <o:inputTextFilter />
    </f:facet>
    <h:outputText id="outputCol1" value="#{row.stringField1}"/>
</o:column>