我正在尝试使用可拖动的可放置组件S. 这是我的代码:
<h:panelGrid columns="2" cellpadding="10">
<p:column>
<p:fieldset id="belongTo" legend="Belong To" >
<p:dataGrid id="userGroups"
var="userGroup"
value="#{projectAdminisrationMB.selectedUserMemberOfGroups}"
columns="3">
<p:column>
<p:panel id="pnl1"
header="#{userGroup.name}"
style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="/images/group/adminGroup.gif"/>
</h:panelGrid>
</p:panel>
<p:draggable for="pnl1"
revert="true"
handle=".ui-panel-titlebar"
stack=".ui-panel"/>
</p:column>
</p:dataGrid>
</p:fieldset>
<p:droppable for="belongTo"
tolerance="touch"
activeStyleClass="ui-state-highlight"
datasource="userNotGroups" >
<p:ajax listener="#{projectAdminisrationMB.onExcludeFromGroupDrop}" />
</p:droppable>
</p:column>
<p:column>
<p:fieldset id="excludeFrom"
legend="Exclude From"
style="margin-top:20px">
<p:dataGrid id="userNotGroups"
var="userNotGroup"
value="#{projectAdminisrationMB.selectedUserNotMemberOfGroups}"
columns="3">
<p:column>
<p:panel id="pnl2"
header="#{userNotGroup.name}"
style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="/images/grou/defaultGroup.gif"/>
</h:panelGrid>
</p:panel>
<p:draggable for="pnl2"
revert="true"
handle=".ui-panel-titlebar"
stack=".ui-panel"/>
</p:column>
</p:dataGrid>
</p:fieldset>
<p:droppable for="excludeFrom"
tolerance="touch"
activeStyleClass="ui-state-highlight"
datasource="userGroups" >
<p:ajax listener="#{projectAdminisrationMB.onBelongToGroupDrop}" />
</p:droppable>
</p:column>
</h:panelGrid>
因此,当我触摸组件将其放到datagrid时,我收到此错误: 即使我只是移动组件,我也会得到它,组件是一个面板
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.sun.faces.renderkit.ServerSideStateHelper.getState(ServerSideStateHelper.java:263)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:97)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:217)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:334)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)