Accessing param values using RichFaces Drag n Drop

Hello everyone,
I'm using RichFaces drag and drop support and I want to pass an additional parameter so that I can access it's value when processing the dragged/dropped object.
My JSP has:
<rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
       <a4j:actionparam name="operator" value="#{aggOp}" assignTo="#{SessionBean.tempAggOp}"/>
       <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
</rich:dragSupport>
<h:outputText value="#{aggOp}" style="font:11px arial;"/>On my backing bean method that processes the event, I can access the object's properties fine, but the param has a strange behaviour:
The first time I drag an object, the param value is null on the bean. The second time, it has the value it should have for the first dragged object, and so on.
Apparently the param value is being updated after the drop event method is called. Any ideas on how to change this please?
Thanks in advance,
~Ruben

To solve this problem I used <f:param> instead of actionParam:
On the drag support component:
<rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
                                                    <f:param name="operator" value="#{aggOp}" />
                                                    <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
</rich:dragSupport>     On the backing bean:
    //dropped item processors
    public void processDropSupportTable(DropEvent dropEvent) {
        if (dropEvent.getDragType().compareTo("measure") == 0) {
            SOLAPMeasure dragged = (SOLAPMeasure)dropEvent.getDragValue();
            FacesContext context = FacesContext.getCurrentInstance(); 
            Map requestMap = context.getExternalContext().getRequestParameterMap(); 
            String tempAggOp = (String)requestMap.get("operator");
            System.out.println("dropped: " + dragged.getId() + " named: " + dragged.getName() + " whose operator is: " + tempAggOp);
    }

Similar Messages

  • Error using Richfaces Drag and Drop  support in JSF 1.1 application

    Iam using rich faces drag n drop support in my JSF application . The jsp works as expected but I get this weird exception while navigating through my pages.
    Scenario : User logs into the application , from the home page ---> when the user click on a button he is navigated to the jsp which has the drag n drop support. This was working fine till , I have added a menu_incl .jsp inthe sub view . The code snippet is as shown below :
    <body>
         <div id="wrap">
         <f:view>
         <f:subview id="menu">
              <jsp:include page="/search/incld/menu.incl.jsp" />
         </f:subview>
         <rich:dragIndicator id="indicator" />
         <h:form id="myfolder">
              <h:panelGrid columnClasses="panelc,panelc,panelc,panelc" columns="4" width="100%">
                   <!-- Panel for Queries -->     
                   <rich:panel style="width:133px">
                   <f:verbatim>
                             <div style="overflow-x: scroll; overflow-y: scroll; height: 400px;">
                   </f:verbatim>
                        <f:facet name="header">
                             <h:outputText value="Queries" />
                        </f:facet>
                        <h:dataTable id="querytable" value="#{dndBean.queryList}"
                             var="query" binding="#{workSpaceBean.queryData}" >
                             <h:column>
                                  <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
                                       <rich:dragSupport dragIndicator=":indicator"
                                            dragType="Query" dragValue="#{query}">
                                            <rich:dndParam name="label" value="#{query.name}" />
                                       </rich:dragSupport>
                                       <h:commandLink value="#{query.name}"
                                       action="#{workSpaceBean.populateQuery}">
                                       </h:commandLink>
                                  </a4j:outputPanel>
                             </h:column>
                        </h:dataTable>
                        <f:verbatim></div> </f:verbatim>
                   </rich:panel>
    Now when I click on the button in my home page , and expect to be navigated to the page which has dran drop support components, I get the following error :
    Error Message: Duplicate component ID 'myfolder:querytable:_id34' found in view.
    Error Code: 500
    Target Servlet: Faces Servlet
    Error Stack:
    java.lang.IllegalStateException: Duplicate component ID 'myfolder:querytable:_id34' found in view.
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:171)
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
    at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
    at com.sun.faces.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:86)
    at org.ajax4jsf.framework.ajax.AjaxStateManager.saveSerializedView(AjaxStateManager.java:90)
    at com.sun.faces.taglib.jsf_core.ViewTag.doAfterBody(ViewTag.java:170)
    Iam getting this error only when I include this jsp in the parent jsp :
    <f:subview id="menu">
              <jsp:include page="/search/incld/menu.incl.jsp" />
    </f:subview>
    Iam including the same way in all other jsps of my application , they are all working fine expect for this jsp which has ajax components (rich faces drag m drop support components ) .
    From the error I deduce that the view component is being generated twice , why is this so???
    I would appreciate if some one coulkd guide me through this .... I hope I was able to explain my issu properly , please let me know if it is now clear

    I've tinkered a bit with DnD before in the past. Actually, it's all related to the topic of Data Transfer. You have to provide a source and destination for the transferrable, and your transferrable object must provide the "data flavors" that it supports.
    In theory it doesn't sound too hard, and it works reasonably well within a java application, but to be honest your time might be better spent simply implementing cut n' paste, which is easier. Cut n' paste doesn't require all the fancy UI work, but does the job reasonably well.
    There's a DnD spec available on the documentation web-site, if you haven't already found it. I also discovered that the O'Reilly book (I think it's the AWT book, not the swing one) has a good chapter on data transfer that you might want to read.

  • I used to drag and drop newly loaded CD's from Recently Added to one of my iPod Classic playlists. I have no idea how to do this with the new version of iTunes. I thought perhaps checking Sync might give me a clue but it warned me Syncing would wipe conte

    I used to drag and drop music loaded from CD's from the Recently Added folder to a Playlist on my iPods Classic. Can't see how to do this with new iTunes version. Probably need to sync somehow but when I checked on Sync it warned me it would wipe out my iPod contents. Don 't know why Apple makes something that used to be simple so difficult. Can't even figure out how to display both my library and iPod contents on same screen.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • I need to play a song on a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through the whole presentation ? Thanks.

    I need to play a song in a row in a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through out the presentation ?
    Thanks.

    Drag the file into the audio window in the Document inspector...

  • I used to drag and drop photos into pages. Recently updated to iPhoto 9.4.3 and now Pages doesn't recognize the photo?????

    I use iWork Pages '09 to create my images. I normally drag and drop photos from iPhoto directly to Pages.
    With iPhoto 9.4.3 I now get an error: " The media can't be used because you don't have access privileges or because it has no content or is corrupt". This doesn't happen with every photo from the same event and doesn't get corrected after running 'Repar Permissions'.  I can Export to desktop then drag to Pages but that is stupid. What's up???

    With iPhoto 9.4.3 I now get an error: " The media can't be used because you don't have access privileges or because it has no content or is corrupt".
    This looks like previews of some of your photos are missing or corrupted. Did you run a cleaning application, like "clean my mac" or move your iPhoto Library? Where do you store your iPhoto Library?
    I'd try to repair the database or rebuild the iPhoto Library in addition to repairing permissions with the iPhoto Library First Aid Tools. Launch iPhoto with the command and options-key ⌥⌘ held down at the same time to get to the First Aid Tools.
    Back up the iPhoto Library before you try rebuilding.
    Regards
    Léonie

  • How to Create Table Using Column Drag and Drop Feature

    Hi:
    I am new to Oracle SQL dev Data Modeler tool and would like to know if there is a way to create a new table by re-using the existing columns or column groups. The idea is to maintain consistency and save table design time. If columns created previously can be re-used and require drag and drop of column in the right pane, then only new columns need to be manually created.
    Any thoughts on this will be appreciated.
    Thanks!

    Hi Kent
    I checked out the video and tried it in Oracle designer, it works and works great!
    My other question is that I may have several set of columns that I may want to group depending on the table requirements. Can I have multiple templates and choose which one to apply to?
    Also, how do I choose the table where the table template needs to be applied. As I may be interested in applying the table template to selected tables only.
    Thanks
    Edited by: user648132 on Feb 20, 2012 10:47 AM

  • I use to drag and drop an web address into a link toolbar, can't seem to figure out how to do this...?

    I just upgraded to Windows 7 and with it I got the latest Firefox. There is nothing like learning 2 things at one time. On my old XP and 3.? all I have to do was drag and drop a web address into a link toolbar. Saving all my frequent visited or just sights I want quick access to, to a toolbar quick button. I have been playing with this for days and decided to try this Forum. I did find the Bookmark toolbar, but cant seem to figure out what is if for or if you can drop into it. When I right click it and Customize, it shows me add on buttons, but nothing to do with web addresses or alike...
    Bottom line; I want to be able to drag and drop a web address into a toolbar for recall latter and be able to edit the address with a right click at a latter date in necessary...
    Thanks, Mike

    You can drag and drop the favicon also known as the [https://support.mozilla.com/en-US/kb/Site+Identity+Button site identity button], at the left hand edge of the location bar onto a toolbar to bookmark the site.

  • Move components using mouse - drag and drop action?

    Hi,
    As attached, I want to move one component at the bottom to top using mouse in drag and drop action.
    But I don't know why it returns to the origianl position. it never move.
    Is there anyway I can change configuration to accomplish this?

    Hi,
    I tried this as you said, but it wont' work.

  • Can you Cancel "acceptDragDrop()" using Manual Drag-and-Drop?

    I have an AdvancedDataGrid (ADG) with manually drag-and-drop
    functionality built in. The user can only drag-and-drop within the
    one ADG. I do this in order to validate which items can be dragged,
    and where they can be dropped. I have run into one problem,
    however. In my override of dragEnterHandler(), I call
    DragManaged.acceptDragDrop() if the user drags an item over a valid
    item. However, if they don't drop the item there, and continue to
    drag the item around the ADG, and roll over an item that is not
    valid, there's no way to cancel the drop.
    Does anyone have any suggestions?

    Thanks for the updates.
    "ericbelair" <[email protected]> wrote in
    message
    news:gealv1$dfk$[email protected]..
    > FYI, AdvancedDataGrid property "dropEnabled" must be set
    to "true" for
    > this to work.

  • I am used to "drag and drop" content from my computer to my old i-pod.  With the new i-tunes, I can't seem to do that.  Any suggestions?

       I am used to "drap and drop" content from my computer to my old i-pod.  With the new i-tunes, I can't seem able to do that.  Any suggestions?  Thanks.

    diana42 wrote:
    My problem is that Itunes does not acknowledge inserted CD in DEVICES area,
    Are these Audio CDs?
    Only Audio CDs will show up in iTunes.
    This is new to me because I am used to importing and making copies from my playlists.
    I don't follow. Would you explain this a bit more?

  • Accessing field values using property names

    Hi all,
    I have the following problem:
    I have several hundred simple beans which act as value holders:
    public class MyBean1 {
    private String field1;
    private String field2;
    Getters
    Setters etc.
    Now I have a class which receives the MyBean1 class encapsulated in an Object. I also have access to a list of propertynames i.e. field1, field2 etc.
    Having that info is it possible for me to retrieve the values from the bean without actually instantiating it in my implemantation class.
    I was thinking in the direction of something like a Factory helper class or so but wasn't quite able to figure out how to go about it.
    Any help would be appreciated.
    Regards
    Michael

    >
    Having that info is it possible for me to retrieve the
    values from the bean without actually instantiating it
    in my implemantation class.
    This does not make sense to me. If an object is not instantiated, then it does not exist nor do any of its fields. The operation of obtaining values that do not exist is undefined.
    I think you must mean something else but you need to explain it better.

  • Unable to use "drag and drop function" from outlook

    We are changing from Lotus to outlook and this has made a problem with getting pdf-files into OAWD directly .
    Procedure was like this in Lotus
    1. We get documents (FI, F-43, aso ) by email
    2. We use OAWD function "drag and drop" , document is attached to a document type and workflow is triggered
    3. We pick up documents from Business workplace , handle the document and send it to the approver (who earlier got it directly in their mailbox "lotus")
    so far so good , everything worked well
    Unfortunately we changed to outlook, non attached files can be "drag and dropped" into OAWD (I understand the part about outlook is showing links instead of "real" pdf and know this is part of the problem)
    My question, it can not be possible that we have to manually save the documents/attached files from outlook into "desktop" to later use the drag and drop function?
    I have read about the programms to solve problem , ex "inPuncto", but our experts says there will be problem with connector to workflow from OAWD.
    I have my greatest doubts about that because this must be really two diffrent moduls, one for converting from outlook and the other must be unchange (undependent of the earlier procedure). SAP can not know from what program the documents will be dragged? 
    Suggestion about some OAWD-adaptor ?
    Any suggestions about great solutions ?

    it seems there is no way.
    See note 1797073
    Is there someone with a better solution?

  • Erratic zooming in and out using drag and drop to copy.

    While using the drag and drop to copy method in AI 18.0(and17) there is erratic zooming in and out behavior.
    I've called Adobe and Apple about this issue and it still remains. I've also tried the Hot Fix download but the problem still remains.
    I'm using an iMac with OS 10.9.4 and the Magic Mouse.
    Please help! Thanks in advance.
    Dennis, DB Signs

    When I click and hold on a selection then drag it holding down the option key to copy it, when I release the mouse where I want it to be copied it zooms in or out(radically) once or several times and usually copies the selected item to a different place then I wanted it to.
    Now I’ve noticed that if I don’t touch the side of the mouse(keeping only one finger on the top of the mouse) I don’t have the issue.
    Thank You, Dennis Burns, DB Signs
    Phone: 320-629-8919
    Fax: 844-269-8172
    Email: [email protected]
    Website: www.dbsigns.biz

  • How to use the palette or drag and drop functions in netbean?

    Is there anyone who can help me out on using drag and drop function in netbean to design GUI inteface..??
    Is palette is the tool that can be used to drag and drop.??
    thank you in advance.

    I actually really like the GUI builder in netbeans. I used to be a big eclipse user so I am very familiar with coding GUIs by hand, and most of what I do involves GUI's or at least swing.
    At first I hated netbeans, I hated that I couldn't edit the code most. Then I decided to take a deep breath and really examine the issue. What I discovered is that most of the edits I wanted to make but couldn't really weren't the right way to be doing it in the first place, for the rest the code is actually really easy to change you just have to know how.
    Now my palette is huge, probably about 250 objects in it organized into sections that work for me. Basically if I want a object to do something that is not already in the palette I simply write a new object and add it to the palette. I started small like with rounded buttons/progress bars, and as I got comfortable I now have some fairly advanced objects like grids, isometric grids, alpha composits, an animated hourglass countdown timer, and an animated "loading/activity" indicator that is not tied to a progress indicator.
    The main reason I stuck with the netbeans drag and drop GUI builder is it's layout manager is really a very nice layout manager, you couldn't pay me enough to go back to eclipse or codeing GUIs by hand, as I can now do in one day what used to take me several weeks.
    So what I am saying is stick with netbeans and the drag and drop, it sucks at first, but once you get to a point where you are comfortable with it and adding to the palette it will become a great tool.
    JSG

  • Error message using Drag And Drop

    I receive the following error when trying to use a customized drag implementation on a JList. I can't find any reference to DataTransferer and the like, so I don't know where to look for the problem. Any help would be much appreciated.
    java.lang.NullPointerException
    at sun.awt.datatransfer.DataTransferer.getFormatsForFlavors(DataTransfer
    er.java:708)
    at sun.awt.windows.WDataTransferer.getFormatsForFlavors(WDataTransferer.
    java:127)
    at sun.awt.datatransfer.DataTransferer.getFormatsForTransferable(DataTra
    nsferer.java:687)
    at sun.awt.dnd.SunDragSourceContextPeer.startDrag(SunDragSourceContextPe
    er.java:101)
    at java.awt.dnd.DragSource.startDrag(DragSource.java:305)
    at java.awt.dnd.DragSource.startDrag(DragSource.java:402)
    at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:221)

    Here is the code that I use for drag and drop between 2 Jlist's. It has always worked for me. You may have to tweek it a little to work for you. For instance I don't have it removing the item from the original lst when it is dragged to the new list. Anyway hope this helps you out.
    public static class                     DList extends JList implements DropTargetListener{
            private DropTarget dt;
              DList() {
                   this.setDragEnabled(true);
                            dt = new DropTarget(this, this);
            public void dragEnter(DropTargetDragEvent event) {        }
            public void dragExit(DropTargetEvent event) {        }
            public void dragOver(DropTargetDragEvent event) {        }
            public void drop(DropTargetDropEvent event) {
                try {
                Transferable transferable = event.getTransferable();
                    if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                        event.acceptDrop(DnDConstants.ACTION_COPY);
                          String s = (String)transferable.getTransferData(DataFlavor.stringFlavor);
                          addElement(s);
                        event.getDropTargetContext().dropComplete(true);
                    else {
                        event.rejectDrop();
                catch (IOException exception) {
                    exception.printStackTrace();
                    System.err.println("Exception" + exception.getMessage());
                    event.rejectDrop();
                catch (UnsupportedFlavorException ufException) {
                    ufException.printStackTrace();
                    System.err.println("Exception" + ufException.getMessage());
                    event.rejectDrop();
            public void dropActionChanged(DropTargetDragEvent event) {        }
            public void addElement(Object s) {
                ((DefaultListModel)getModel()).addElement(s.toString());
        } //End DList class

Maybe you are looking for

  • Photoshop CS4 program error: deleted prefs, keeps coming back instantly

    I am running Photoshop CS4 extended on my Mac OS X 10.5.6 OS. Out of no where, I create a new file, try to fill a layer with a solid color, I get the generic program error message. I click OK to get rid of it, but it is erratic. I have to force quit

  • Mac Mini and two IPAD2s

    Hello, I have 2 IPAD2s and a Mac Mini.  I have tried all morning to link the 3 of them together wirelessly to share the same data.  Basically, this is for a home-based small business and the 2 Ipads will be used in the field to write invoices that wi

  • Remove pipe delimited and  quotes USING SAME ctL FILE

    i need to remove quotes and delimited(|) using control file in SQL LOADER. I am able to remove delimited but not able to " "(quotes).Can any one help me? "1"|"tom "|"newyork" LOAD DATA INSERT INTO TABLE temp_table FIELDS TERMINATED BY "|" TRAILING NU

  • Executing a bunch of .SQL scripts in a folder  ???

    hi , I have 60+ sql scripts in a folder X..Is there any way to execute these scripts in one go..?? I am searching for a shortcut to execute these scripts using SQL PLUS Scripting (any possible way) .. Can anyone give some light to solve my issue?? Re

  • SERVICE MASTER

    Hi, I have created service master record using BAPI_SERVICE_CREATE. When i'm running this program, the records i.e activity_no,service_category, purchase_status etc... are not getting stored in ASMD table... Can any one tell me in which table does th