4

私の見解selectOneMenuでは、次のコードに示すように私は持っています:

   <h:panelGroup id="mysrvicenodesblock" layout="block">
     <table id="mysrvicenodestab" border="0" width="100%">
    <tr>
          <td align="center" class="underline">node Id</td>
          <td align="center" class="underline">node Name</td>
          <td align="center" class="underline">Go to node</td>                                  
          <td align="center" class="underline">Action</td>
        </tr>
      <c:forEach items="${jbpmAPIUtil.myServiceNodeToComplete}" var="msntoc">
        <tr>
          <td align="center">${msntoc.getId()}</td>
          <td align="center">${msntoc.getName()}</td>
          <td align="center">
         <h:selectOneMenu value="#{jbpmAPIUtil.procNdNameSelectedValue}" id="procnodes">
                <f:selectItem itemLabel="" itemValue="" />
                <f:selectItems value="#{jbpmAPIUtil.procnodes}" var="pn"  itemLabel="# {pn.getName()}" itemValue="#{pn.getId()}" />
<f:ajax event="change" listener="#{jbpmAPIUtil.OnONeMenuProcNdSelChgeHndler}" />
             </h:selectOneMenu>
          </td>                                     
          <td align="center">                                               
          <h:commandLink value="Complete !">
             <f:ajax event="click" listener="#{jbpmAPIUtil.Completemsn}">
             </f:ajax>                                             <f:param value="${msntoc.getWorkitemid()}" name="msntocwiid"/>
                                                 </h:commandLink>
 </td>             


     </tr>
</c:forEach>
</table>
</h:panelGroup>

このコンポーネントは<h:panelGroup layout="block">、primefacesで定期的に更新されるに含まれていp:pollます。

この要素の値をバインドするために使用されるBeanは、セッションスコープのBeanです(これが「バインド」とも呼ばれるかどうかはわかりませんが、このコンポーネントには「バインド」属性はありません)。

Beanとビューのスコープが異なるためにこの問題が発生することを多くの投稿で読みましたが、この問題が発生することなく何度もこのような状況にあったことを覚えています。

どのバインディングがこの問題を引き起こしたのかを正確に知りたいのですが、この問題の発生を回避する他の解決策はありますか。

これは、commandLinkボタンをクリックしたときに発生するこの問題の完全なスタックであり、foreachループの内容を含むテーブルが変更されます(1つの行が削除され、他の2つの行がリストに追加されます)

SEVERE: +id: j_id1
 type: javax.faces.component.UIViewRoot@c0fee0
  +id: javax_faces_location_HEAD
   type: com.sun.faces.component.ComponentResourceContainer@5be0a8
    +id: j_id2
     type: javax.faces.component.UIOutput@1fa3bee
    +id: j_id3
     type: javax.faces.component.UIOutput@174b989
    +id: j_id4
     type: javax.faces.component.UIOutput@40f2f1
  +id: j_idt2
   type: <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>

  +id: j_idt3
   type: <html xmlns="http://www.w3.org/1999/xhtml">

  +id: j_idt4
   type: javax.faces.component.UIOutput@dd874
    +id: j_idt5
     type: 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <link rel="stylesheet" type="text/css" href="CSS/general.css"/>

<script src="JS/jquery-1.8.3.js"/>
<script src="JS/jquery-ui-1.10.0.custom.js"/>
<script src="JS/jquerygen.js"/>
<script src="JS/general.js"/>


    <title>Xtensus Workflow App </title>



  +id: j_idt6
   type: 

<body>

  +id: j_idt7
   type: javax.faces.component.html.HtmlForm@fdc98d
    +id: j_idt8
     type: 

<div id="ctrldiv">

Id du noeud actuel (le curseur jbpm) : 
    +id: niid
     type: javax.faces.component.html.HtmlOutputText@1bb55d3
    +id: j_idt9
     type: <br/>
Nom du noeud actuel (le curseur jbpm) : 
    +id: cnn
     type: javax.faces.component.html.HtmlOutputText@1ff95a9
    +id: j_idt10
     type: <br/>




    +id: j_idt11
     type: javax.faces.component.html.HtmlCommandLink@baa6f7
    +id: j_idt12
     type: 


<br/>       


<br/>

<H3>#Noeuds en cours d'execution : </H3>
<div>

    +id: mysrvicenodesblock
     type: javax.faces.component.html.HtmlPanelGroup@27d9e5
      +id: j_idt13
       type: 
                            <table id="mysrvicenodestab" border="0" width="100%">
                                <tr>
                                    <td align="center" class="underline">node Id</td>
                                    <td align="center" class="underline">node Name</td>
                                    <td align="center" class="underline">Go to node</td>                                    
                                    <td align="center" class="underline">Action</td>
                                </tr>

      +id: j_idt18
       type: 
                                    <tr>
                                        <td align="center">${msntoc.getId()}</td>
                                        <td align="center">${msntoc.getName()}</td>
                                        <td align="center">


      +id: procnodes
       type: javax.faces.component.html.HtmlSelectOneMenu@527386
        +id: j_idt19
         type: javax.faces.component.UISelectItem@11e7e46
        +id: j_idt20
         type: javax.faces.component.UISelectItems@f45673
      +id: j_idt21
       type: 

                                        </td>                                       
                                        <td align="center">                                               

      +id: j_idt22
       type: javax.faces.component.html.HtmlCommandLink@157be76
        +id: j_idt23
         type: javax.faces.component.UIParameter@1996e15
      +id: j_idt24
       type: 
                                        </td>             


                                    </tr>

      +id: j_idt25
       type: 
                                    <tr>
                                        <td align="center">${msntoc.getId()}</td>
                                        <td align="center">${msntoc.getName()}</td>
                                        <td align="center">


      +id: procnodes
       type: javax.faces.component.html.HtmlSelectOneMenu@a5adc
        +id: j_idt27
         type: javax.faces.component.UISelectItem@1d34eac
        +id: j_idt28
         type: javax.faces.component.UISelectItems@1d20651
      +id: j_idt29
       type: 

                                        </td>                                       
                                        <td align="center">                                               

      +id: j_idt30
       type: javax.faces.component.html.HtmlCommandLink@19cee52
        +id: j_idt31
         type: javax.faces.component.UIParameter@1e27046
      +id: j_idt32
       type: 
                                        </td>             


                                    </tr>

      +id: j_idt33
       type: 
                                    <tr>
                                        <td align="center">${msntoc.getId()}</td>
                                        <td align="center">${msntoc.getName()}</td>
                                        <td align="center">


      +id: procnodes
       type: javax.faces.component.html.HtmlSelectOneMenu@1391a2c
        +id: j_idt35
         type: javax.faces.component.UISelectItem@1e54eb7
        +id: j_idt36
         type: javax.faces.component.UISelectItems@1930089
      +id: j_idt37
       type: 

                                        </td>                                       
                                        <td align="center">                                               

      +id: j_idt38
       type: javax.faces.component.html.HtmlCommandLink@860ba
        +id: j_idt39
         type: javax.faces.component.UIParameter@664ca
      +id: j_idt40
       type: 
                                        </td>             


                                    </tr>

      +id: j_idt14
       type: 
                            </table>

    +id: j_idt15
     type: 
</div>      



</div>


    +id: j_idt16
     type: org.primefaces.component.poll.Poll@1c334de
  +id: j_idt17
   type: 
</body>
</html>

Mar 8, 2013 5:08:49 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
SEVERE: Error Rendering View[/index.xhtml]
java.lang.IllegalStateException: Component ID j_idt7:procnodes has already been found in the view.  
    at com.sun.faces.util.Util.checkIdUniqueness(Util.java:910)
    at com.sun.faces.util.Util.checkIdUniqueness(Util.java:894)
    at com.sun.faces.util.Util.checkIdUniqueness(Util.java:894)
    at com.sun.faces.application.view.FaceletFullStateManagementStrategy.saveView(FaceletFullStateManagementStrategy.java:680)
    at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89)
    at javax.faces.application.StateManager.getViewState(StateManager.java:553)
    at com.sun.faces.context.PartialViewContextImpl.renderState(PartialViewContextImpl.java:416)
    at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:300)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:409)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    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:585)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
4

1 に答える 1

5

デフォルトでは、<c:forEach>JSTL はコンポーネント内のコンポーネントの子 ID をインクリメントしません。EL式でこれを行うか、コレクションの反復処理により適したJSFコンポーネントを使用する必要がありますUIRepeat.

<ui:repeat value="#{jbpmAPIUtil.myServiceNodeToComplete}" var="msntoc">

forEach コンポーネントを置き換える次のコンポーネントは、この内部のコンポーネントから生成された ID を適切に繰り返します。このようにして、重複する ID がページに存在しなくなります。

注: ページで代わりに、および代わりに使用していることを再確認<h:head><head><h:body>ください<body>。スタック トレースで、それに関連する他の問題が発生している可能性が疑わしいように見えました。

于 2013-03-08T13:44:16.510 に答える