7 Replies Latest reply on Apr 8, 2011 4:57 PM by raid3n

    [RC4 Final] DropListener not triggered

    raid3n

      Hello, I was playing with DnD example of the showcase. I use RC4 final.

      My problem is myDropListener doesn't fire.

       

      <h:form id="form">

                          <a4j:outputPanel styleClass="question" id="panel1">

                                    <rich:dropTarget acceptedTypes="question"

                                              dropListener="#{dragDropEventBean.processDrop}"

                                              dropValue="question1" render="panel1 question1 question2" />

       

       

                                    <a4j:outputPanel layout="block">

       

       

                                              <rich:dragSource dragValue="question1" type="question" />

                                              <div id="question1" class="question_">

                                                        <label>Name</label> <input type="text" />

                                              </div>

                                    </a4j:outputPanel>

       

       

                          </a4j:outputPanel>

      </h:form>

       

      and my droplistener:

       

      @ManagedBean

      @RequestScoped

      public class DragDropEventBean implements DropListener {

       

        @Override

                public void processDrop(DropEvent event) {

                          System.out.println("something");  

                }

       

      }

        • 1. [RC4 Final] DropListener not triggered
          ilya_shaikovsky

          does the request fired itself? Any messages in server log if so?

          • 2. [RC4 Final] DropListener not triggered
            raid3n

            Hi Ilya,

             

            maybe that is useful:

             

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/drag.xhtml HTTP/1.1" 200 3502

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/rfRes/skinning.ecss?db=eAHL6rC8BQAEkAIG HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/jquery.js HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/rfRes/inputBackgroundImage.png?v=4.0.0.Final&db=eAFjZL!AyMDN-P8!4!-P714C6f!!GZgAYeQKqw__&ln=org.richfaces.images HTTP/1.1" 200 219

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/jquery.position.js HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/richfaces.js HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/richfaces-base-component.js HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/richfaces-event.js HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/jquery-ui-core.js?ln=org.richfaces HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/jquery-dnd.js?ln=org.richfaces HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/dnd-droppable.js?ln=org.richfaces HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - andrea [07/Apr/2011:13:57:25 +0200] "GET /WebClient/faces/javax.faces.resource/dnd-draggable.js?ln=org.richfaces HTTP/1.1" 304 -

            0:0:0:0:0:0:0:1 - - [07/Apr/2011:13:57:25 +0200] "GET /favicon.ico HTTP/1.1" 404 988

            • 3. [RC4 Final] DropListener not triggered
              raid3n

              Do I need some other CDI libraries? I use weld-servlet and tomcat.

              • 4. [RC4 Final] DropListener not triggered
                ilya_shaikovsky

                add phasetracker and check its output.

                • 5. [RC4 Final] DropListener not triggered
                  raid3n

                  Ok,

                   

                  now I am in the drag.xhtml

                   

                  When I request the page:

                  8-apr-2011 11.00.15 com.phase.MyPhaseTracker beforePhase

                  INFO: BEFORE RESTORE_VIEW 1

                  8-apr-2011 11.00.16 com.phase.MyPhaseTracker afterPhase

                  INFO: AFTER RESTORE_VIEW 1

                  8-apr-2011 11.00.16 com.phase.MyPhaseTracker beforePhase

                  INFO: BEFORE RENDER_RESPONSE 6

                  8-apr-2011 11.00.16 com.phase.MyPhaseTracker afterPhase

                  INFO: AFTER RENDER_RESPONSE 6

                   

                  When I drag the element, doesn't appear nothing.

                  • 6. [RC4 Final] DropListener not triggered
                    raid3n

                    these warnings could be significant for the issue?

                     

                    INFO: Tomcat 7 detected, CDI injection will be available in Servlets and Filters. Injection into Listeners is not supported

                    8-apr-2011 12.28.58 com.sun.faces.config.ConfigureListener contextInitialized

                    INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.NotNull, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class org.hibernate.validator.constraints.NotEmpty, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.Size, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.Pattern, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.Min, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.Max, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.AssertTrue, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.javascript.ClientServiceConfigParser parse

                    AVVERTENZA: Found JavaScript function definition for class javax.validation.constraints.AssertFalse, but that class is not presented

                    8-apr-2011 12.29.04 org.richfaces.cache.CacheManager getCacheFactory

                    • 7. Re: [RC4 Final] DropListener not triggered
                      raid3n

                      Solved defining <rich:dragIndicator>. But it's strange because the first example on the showcase doesn't use it....

                       

                      The rich:dragIndicator is a visual representation of a dragged object. The markup can be defined the markup of the indicator using nested components. By default, if the component is not defined a copy of the dragged elements are created.

                       

                      Visually it's true, but without that tag the processDrop is never fired.

                       

                      my processDrop example:

                       

                      public void processDrop(DropEvent event) {

                                          System.out.println("fired!");

                                }

                       

                       

                      With rich:dragIndicator tag:

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE RESTORE_VIEW 1

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER RESTORE_VIEW 1

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE APPLY_REQUEST_VALUES 2

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER APPLY_REQUEST_VALUES 2

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE PROCESS_VALIDATIONS 3

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER PROCESS_VALIDATIONS 3

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE UPDATE_MODEL_VALUES 4

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER UPDATE_MODEL_VALUES 4

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE INVOKE_APPLICATION 5

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER INVOKE_APPLICATION 5

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE RENDER_RESPONSE 6

                      8-apr-2011 22.54.37 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER RENDER_RESPONSE 6

                      fired!

                       

                       

                      Without:

                      8-apr-2011 22.54.41 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE RESTORE_VIEW 1

                      8-apr-2011 22.54.41 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER RESTORE_VIEW 1

                      8-apr-2011 22.54.41 com.phase.MyPhaseTracker beforePhase

                      INFO: BEFORE RENDER_RESPONSE 6

                      8-apr-2011 22.54.41 com.phase.MyPhaseTracker afterPhase

                      INFO: AFTER RENDER_RESPONSE 6