4 Replies Latest reply on Aug 22, 2007 3:57 AM by test test

    Help Drag and Drop

    test test Newbie

      Hi everybody,

      I need yours help, please.

      I'm Trying to use <rich:dropSupport and he never want to rerender the other components. I use a4j:log to see where the problem is but I don't understand why!

      This is my code and the a4j log :

      <h:form id="form">



      <rich:panel
      bodyClass="bodyClass1">
      <f:facet name="header">
      <h:outputText value="#{langue.Create_LPCreationTitre}" />
      </f:facet>
      <a4j:outputPanel style="border:1px solid gray;padding:2px;" layout="block" >
      <h:messages/>
      <rich:dropSupport id="drop" acceptedTypes="Course"
      dropValue="text" dropListener="#{eventBean.processDrop}"
      reRender="lp,ec" ></rich:dropSupport>

      <rich:dataTable id="lp" width="450"
      value="#{BeansPageCreationDD.list}" var="val2"
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      columnClasses="col">
      <f:facet name="header">
      <h:outputText styleClass="textee2" value="#{langue.Create_LPCreationCourse} " />
      </f:facet>
      <h:column>
      <h:graphicImage value="/Images/icons/imgmenu.gif" />
      <rich:spacer width="10" />
      <h:outputText styleClass="textee2" value="#{val2.name}" />
      </h:column>
      </rich:dataTable>
      </a4j:outputPanel>
      </rich:panel>
      <rich:panel
      bodyClass="bodyClass1">
      <f:facet name="header">
      <h:outputText value="#{langue.Create_ExistCourseTitre}" />
      </f:facet>
      <h:panelGrid columns="1">
      <a4j:region rendered="true" selfRendered="true" >


      <rich:dataTable id="ec" width="400"
      value="#{BeansPageCreationDD.list2Trie}" rows="10"
      var="val"
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      columnClasses="col">
      <f:facet name="header">
      <rich:columnGroup>
      <rich:column>
      <h:outputText styleClass="textee2" value="#{langue.Create_ExistCourse}" />
      </rich:column>
      <rich:column>
      <h:outputText styleClass="textee2" value="#{langue.Create_ExistCode}" />
      </rich:column>
      </rich:columnGroup>
      </f:facet>
      <h:column>
      <h:panelGrid columns="3">
      <h:graphicImage value="/Images/icons/imgmenu.gif" />
      <rich:spacer width="10" />
      <a4j:outputPanel layout="block" ajaxRendered="true">
      <rich:dragSupport dragIndicator=":indicator"
      dragType="Course" dragValue="#{val}">
      <rich:dndParam name="label" value="#{val.name}" />
      </rich:dragSupport>
      <h:outputText styleClass="textee2"
      value="#{val.name}" />
      </a4j:outputPanel>
      </h:panelGrid>
      </h:column>
      <h:column>
      <rich:spacer width="20" />
      <h:graphicImage value="/Images/icons/link.gif" />
      <rich:spacer width="10" />
      <h:outputText styleClass="textee2"
      value=" #{val.courseCode} " />
      </h:column>
      </rich:dataTable>
      <rich:spacer height="15" />
      <rich:datascroller for="ec" maxPages="8" />
      </a4j:region>
      </h:panelGrid>
      </rich:panel>




      </h:form>


      LOG:
      -------
      debug[17:03:49,792]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: mouseup
      debug[17:03:49,792]: NEW AJAX REQUEST !!! with form :form
      debug[17:03:49,808]: Append hidden control form with value [form] and value attribute [form]
      debug[17:03:49,808]: parameter form:drop with value form:drop
      debug[17:03:49,823]: parameter dropTargetId with value form:drop
      debug[17:03:49,823]: parameter dragSourceId with value form:ec:0:_id72
      debug[17:03:49,839]: parameter form:ec:0:_id72 with value form:ec:0:_id72
      debug[17:03:49,839]: parameter [object] with value [object]
      debug[17:03:49,855]: Start XmlHttpRequest
      debug[17:03:49,855]: Reqest state : 1
      debug[17:03:49,870]: QueryString: AJAXREQUEST=_viewRoot&form=form&form%3Adrop=form%3Adrop&dropTargetId=form%3Adrop&dragSourceId=form%3Aec%3A0%3A_id72&form%3Aec%3A0%3A_id72=form%3Aec%3A0%3A_id72&%5Bobject%5D=%5Bobject%5D&
      debug[17:03:49,995]: Reqest state : 2
      debug[17:03:50,011]: Reqest state : 3
      debug[17:03:50,011]: Reqest state : 4
      debug[17:03:50,026]: Reqest end with state 4
      debug[17:03:50,026]: Response with content-type: text/xml;charset=UTF-8
      debug[17:03:50,026]: Full response content: <?xml version="1.0"?>
      Learning Plan Manager
















      /*<![CDATA[*/
      .gridContent { vertical-align:top;
      } .bodyClass1 {
      background-color: #FFFFFF; }
      /*]]>*/

      debug[17:03:50,042]: Update page by list of rendered areas from response form:lp,form:ec,_id82
      debug[17:03:50,042]: search for elements by name 'script' in element #document
      debug[17:03:50,058]: selectNodes found 17
      debug[17:03:50,073]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.jsf
      debug[17:03:50,073]: Such element exist in document
      debug[17:03:50,073]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.jsf
      debug[17:03:50,089]: Such element exist in document
      debug[17:03:50,089]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.dnd.DnDScript.jsf
      debug[17:03:50,105]: Such element exist in document
      debug[17:03:50,105]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/utils.js.jsf
      debug[17:03:50,120]: Such element exist in document
      debug[17:03:50,120]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js.jsf
      debug[17:03:50,136]: Such element exist in document
      debug[17:03:50,136]: in response with src=/wls_kuq18/a4j.res/scripts/drag-indicator.js.jsf
      debug[17:03:50,151]: Such element exist in document
      debug[17:03:50,151]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.ajax.ImageCacheScript.jsf
      debug[17:03:50,167]: Such element exist in document
      debug[17:03:50,167]: in response with src=/wls_kuq18/a4j.res/org/ajax4jsf/renderkit/html/scripts/form.js.jsf
      debug[17:03:50,167]: Such element exist in document
      debug[17:03:50,183]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/browser_info.js.jsf
      debug[17:03:50,198]: Such element exist in document
      debug[17:03:50,198]: in response with src=/wls_kuq18/a4j.res/scripts/simpleTogglePanel.js.jsf
      debug[17:03:50,198]: Such element exist in document
      debug[17:03:50,214]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/json/json.js.jsf
      debug[17:03:50,214]: Such element exist in document
      debug[17:03:50,230]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js.jsf
      debug[17:03:50,230]: Such element exist in document
      debug[17:03:50,245]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/simple-dropzone.js.jsf
      debug[17:03:50,245]: Such element exist in document
      debug[17:03:50,261]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js.jsf
      debug[17:03:50,261]: Such element exist in document
      debug[17:03:50,276]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/simple-draggable.js.jsf
      debug[17:03:50,276]: Such element exist in document
      debug[17:03:50,292]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/modalPanel.js.jsf
      debug[17:03:50,292]: Such element exist in document
      debug[17:03:50,308]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/modalPanelBorders.js.jsf
      debug[17:03:50,308]: Such element exist in document
      debug[17:03:50,323]: search for elements by name 'link' in element #document
      debug[17:03:50,323]: selectNodes found 11
      debug[17:03:50,339]: in response with src=/wls_kuq18/a4j.res/css/dragIndicator.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,339]: Such element exist in document
      debug[17:03:50,355]: in response with src=/wls_kuq18/a4j.res/css/simpleTogglePanel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,355]: Such element exist in document
      debug[17:03:50,370]: in response with src=/wls_kuq18/a4j.res/css/panel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,370]: Such element exist in document
      debug[17:03:50,370]: in response with src=/wls_kuq18/a4j.res/css/spacer.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,386]: Such element exist in document
      debug[17:03:50,401]: in response with src=/wls_kuq18/a4j.res/css/table.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,401]: Such element exist in document
      debug[17:03:50,417]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/css/dragIndicator.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,417]: Such element exist in document
      debug[17:03:50,417]: in response with src=/wls_kuq18/a4j.res/css/datascroller.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,433]: Such element exist in document
      debug[17:03:50,433]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/css/modalPanel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
      debug[17:03:50,448]: Such element exist in document
      debug[17:03:50,448]: in response with src=../Scripts/style.css
      debug[17:03:50,464]: Such element exist in document
      debug[17:03:50,464]: in response with src=../Scripts/monstyle.css
      debug[17:03:50,480]: Such element exist in document
      debug[17:03:50,480]: in response with src=../Scripts/global.css
      debug[17:03:50,495]: Such element exist in document
      debug[17:03:50,495]: Attempt to update part of page for Id: form:lp
      debug[17:03:50,511]: call selectSingleNode for id= form:lp
      error[17:03:50,511]: New node for ID form:lp is not present in response
      debug[17:03:50,526]: Attempt to update part of page for Id: form:ec
      debug[17:03:50,526]: call selectSingleNode for id= form:ec
      error[17:03:50,542]: New node for ID form:ec is not present in response
      debug[17:03:50,542]: Attempt to update part of page for Id: _id82
      debug[17:03:50,558]: call selectSingleNode for id= _id82
      error[17:03:50,558]: New node for ID _id82 is not present in response
      debug[17:03:50,573]: call selectSingleNode for id= ajax-update-ids
      debug[17:03:50,573]: Hidden JSF state fields: null
      debug[17:03:50,589]: call selectSingleNode for id= _ajax:data
      debug[17:03:50,589]: call selectSingleNode for id= _A4J.AJAX.focus
      debug[17:03:50,605]: No focus information in response


      The problem is very strange, because when I refresh my page, the drag and drop is correcte. It's just a pb of reRender, but I can't find the solution.

      Please Help me.
      :'(

      Thanks a lots for yours answers
      Have a nice days!

        • 1. Re: Help Drag and Drop
          test test Newbie

          my debug has been cut so this is the last part :

          debug[17:03:49,792]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: mouseup
          debug[17:03:49,792]: NEW AJAX REQUEST !!! with form :form
          debug[17:03:49,808]: Append hidden control form with value [form] and value attribute [form]
          debug[17:03:49,808]: parameter form:drop with value form:drop
          debug[17:03:49,823]: parameter dropTargetId with value form:drop
          debug[17:03:49,823]: parameter dragSourceId with value form:ec:0:_id72
          debug[17:03:49,839]: parameter form:ec:0:_id72 with value form:ec:0:_id72
          debug[17:03:49,839]: parameter [object] with value [object]
          debug[17:03:49,855]: Start XmlHttpRequest
          debug[17:03:49,855]: Reqest state : 1
          debug[17:03:49,870]: QueryString: AJAXREQUEST=_viewRoot&form=form&form%3Adrop=form%3Adrop&dropTargetId=form%3Adrop&dragSourceId=form%3Aec%3A0%3A_id72&form%3Aec%3A0%3A_id72=form%3Aec%3A0%3A_id72&%5Bobject%5D=%5Bobject%5D&
          debug[17:03:49,995]: Reqest state : 2
          debug[17:03:50,011]: Reqest state : 3
          debug[17:03:50,011]: Reqest state : 4
          debug[17:03:50,026]: Reqest end with state 4
          debug[17:03:50,026]: Response with content-type: text/xml;charset=UTF-8
          debug[17:03:50,026]: Full response content: <?xml version="1.0"?>
          Learning Plan Manager
















          /*<![CDATA[*/
          .gridContent { vertical-align:top;
          } .bodyClass1 {
          background-color: #FFFFFF; }
          /*]]>*/

          debug[17:03:50,042]: Update page by list of rendered areas from response form:lp,form:ec,_id82
          debug[17:03:50,042]: search for elements by name 'script' in element #document
          debug[17:03:50,058]: selectNodes found 17
          debug[17:03:50,073]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.jsf
          debug[17:03:50,073]: Such element exist in document
          debug[17:03:50,073]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.jsf
          debug[17:03:50,089]: Such element exist in document
          debug[17:03:50,089]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.dnd.DnDScript.jsf
          debug[17:03:50,105]: Such element exist in document
          debug[17:03:50,105]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/utils.js.jsf
          debug[17:03:50,120]: Such element exist in document
          debug[17:03:50,120]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js.jsf
          debug[17:03:50,136]: Such element exist in document
          debug[17:03:50,136]: in response with src=/wls_kuq18/a4j.res/scripts/drag-indicator.js.jsf
          debug[17:03:50,151]: Such element exist in document
          debug[17:03:50,151]: in response with src=/wls_kuq18/a4j.res/org.ajax4jsf.framework.ajax.ImageCacheScript.jsf
          debug[17:03:50,167]: Such element exist in document
          debug[17:03:50,167]: in response with src=/wls_kuq18/a4j.res/org/ajax4jsf/renderkit/html/scripts/form.js.jsf
          debug[17:03:50,167]: Such element exist in document
          debug[17:03:50,183]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/browser_info.js.jsf
          debug[17:03:50,198]: Such element exist in document
          debug[17:03:50,198]: in response with src=/wls_kuq18/a4j.res/scripts/simpleTogglePanel.js.jsf
          debug[17:03:50,198]: Such element exist in document
          debug[17:03:50,214]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/json/json.js.jsf
          debug[17:03:50,214]: Such element exist in document
          debug[17:03:50,230]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js.jsf
          debug[17:03:50,230]: Such element exist in document
          debug[17:03:50,245]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/simple-dropzone.js.jsf
          debug[17:03:50,245]: Such element exist in document
          debug[17:03:50,261]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js.jsf
          debug[17:03:50,261]: Such element exist in document
          debug[17:03:50,276]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/simple-draggable.js.jsf
          debug[17:03:50,276]: Such element exist in document
          debug[17:03:50,292]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/modalPanel.js.jsf
          debug[17:03:50,292]: Such element exist in document
          debug[17:03:50,308]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/scripts/modalPanelBorders.js.jsf
          debug[17:03:50,308]: Such element exist in document
          debug[17:03:50,323]: search for elements by name 'link' in element #document
          debug[17:03:50,323]: selectNodes found 11
          debug[17:03:50,339]: in response with src=/wls_kuq18/a4j.res/css/dragIndicator.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,339]: Such element exist in document
          debug[17:03:50,355]: in response with src=/wls_kuq18/a4j.res/css/simpleTogglePanel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,355]: Such element exist in document
          debug[17:03:50,370]: in response with src=/wls_kuq18/a4j.res/css/panel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,370]: Such element exist in document
          debug[17:03:50,370]: in response with src=/wls_kuq18/a4j.res/css/spacer.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,386]: Such element exist in document
          debug[17:03:50,401]: in response with src=/wls_kuq18/a4j.res/css/table.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,401]: Such element exist in document
          debug[17:03:50,417]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/css/dragIndicator.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,417]: Such element exist in document
          debug[17:03:50,417]: in response with src=/wls_kuq18/a4j.res/css/datascroller.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,433]: Such element exist in document
          debug[17:03:50,433]: in response with src=/wls_kuq18/a4j.res/org/richfaces/renderkit/html/css/modalPanel.xcss/DATA/eAErfyd3CAAFqAJG.jsf
          debug[17:03:50,448]: Such element exist in document
          debug[17:03:50,448]: in response with src=../Scripts/style.css
          debug[17:03:50,464]: Such element exist in document
          debug[17:03:50,464]: in response with src=../Scripts/monstyle.css
          debug[17:03:50,480]: Such element exist in document
          debug[17:03:50,480]: in response with src=../Scripts/global.css
          debug[17:03:50,495]: Such element exist in document
          debug[17:03:50,495]: Attempt to update part of page for Id: form:lp
          debug[17:03:50,511]: call selectSingleNode for id= form:lp
          error[17:03:50,511]: New node for ID form:lp is not present in response
          debug[17:03:50,526]: Attempt to update part of page for Id: form:ec
          debug[17:03:50,526]: call selectSingleNode for id= form:ec
          error[17:03:50,542]: New node for ID form:ec is not present in response
          debug[17:03:50,542]: Attempt to update part of page for Id: _id82
          debug[17:03:50,558]: call selectSingleNode for id= _id82
          error[17:03:50,558]: New node for ID _id82 is not present in response
          debug[17:03:50,573]: call selectSingleNode for id= ajax-update-ids
          debug[17:03:50,573]: Hidden JSF state fields: null
          debug[17:03:50,589]: call selectSingleNode for id= _ajax:data
          debug[17:03:50,589]: call selectSingleNode for id= _A4J.AJAX.focus
          debug[17:03:50,605]: No focus information in response

          I think it's just a reRender pb but I can't Find it!

          Please help me.

          Thanks a lot for your answer.

          Have a nice day!

          • 2. Re: Help Drag and Drop
            test test Newbie

            debug[17:03:50,448]: Such element exist in document
            debug[17:03:50,448]: in response with src=../Scripts/style.css
            debug[17:03:50,464]: Such element exist in document
            debug[17:03:50,464]: in response with src=../Scripts/monstyle.css
            debug[17:03:50,480]: Such element exist in document
            debug[17:03:50,480]: in response with src=../Scripts/global.css
            debug[17:03:50,495]: Such element exist in document
            debug[17:03:50,495]: Attempt to update part of page for Id: form:lp
            debug[17:03:50,511]: call selectSingleNode for id= form:lp
            error[17:03:50,511]: New node for ID form:lp is not present in response
            debug[17:03:50,526]: Attempt to update part of page for Id: form:ec
            debug[17:03:50,526]: call selectSingleNode for id= form:ec
            error[17:03:50,542]: New node for ID form:ec is not present in response
            debug[17:03:50,542]: Attempt to update part of page for Id: _id82
            debug[17:03:50,558]: call selectSingleNode for id= _id82
            error[17:03:50,558]: New node for ID _id82 is not present in response
            debug[17:03:50,573]: call selectSingleNode for id= ajax-update-ids
            debug[17:03:50,573]: Hidden JSF state fields: null
            debug[17:03:50,589]: call selectSingleNode for id= _ajax:data
            debug[17:03:50,589]: call selectSingleNode for id= _A4J.AJAX.focus
            debug[17:03:50,605]: No focus information in response

            Sorry for this bad post. :$

            I think it's a reRender Pb but I can't find it.

            Please Help Me.

            Thanks a lots for yours answer.

            Have a nice day

            • 3. Re: Help Drag and Drop
              Ilya Shaikovsky Master

              could you please wrap your snipets to code tags.. t make it readable.

              • 4. Re: Help Drag and Drop
                test test Newbie

                Hi,

                Finally after 2 hour of debug, I've found the solution.

                I just put all the code between <a4j:region rendered="true" selfRendered="true" >

                And the drag and drop is ok.

                I don't know exactly the pb and It's seem strange for me.

                Thank for your answer.

                Have a nice day.