8 Replies Latest reply on Oct 28, 2011 11:14 AM by Brian Leathem

    rich:dragSource, doesn't work at all. need help.

    john Sheppard Newbie

      hello,

              I am actually using Richfaces 4.1.0M2, other components work (ex : rich:fileUpload) but I can't get the rich:dragSource to work, I added it as a child node of a layout, and to a picture, but I can't drag the parent node at all.

       

      I checked the generated HTML code, and the component doesn't do anything.

       

      been searching the net for a while now...if anyone can help.

        • 2. Re: rich:dragSource, doesn't work at all. need help.
          Brian Leathem Master

          Could be you've come across a bug, as is the case for Drag 'n Drop in the Tree comopnent:

          https://issues.jboss.org/browse/RF-10994

           

          Could you post some code of what you are trying to do?  Complete code, with backing bean so we can run it.

          • 3. Re: rich:dragSource, doesn't work at all. need help.
            john Sheppard Newbie

            thx Brian for your answer,

             

            yes, the scripts are not loaded, nothing is done to the parent component,

            here is the code :

            (I cannot drag the headers at all....)

             

            I didn't do anything special, the headers are loaded, but I just can't drag them around. Other components work ( like fileUpload), telling me that the scripts are working, the only problem is the drag And Drop.

             

            BUT when I checked for javascript errir I found this error : RichFaces.ui.Draggable is not a constructor

             

             

            these are the resources loaded :

            <head>

            <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
            <link href="/v4/favicon.ico" rel="shortcut icon">
            <link href="/v4/rfRes/skinning.ecss.xhtml?db=eAHT2H!mBQAFYQKc" rel="stylesheet" type="text/css">
            <link href="/v4/rfRes/fileupload.ecss.xhtml?db=eAHT2H!mBQAFYQKc&ln=org.richfaces" rel="stylesheet" type="text/css">
            <script src="/v4/javax.faces.resource/jsf.js.xhtml?ln=javax.faces&stage=Development" type="text/javascript">
            <script src="/v4/javax.faces.resource/jquery.js.xhtml" type="text/javascript">
            <script src="/v4/javax.faces.resource/richfaces.js.xhtml" type="text/javascript">
            <script src="/v4/javax.faces.resource/richfaces-queue.js.xhtml" type="text/javascript">
            <script src="/v4/javax.faces.resource/richfaces-base-component.js.xhtml" type="text/javascript">
            <script src="/v4/javax.faces.resource/richfaces-event.js.xhtml" type="text/javascript">
            <script src="/v4/javax.faces.resource/fileupload.js.xhtml?ln=org.richfaces" type="text/javascript">
            <link href="/v4/rfRes/panel.ecss.xhtml?db=eAHT2H!mBQAFYQKc&ln=org.richfaces" rel="stylesheet" type="text/css">
            <script src="/v4/javax.faces.resource/progressBar.js.xhtml?ln=org.richfaces" type="text/javascript">
            <link href="/v4/rfRes/progressBar.ecss.xhtml?db=eAHT2H!mBQAFYQKc&ln=org.richfaces" rel="stylesheet" type="text/css">
            <style type="text/css">
            
            

            </head>

             

             

            <rich:panel  style="width:133px" >
                            <f:facet name="myHeaders">
                                <h:outputText value="Headers List" />
                            </f:facet>
                             <h:dataTable  id="mheaders"  value="#{GuestImportListener.headers}" var="mheader">
                                <h:column>
                                    <a4j:outputPanel  layout="block"  styleClass="rf-ind-drag">
                                        <rich:dragSource type="myHeaderType" dragValue="#{mheader}" />
                                        <h:outputText value="#{mheader}">
                                        </h:outputText>
                                         </a4j:outputPanel>
                                </h:column>
                                <f:facet name="footer">
                                </f:facet>
                            </h:dataTable>
            </rich:panel>
            

             

             

             

             

            and thats the bean :

            @Named("GuestImportListener")
            @SessionScoped
            public class GuestImportListener implements Serializable {
                 /**
                 * returns a list of column headers
                 * @return 
                 */
                public ArrayList<String> getHeaders() {
                   ArrayList<String> keys = new ArrayList<String>();
                   keys.add("header1");
                   keys.add("header2");
                   return keys;
                }
            
            }
            
            • 4. Re: rich:dragSource, doesn't work at all. need help.
              Brian Leathem Master

              The above facelet code works fine for me, with the latest snapshot.  What version of RichFaces are you using?

              • 5. Re: rich:dragSource, doesn't work at all. need help.
                john Sheppard Newbie

                I am using 4.0.0.FINAL, I am starting to consider using primfaces for this one :/

                • 6. Re: rich:dragSource, doesn't work at all. need help.
                  Brian Leathem Master

                  Hi John,

                   

                  Can you try with the recently announced 4.1.0.M3, (or wait for the soon-to-be-tagged M4)?  Given that it works for me with the latest SNAPSHOT, I'm wondering if some fo the recent Resource Handling improvements have addressed this issue.

                   

                  Also, what browser are you using?  I tried it with Chrome 4 and Firefox 7.

                   

                  Let us know how it works out!

                   

                  Brian

                  • 7. Re: rich:dragSource, doesn't work at all. need help.
                    john Sheppard Newbie

                    hello Brian,

                                   are you talking about this version?  4.1.0.20111014-M3/ from the Jboss repository?

                     

                    https://repository.jboss.org/nexus/content/groups/public-jboss/

                     

                    or maybe I am using the wrong one?

                     

                     

                    By the way, I have installed Primefaces, and the dragging works very well, except that I am having problems with nested <p:draggable> inside a <h:dataTable>

                    • 8. Re: rich:dragSource, doesn't work at all. need help.
                      Brian Leathem Master

                      Hi John,

                       

                      Yes, that's the 4.1.0.M3 SNAPSHOT.  It's unfortunate that our milestone tags have timestamps on them, it makes them unnecessarily obscure

                       

                      Brian