10 Replies Latest reply on Oct 1, 2012 1:21 PM by rock1984

    DnD Message & Indicator

    eklam

      I am using DnD and everything goes fine, but now I have to use an a4j:support on the same component and sometimes I got a message:

      "drag: Element with [j_id4:gridArquivos:0:j_id21]] 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!"

        • 1. Re: DnD Message & Indicator
          eklam

          Ops, the last of the post was cut off...

          So what does that message means?

          And about the indicator, how can I use an Image inside it ?

          • 2. Re: DnD Message & Indicator
            ilya_shaikovsky

            probably you using support and dragsupport on the same event.

            • 3. Re: DnD Message & Indicator
              eklam

              How am using two a4j:support ondblclick, and onclick, also a contextMenu. Here is my code:

              <a4j:support action="#{arquivoMB.abrirPasta}" event="ondblclick" reRender="arquivos" >
               <a4j:actionparam name="idPasta" value="#{item.id}" />
               </a4j:support>
              
               <a4j:support action="#{arquivoMB.selecionaIArquivo}" event="onclick" reRender="arquivos" >
               <a4j:actionparam name="idIArquivo" value="#{item.id}" />
               </a4j:support>
              .
              .
              .
              
              <rich:dragSupport
               id="dragsIArquivo"
               dragIndicator=":indicatorArquivo"
               dragType="iarquivo">
               <rich:dndParam id="dragDnDParam" name="label" value="#{item.titulo}" />
               <a4j:actionparam id="dragActionParam" value="#{item.id}" name="draggedArquivoId"/>
               </rich:dragSupport>
              
               <rich:dropSupport
               id="dropSupportArquivo"
               acceptedTypes="#{item.tipoAceito}"
               dropListener="#{arquivoMB.processDropArquivo}"
               reRender="gridArquivos">
               <a4j:actionparam id="dropActionparam" value="#{item.id}" name="droppedPastaId"/>
               </rich:dropSupport>


              How I should defines this events on the DnD?

              • 4. Re: DnD Message & Indicator
                sri_hari

                hi,
                I am also facing the same problem. i have tree drag and drop in my application. the tree node has a context menu as well as drag and drop. When i right click on the tree node both the drag indicator as well as the context menu starts appearing. is there any way to do it or i have to look in for an alternate ui design.

                • 5. Re: DnD Message & Indicator
                  stani0

                   

                  "Eklam" wrote:
                  I am using DnD and everything goes fine, but now I have to use an a4j:support on the same component and sometimes I got a message:

                  "drag: Element with [j_id4:gridArquivos:0:j_id21]] 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!"

                  Which RichFaces library version do you use?

                  "Eklam" wrote:
                  And I also would like to now if I can use an image in the dragIndicator, anyone?"

                  I've used something like (following http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/dragIndicator.html):
                  <rich:dragIndicator id="indicator">
                   <f:facet name="single">
                   <img src="{dragging}" />
                   </f:facet>
                  </rich:dragIndicator>
                  ...
                  <rich:dragSupport dragIndicator=":indicator"
                   dragType="product" dragValue="#{product}">
                   <rich:dndParam name="dragging" value="#{product.image}" />
                  </rich:dragSupport>


                  • 6. Re: DnD Message & Indicator
                    eklam

                    Couldn't solve it yet...

                    I am using 3.2.0-SR1.

                    Thanks for the sample!

                    • 7. Re: DnD Message & Indicator
                      eklam

                      Could any of you get a workaround?

                      • 8. Re: DnD Message & Indicator
                        nbelaevski

                        Hello,

                        This message means that there is no element with such id in DOM tree. That is usually caused by the fact that standard components doen't output client ids if id hasn't been set explicitly. Use ui:debug component to find component with id=j_id21 and set any id explicitly.

                        • 9. Re: DnD Message & Indicator
                          rock1984

                          Hello,

                           

                          I´m getting the same message, but only after I click on h:commandButton. When the page loads the first time, everything is correct.

                           

                          drop: Element with [montarArvore:lixeira] 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!

                           

                          Here is my code:

                           

                           

                          <h:form styleClass="association" id="montarArvore">
                          
                                             <rich:dragIndicator id="indicator1" />
                          
                                          <h:panelGrid columns="2" id="montarArvoreGrid">
                                              <h:panelGroup id="montarArvoreTree">
                                                  <rich:tree switchType="client" style="width:300px"
                                                      value="#{estruturaTree.estruturaNos}" var="_estrutura"
                                                      adviseNodeOpened="#{estruturaTree.adviseNodeOpened(this)}"
                                                      treeNodeVar="estruturaNode" dragIndicator="indicator1" dropListener="#{estruturaTree.dropListener}"
                                                      acceptedTypes="tipoNode,treeNode" dragType="treeNode"
                                                      rowKeyVar="key">
                                                      <rich:treeNode>
                                                          <rich:dndParam name="label" type="drag">#{_estrutura}</rich:dndParam>
                                                          <h:outputText value="#{_estrutura}" />
                                                      </rich:treeNode>
                                                  </rich:tree>
                                              </h:panelGroup>
                          
                                              <h:panelGroup id="montarArvoreList">
                                                  <h:graphicImage value="/img/lixeira.png" id="lixeira">                        
                                                      <rich:dropSupport acceptedTypes="treeNode" dropListener="#{estruturaTree.dropClearListener}" ></rich:dropSupport>
                                                  </h:graphicImage>
                                                  <br /><br />
                                                  <rich:dataList var="_tipo" value="#{tipoDAO.list()}">
                                                      <rich:dragSupport dragIndicator="indicator1" dragType="tipoNode"
                                                          dragValue="#{_tipo}" reRender="montarArvore">
                                                          <rich:dndParam name="label" type="drag">#{_tipo.descricao}</rich:dndParam>
                                                      </rich:dragSupport>
                                                      <h:outputText value="#{_tipo.descricao}" />
                                                  </rich:dataList>
                          
                                              </h:panelGroup>
                                          </h:panelGrid>
                          
                                          <h:commandButton id="salvar"
                                                    value="Salvar Estrutura"
                                                   action="#{estruturaTree.salvarEstrutura}" />
                          
                                      </h:form>
                          
                          

                           

                          What am I doing wrong? (Using Richfaces 3.3.3.Final)

                          • 10. Re: DnD Message & Indicator
                            rock1984

                            Don´t know if I did wrong putting rich:dropSupport inside h:graphicImage , but it worked when page loads with another rich:tab active.

                             

                            I solved my problem changing from this:

                            <h:graphicImage value="/img/lixeira.png" id="lixeira">                       
                                 <rich:dropSupport acceptedTypes="treeNode" dropListener="#{estruturaTree.dropClearListener}" ></rich:dropSupport>
                            </h:graphicImage>

                             

                            to this:

                            <h:graphicImage value="/img/lixeira.png" id="lixeira"></h:graphicImage>

                            <rich:dropSupport acceptedTypes="treeNode" dropListener="#{estruturaTree.dropClearListener}" ></rich:dropSupport>

                             

                            Now I saw this note:
                            Note: The parent component for dragSupport and dropSupport should be designed to render its children and has two attribute "onmouseover" and "onmouseout". You can use <a4j:outputPanel> as a container if the component is not satisfy this requirements. Use <a4j:outputPanel> layout="block" to wrap the component with a block type layout. We will work to eliminate this restriction in future.