1 2 Previous Next 26 Replies Latest reply on Apr 2, 2008 4:24 AM by ilya_shaikovsky Go to original post
      • 15. Re: Drag-n-Drop broke in 3.1.4
        nbelaevski

        Hello,

        Could you please attach beans code? Thank you in advance!

        • 16. Re: Drag-n-Drop broke in 3.1.4
          pbaker01

           

          "nbelaevski" wrote:
          Hello,

          Could you please attach beans code? Thank you in advance!


          FYI, This project is part of a PoC. However, it is still complicated, especially the Drag-n-Drop. Could you be a little more specific on which code excerpts you would like to see. There are two forms involved here and the rendering for both is a bit involved. It would help to know what you are after...

          I have attached the faces-config.xml and the DragNDrop.java bean

          faces-config.xml

          <?xml version='1.0' encoding='UTF-8'?>
          
          <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
           version="1.2">
          
           <application>
           <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
           <message-bundle>voyager</message-bundle>
           <locale-config>
           <default-locale>en</default-locale>
           <supported-locale>de</supported-locale>
           </locale-config>
           </application>
          
           <managed-bean>
           <managed-bean-name>dragNdrop</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.DragNDrop
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           <managed-property>
           <property-name>flight</property-name>
           <value>#{flight}</value>
           </managed-property>
          
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>flightList</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.wab.FlightList
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>flight</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.wab.Flight
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
          
           <managed-bean>
           <managed-bean-name>cmnFeature</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.CMNFeature
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>cmnMenuData</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.CMNMenuData
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           <managed-property>
           <property-name>airline</property-name>
           <value>#{airline}</value>
           </managed-property>
           <managed-property>
           <property-name>country</property-name>
           <value>#{country}</value>
           </managed-property>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>menuState</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.MenuState
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>airline</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.entity.AirlineImpl
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>country</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.entity.CountryImpl
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>airlineList</managed-bean-name>
           <managed-bean-class>
           java.util.ArrayList
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>countryList</managed-bean-name>
           <managed-bean-class>
           java.util.ArrayList
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>commonData</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.CommonData
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           <managed-property>
           <property-name>airline</property-name>
           <value>#{airline}</value>
           </managed-property>
           <managed-property>
           <property-name>country</property-name>
           <value>#{country}</value>
           </managed-property>
           <managed-property>
           <property-name>airlineList</property-name>
           <value>#{airlineList}</value>
           </managed-property>
           <managed-property>
           <property-name>countryList</property-name>
           <value>#{countryList}</value>
           </managed-property>
           </managed-bean>
          
          
           <managed-bean>
           <managed-bean-name>WebConstants</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.constants.WebConstants
           </managed-bean-class>
           <managed-bean-scope>session</managed-bean-scope>
           </managed-bean>
          
          
           <managed-bean>
           <managed-bean-name>ldpFeature</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.LDPFeature
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>ldpMenuAirline</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.LDPMenuAirline
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>ldpMenuAircraftType</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.LDPMenuAircraftType
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           </managed-bean>
          
           <managed-bean>
           <managed-bean-name>ldpMenuFlightDispatch</managed-bean-name>
           <managed-bean-class>
           com.sita.voyager.common.managed.LDPMenuFlightDispatch
           </managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
           <property-name>menuState</property-name>
           <value>#{menuState}</value>
           </managed-property>
           </managed-bean>
          
           <navigation-rule>
           <from-view-id>/loadplanning/loadplanning.xhtml</from-view-id>
           <navigation-case><from-outcome>selectCMNComponent</from-outcome>
          
           <to-view-id>/common/commonfunctionality.xhtml</to-view-id>
           </navigation-case>
           </navigation-rule>
           <navigation-rule>
           <from-view-id>/common/commonfunctionality.xhtml</from-view-id>
           <navigation-case><from-outcome>selectLDPComponent</from-outcome>
          
           <to-view-id>/loadplanning/loadplanning.xhtml</to-view-id>
           </navigation-case>
           </navigation-rule>
          </faces-config>
          


          DragNDrop.java

          package com.sita.voyager.common.managed;
          
          import java.util.ArrayList;
          import java.util.HashMap;
          import java.util.List;
          
          import javax.faces.application.FacesMessage;
          import javax.faces.context.FacesContext;
          import javax.faces.event.ActionEvent;
          
          import org.richfaces.event.DragEvent;
          import org.richfaces.event.DropEvent;
          
          import com.sita.voyager.exceptions.ApplicationException;
          import com.sita.voyager.wab.Deadload;
          import com.sita.voyager.wab.Flight;
          
          /**
           * @author $Autor$
           *
           */
          public class DragNDrop {
          
           private List types = new ArrayList();
           private List loadItems = new ArrayList();
          
           private HashMap positions = new HashMap();
          
           private Object dragValue;
          
           private Object testParam;
          
           private Object targetValue;
           private Object dropValue;
          
           private Flight flight;
          
          
           public DragNDrop() {
           super();
          
           }
          
          
           /**
           * @return the flight
           */
           public Flight getFlight() {
           return flight;
           }
          
          
           /**
           * @param flight the flight to set
           */
           public void setFlight(Flight flight) {
           this.flight = flight;
           }
          
          
           public void processDrop(DropEvent event) {
           FacesContext context = FacesContext.getCurrentInstance();
           String dropType = (String) context.getExternalContext().getRequestParameterMap().get("DropType");
           String dropValue = (String) context.getExternalContext().getRequestParameterMap().get("DropValue");
           String dragType = (String) context.getExternalContext().getRequestParameterMap().get("DragType");
           String dragValue = (String) context.getExternalContext().getRequestParameterMap().get("DragValue");
          
           Deadload deadload;
           int id;
           if (dragType.equalsIgnoreCase("deadload")) {
           // Dragging deadload to the table? Y, ignore
           if (dropType.equalsIgnoreCase("table"))
           return;
           id = Integer.parseInt(dragValue);
          
           try {
           flight.assignPosition(id, dropValue);
           // FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Position assigned", null));
           } catch (ApplicationException ex){
           ex.printStackTrace();
           return;
           }
           } else {
           if (dropType.equalsIgnoreCase("table")) {
           try {
           flight.clearPosition(dragValue);
           } catch (ApplicationException ex){
           ex.printStackTrace();
           return;
           }
           } else {
           try {
           flight.swapPosition(dragValue, dropValue);
           } catch (ApplicationException ex){
           ex.printStackTrace();
           return;
           }
          
           }
          
          
          
           }
          
           }
          
           public void autoLoad(ActionEvent event) {
           try {
           flight.autoLoad();
           } catch (ApplicationException ex){
           ex.printStackTrace();
           return;
           }
           }
          
          
           public void unallocateAll(ActionEvent event) {
           flight.unallocateAll();
           }
          
           public void processDrag(DragEvent dragEvent) {
           System.out.println("Bean.processDrag()");
           }
          
           public List getTypes() {
           return types;
           }
          
           public String dragAction() {
           System.out.println("Bean.dragAction()");
           return null;
           }
          
           public String dropAction() {
           System.out.println("Bean.dropAction()");
           return null;
           }
          
           public Object getDragValue() {
           return dragValue;
           }
          
           public Object getTestParam() {
           return testParam;
           }
          
           public void setTestParam(Object testParam) {
           this.testParam = testParam;
           }
          
           /**
           * @return the targetValue
           */
           public Object getTargetValue() {
           return targetValue;
           }
          
           /**
           * @param targetValue the targetValue to set
           */
           public void setTargetValue(Object targetValue) {
           this.targetValue = targetValue;
           }
          
           /**
           * @return the dropValue
           */
           public Object getDropValue() {
           return dropValue;
           }
          
           /**
           * @param dropValue the dropValue to set
           */
           public void setDropValue(Object dropValue) {
           this.dropValue = dropValue;
           }
          
           /**
           * @return the loadItems
           */
           public List getLoadItems() {
           return loadItems;
           }
          
           /**
           * @param loadItems the loadItems to set
           */
           public void setLoadItems(List loadItems) {
           this.loadItems = loadItems;
           }
          
           /**
           * @return the positions
           */
           public HashMap getPositions() {
           return positions;
           }
          
           /**
           * @param positions the positions to set
           */
           public void setPositions(HashMap positions) {
           this.positions = positions;
           }
          }
          


          • 17. Re: Drag-n-Drop broke in 3.1.4
            nbelaevski

            What are you dragType & acceptedTypes?

            • 18. Re: Drag-n-Drop broke in 3.1.4
              pbaker01

               

              "nbelaevski" wrote:
              What are you dragType & acceptedTypes?


              Umm, it is all done programmatically. Each row in a table contains a drag type and each richpane object accepts one or more drop types.

              Doesn't this help?

              19:35:54,256 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
              sourceId=j_id315:j_id365[severity=(ERROR 2), summary=(Dropzone [j_id315:j_id365] with accepted types [[P1P]] cannot accept Draggable [j_id245:deadload:j_id294] with dragType [P1P]), detail=(Dropzone [j_id315:j_id365] with accepted types [[P1P]] cannot accept Draggable [j_id245:deadload:j_id294] with dragType [P1P])]
              
              


              • 19. Re: Drag-n-Drop broke in 3.1.4
                pbaker01

                More info:

                from unallocatedPayload2.xhtml

                <rich:dropSupport acceptedTypes="#{dragNdrop.flight.validPosTypes}"


                DragNDrop is show above.

                from Flight.java

                public String getValidPosTypes() {
                 return "[LD3, AKA, AKF, P1P, BULK]";
                }


                decklayout.xhtml

                Key code:

                <rich:dropSupport acceptedTypes="#{pos.validUldTypesArray}"
                 dropValue="#{pos.position}"
                 dropListener="#{dragNdrop.processDrop}"
                 reRender="deadload, positions">
                 <a4j:actionparam value="#{pos.position}" name="DropValue" />
                 <a4j:actionparam value="position" name="DropType" />
                 <rich:dndParam name="accept" type="drop">
                 <h:outputText value="Assign position #{pos.position}"></h:outputText>
                 </rich:dndParam>
                </rich:dropSupport>


                Conmplete Code:

                <html xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:rich="http://richfaces.org/rich"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:c="http://java.sun.com/jstl/core"
                 xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
                
                 <h:form>
                 <script type="text/javascript">
                 function chgZindex(node, z) {
                 document.getElementById(node.id).style.zIndex=z;
                 }
                
                 function chgColor(node, clr, wdt) {
                 document.getElementById(node.id).style.borderColor=clr;
                 document.getElementById(node.id).style.borderWidth=wdt;
                 }
                
                 </script>
                
                 <h:panelGrid id="positions" border="0" columns="1"
                 style="width:100%; overflow:auto; display:inline;">
                 <rich:separator height="4" lineType="double" />
                 <rich:spacer width="1" height="130" title="Here is a spacer..." />
                
                
                 <c:forEach items="#{flight.positions}" var="pos">
                
                 <rich:panel style="#{pos.style}" styleClass="#{pos.styleClass}"
                 zindex="1" bodyClass="posBody"
                 onmouseout="chgZindex(this, '1');chgColor(this,'Gray','2px');"
                 onmousemove="chgZindex(this, '1000');chgColor(this,'Green','3px');">
                 <rich:toolTip followMouse="true" direction="top-right" delay="1000"
                 styleClass="tooltip" style="width:250px;">
                 <span> This tool-tip will contain additional information
                 about position: #{pos.position} and any load that has been
                 assigned</span>
                 </rich:toolTip>
                 <rich:dragSupport dragIndicator=":indicator"
                 dragType="#{pos.uldType}" dragValue="#{pos.position}"
                 rendered="#{pos.assigned}">
                 <rich:dndParam name="accept" type="drag">
                 <h:outputText value="#{pos.uldType}"></h:outputText>
                 </rich:dndParam>
                
                 <rich:dndParam name="reject" type="drag">
                 <h:outputText value="#{pos.uldType} not accepted"></h:outputText>
                 </rich:dndParam>
                
                 <a4j:actionparam value="#{pos.position}" name="DragValue" />
                 <a4j:actionparam value="position" name="DragType" />
                 </rich:dragSupport>
                
                 <rich:dropSupport acceptedTypes="#{pos.validUldTypesArray}"
                 dropValue="#{pos.position}"
                 dropListener="#{dragNdrop.processDrop}"
                 reRender="deadload, positions">
                 <a4j:actionparam value="#{pos.position}" name="DropValue" />
                 <a4j:actionparam value="position" name="DropType" />
                 <rich:dndParam name="accept" type="drop">
                 <h:outputText value="Assign position #{pos.position}"></h:outputText>
                 </rich:dndParam>
                
                 </rich:dropSupport>
                 <h:commandLink actionListener="#{dragNdrop.unallocateAll}">
                 <h:outputText value="#{pos.position}" styleClass="posText" />
                 </h:commandLink>
                 <h:outputText value="#{pos.posText}" styleClass="posText"
                 escape="false"></h:outputText>
                 </rich:panel>
                
                 </c:forEach>
                 <rich:separator height="4" lineType="double" />
                 <h:panelGrid border="0" columns="2">
                 <h:commandLink styleClass="commandlink"
                 actionListener="#{dragNdrop.autoLoad}">
                 <h:outputText value="Auto Load" />
                 </h:commandLink>
                 <h:commandLink styleClass="commandlink"
                 actionListener="#{dragNdrop.unallocateAll}">
                 <h:outputText value="Unallocate All" />
                 </h:commandLink>
                 </h:panelGrid>
                
                 </h:panelGrid>
                
                 </h:form>
                
                
                </html>
                


                Pos bean - Position.java

                public String getValidUldTypesArray() {
                 StringBuffer types = new StringBuffer();
                 types.append("[");
                
                 for (Iterator<String> i = this.getValidTypes().iterator() ; i.hasNext(); ) {
                 types.append(i.next());
                 if (i.hasNext())
                 types.append(", ");
                 }
                
                 types.append("]");
                
                 return types.toString();
                 }
                


                Let me know how I can help get this resolved.


                • 20. Re: Drag-n-Drop broke in 3.1.4
                  nbelaevski

                  Thank you, looks like I see the root of the problem. It's a bug: http://jira.jboss.com/jira/browse/RF-2744 caused by wrong parsing of acceptedTypes. If you do not use "[]" symbols in acceptedTypes string then the error, message should go away.

                  I haven't really run the full example, so could you please let me know if it's working ok or not now? Thank you!

                  • 21. Re: Drag-n-Drop broke in 3.1.4
                    pbaker01

                     

                    "nbelaevski" wrote:
                    Thank you, looks like I see the root of the problem. It's a bug: http://jira.jboss.com/jira/browse/RF-2744 caused by wrong parsing of acceptedTypes. If you do not use "[]" symbols in acceptedTypes string then the error, message should go away.

                    I haven't really run the full example, so could you please let me know if it's working ok or not now? Thank you!


                    Thank You!!!! That did it!!!!

                    VERY MUCH appreciated!!!!!!

                    • 22. Re: Drag-n-Drop broke in 3.1.4

                      This still does not work for me... If I use 3.1.4 drag&drop works, if I switch to 3.2.0 without changing anything, it does not work. DraggableSource, DragType, DragValue, and DropValue are always null?

                      • 23. Re: Drag-n-Drop broke in 3.1.4
                        nbelaevski

                        Could you please provide some more info on that? Page/beans code would be fine...

                        • 24. Re: Drag-n-Drop broke in 3.1.4

                          Page Code

                          <html xmlns="http://www.w3.org/1999/xhtml"
                           xmlns:ui="http://java.sun.com/jsf/facelets"
                           xmlns:h="http://java.sun.com/jsf/html"
                           xmlns:f="http://java.sun.com/jsf/core"
                           xmlns:a4j="http://richfaces.org/a4j"
                           xmlns:rich="http://richfaces.org/rich"
                           xmlns:seam="http://jboss.com/products/seam/taglib"
                           xmlns:anadolu="http://www.anadolu.edu.tr/jsf/components">
                          <ui:composition template="/templates/layout.xhtml">
                          
                           <ui:define name="title">#{messages['pagetitles.musteri.detay']}</ui:define>
                           <ui:define name="menu">
                           <ui:include src="/common/menu.xhtml" />
                           </ui:define>
                          
                          
                           <ui:define name="content">
                          
                           <h:form id="mainForm">
                          
                          
                          
                           <div class="section">
                          
                           <div class="entry errors">
                           <h:messages globalOnly="true"/>
                           </div>
                          
                           <a4j:status>
                           <f:facet name="start">
                           <h:graphicImage value="/img/ajax-loader.gif" />
                           </f:facet>
                           </a4j:status>
                          
                          
                          
                           <rich:panel styleClass="panelBar">
                          
                           <f:facet name="header">
                           #{messages['ui.musteri.detay.baslik']}
                           </f:facet>
                          
                          
                           <rich:panelBar>
                          
                           <h:panelGrid columns="2" columnClasses="panelc" styleClass="togglePanels">
                          
                           <rich:panel styleClass="togglePanels">
                          
                           <f:facet name="header">
                           <h:outputText value="#{messages['ui.panel.tumyemekhanelistesi']}" />
                           </f:facet>
                          
                           <rich:dropSupport
                           acceptedTypes="refectoryToLeft"
                           reRender="availableRefectoriesList,selectedRefectoriesList"
                           dropListener="#{customerDetailsAction.removeSelectedRefectoryFromCustomer}"
                           ajaxSingle="true" />
                           <div id="managed">
                           <rich:dataTable
                           id="availableRefectoriesList"
                           value="#{availableRefectories}"
                           var="_refectory">
                           <rich:column>
                           <a4j:outputPanel layout="block">
                           <rich:dragSupport
                           dragIndicator=":indicator"
                           dragType="refectoryToRight"
                           dragValue="#{_refectory}" >
                           <rich:dndParam name="label" value="#{_refectory.name}" />
                           </rich:dragSupport>
                           <h:outputText id="availableRefectoryName" value="#{_refectory.name}" />
                           </a4j:outputPanel>
                           </rich:column>
                           </rich:dataTable>
                           </div>
                          
                           </rich:panel>
                          
                           <rich:panel styleClass="togglePanels">
                          
                           <f:facet name="header">
                           <h:outputText value="#{messages['ui.panel.secilenyemekhanelistesi']}" />
                           </f:facet>
                          
                           <rich:dropSupport
                           acceptedTypes="refectoryToRight"
                           reRender="availableRefectoriesList,selectedRefectoriesList"
                           dropListener="#{customerDetailsAction.addSelectedRefectoryToCustomer}"
                           ajaxSingle="true" />
                          
                           <div id="managed">
                           <rich:dataTable
                           id="selectedRefectoriesList"
                           value="#{selectedRefectories}"
                           var="_refectory" >
                           <rich:column>
                           <a4j:outputPanel layout="block">
                           <rich:dragSupport
                           dragIndicator=":indicator"
                           dragType="refectoryToLeft"
                           dragValue="#{_refectory}" >
                           <rich:dndParam name="label" value="#{_refectory.name}"></rich:dndParam>
                           </rich:dragSupport>
                           <h:outputText id="selectedRefectoryName" value="#{_refectory.name}" />
                           </a4j:outputPanel>
                           </rich:column>
                           </rich:dataTable>
                           </div>
                          
                           </rich:panel>
                          
                           </h:panelGrid>
                          
                           </rich:panelBarItem>
                          
                           </rich:panelBar>
                          
                           <a4j:commandButton
                           value="#{messages['ui.button.kaydet']}"
                           action="#{customerDetailsAction.saveCustomer()}"
                           reRender="validateCustomerDescription,validateCustomerRelation"/>
                          
                           </rich:panel>
                           </div>
                          
                           </h:form>
                          
                           </ui:define>
                          
                          </ui:composition>
                          </html>


                          Bean Code
                           public void addSelectedRefectoryToMeal(DropEvent dropEvent) {
                           Refectory droppedRefectory = (Refectory) dropEvent.getDragValue();
                           logger.info("Dropped Refectory #0", droppedRefectory.getName());
                           this.selectedRefectories.add(droppedRefectory);
                           this.availableRefectories.remove(droppedRefectory);
                           }
                          
                           public void removeSelectedRefectoryFromMeal(DropEvent dropEvent) {
                           Refectory droppedRefectory = (Refectory) dropEvent.getDragValue();
                           logger.info("Dropped Refectory #0", droppedRefectory.getName());
                           this.selectedRefectories.remove(droppedRefectory);
                           this.availableRefectories.add(droppedRefectory);
                           }


                          Throws a NullPointerException on dropEvent.getDragValue(),no other warning or exception...

                          • 25. Re: Drag-n-Drop broke in 3.1.4

                            Alright,I compared source code for 3.1.4.GA and 3.2.0.GA,I came across with this,

                            3.1.4.GA

                            public abstract class AjaxActionComponent extends UICommand implements
                             AjaxComponent, AjaxSource {
                            
                             public static final String FOCUS_DATA_ID = "_A4J.AJAX.focus";
                            
                             /*
                             * (non-Javadoc)
                             *
                             * @see javax.faces.component.UIComponentBase#broadcast(javax.faces.event.FacesEvent)
                             */
                             public void broadcast(FacesEvent event) throws AbortProcessingException {
                             // Hack - throw exception to AjaxViewRoot, to fix state of all iterable
                             // components.
                             if (event instanceof AjaxSingleEvent) {
                             throw new AjaxSingleException(getSingleComponent());
                             }
                            // perform default
                             super.broadcast(event);
                             if (event instanceof AjaxEvent) {
                             FacesContext context = getFacesContext();
                            ....
                            ....
                            ....
                            /*
                             * (non-Javadoc)
                             *
                             * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
                             */
                             public void queueEvent(FacesEvent event) {
                             if (event instanceof ActionEvent) {
                             if (event.getComponent() == this) {
                             if (isImmediate()) {
                             event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                             } else if (isBypassUpdates()) {
                             event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
                             } else {
                             event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                             }
                             // AjaxSingle component process own childrens in event processing.
                             if (isAjaxSingle()) {
                             super.queueEvent(new AjaxSingleEvent(this));
                             }
                             }
                             // UICommand set Phase ID for all ActionEvents - bypass it.
                             getParent().queueEvent(event);
                             } else {
                             super.queueEvent(event);
                             }
                             }
                            ....
                            ....
                            ....


                            3.2.0.GA
                            public abstract class AjaxActionComponent extends UICommand implements
                             AjaxComponent, AjaxSource {
                            
                             public static final String FOCUS_DATA_ID = "_A4J.AJAX.focus";
                            
                             /*
                             * (non-Javadoc)
                             *
                             * @see javax.faces.component.UIComponentBase#broadcast(javax.faces.event.FacesEvent)
                             */
                             public void broadcast(FacesEvent event) throws AbortProcessingException {
                             // perform default
                             super.broadcast(event);
                             if (event instanceof AjaxEvent) {
                             FacesContext context = getFacesContext();
                            ....
                            ....
                            ....
                            /*
                             * (non-Javadoc)
                             *
                             * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
                             */
                             public void queueEvent(FacesEvent event) {
                             if (event instanceof ActionEvent) {
                             if (event.getComponent() == this) {
                             if (isImmediate()) {
                             event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
                             } else if (isBypassUpdates()) {
                             event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
                             } else {
                             event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                             }
                             }
                             // UICommand set Phase ID for all ActionEvents - bypass it.
                             getParent().queueEvent(event);
                             } else {
                             super.queueEvent(event);
                             }
                             }
                            ....
                            ....
                            ....


                            I dont know the inner dynamics of a4j but seeing this removal of ajaxsingle related code lines, I removed "ajaxsingle=true" from dropSupport tag . Now its working...Thanks...

                            • 26. Re: Drag-n-Drop broke in 3.1.4
                              ilya_shaikovsky

                              thanks for your efforts in investigations

                              http://jira.jboss.com/jira/browse/RF-2931

                              1 2 Previous Next