3 Replies Latest reply on Jul 15, 2009 6:17 AM by ilya_shaikovsky

    Drag and Drop problem!

      Hi,

      I have a "rich:dragSupport" inside a "div" which is inside a "a4j:outputPanel". At first the "div" is not rendered, and after the user clicks on a link y reRender the "a4j:outputPanel" with the "div" inside and the "rich:dragSupport" in the "div", but I get the following error on Firefox:

      "drag: Element with [j_id13:j_id179:lsForm:j_id189] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!"


      Does anyone have an idea why this is happening?

      Thanks!

        • 1. Re: Drag and Drop problem!
          ilya_shaikovsky

          add actual code please.

          • 2. Re: Drag and Drop problem!
            scic

            I have a similar problem (richfaces 3.3.1.GA):
            I have a dataTable with dropSupport around it and dragSupport inside it:

             <h:form>
             <rich:dragIndicator id="indicator1" >
             <f:facet name="single">
             <h:graphicImage styleClass="indicatorPicture" value="/richfaces/jQuery/images/{draggedImage}" />
             </f:facet>
             </rich:dragIndicator>
             <rich:dragIndicator id="indicator2" />
            
             <h:panelGrid id="grid" columns="2" width="100%" columnClasses="col1,col2">
             <rich:panel style="width:400px;">
             <rich:dropSupport acceptedTypes="item" dropListener="#{bugBean.dropListener}" reRender="table" />
             <rich:dataTable style="width:100%" id="table" value="#{bugBean.list}" var="item" rows="20">
             <f:facet name="header">
             <h:outputText value="Text" />
             </f:facet>
            
             <rich:column sortBy="#{item}" filterBy="#{item}" filterEvent="onkeyup">
             <rich:dragSupport dragType="item" dragValue="#{item}" dragIndicator="indicator2">
             <rich:dndParam name="label" type="drag">drag1</rich:dndParam>
             </rich:dragSupport>
             <h:outputText value="#{item}" />
             </rich:column>
             </rich:dataTable>
             </rich:panel>
             </h:panelGrid>
            
             </h:form>
            


            then I have a backing bean like this:

            public class BugBean {
            
            
             // ---- state
             private List<String> _list;
            
             // ----- contructor
            
             public BugBean() {
             setList(new LinkedList<String>());
            
             getList().add(new String("aa"));
             }
            
             public void setList(List<String> _list) {
             this._list = _list;
             }
            
             public List<String> getList() {
             return _list;
             }
            
             public void dropListener(DropEvent dropEvent) {
             }
            
            }
            


            When I filter the list after the value "s" (which changes the datatable entries from aa to none in the example above) and I hit backspace and s again and again REALLY fast over several seconds. Thus I change the filtering of the list several times a second (from aa to none and back). Then eventually I get the javascript error message like in the first post:

             drag: Element with [j_id718:table:0:j_id723] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!
            


            If you cannot type fast enough you can increase the object size, so the update takes longer and the error is more likely to occur.

            I guess the different "ajax regions" are no longer synchronized after a while because one update is faster than the other.

            As a temporary solution I just commented out the js error messages in the js files and it works now for me. (Since the update of the other ajax region is eventually done. there is no furhter error).

            But may be this should be addressed more professionally. ;-)

            I also tried several combinations of rerender, limittolist, and ajaxSingle but maybe I have just not found the right one.


            • 3. Re: Drag and Drop problem!
              ilya_shaikovsky

              you should read the docs on a4j:queue and use it to avoid problems caused by requests concurrency