Drag and Drop; What row is my drop positon (ADF 11g)

Hello!
I have a request for an drag and drop - site. First a test the technic with the examples in the web - great feature, but by my request i have one great problem.
facts:
two pannels, in all pannels are one af:table with different data controls
- in the first pannel/table (source) i defined on a column a client attribute and the attributeDragSource
- in the second pannel/table (goal) i defined on a PanelGroupLayout (surround a column) the dropTarget (inclusive dataFlavor)
I definied a session-scope class and write the methode "public DnDAction handleItemDrop(DropEvent dropEvent)"
Till then its work sucessful - the methode will be called and the transfer data can be read.
problem:
- I need the row for the drop position (for manual queuing).
- I have found the component, the id of the component, the x and y - position of the drop.
- A try with the current row of the IteratorBinding what returned the last marked row in the table, not the drop-position.
I need a key (at best the value of a row.binding.Value) of the drop position in the table.
Any idea - a simple code example?
Harald

Hi!
My problem was not the correct component ... this information was already available, my problem was the correct row in the component.
In the meantime I have found a result, i not sure it´s the best, but it works.
    public DnDAction handleItemDrop(DropEvent dropEvent) {
        System.out.println("demo1.java - handleItemDrop");
        try {
            DataFlavor<Number> d = DataFlavor.getDataFlavor(Number.class);
            //get drag Value
            Number dragValue = dropEvent.getTransferable().getData(d);
            if (dragValue == null)
                return DnDAction.NONE;
            else {
                // get the current record
                ELContext elContext = FacesContext.getCurrentInstance().getELContext();  
                // creating value expression with the help of the expression factory and the ELContext  
                System.out.println("Component/Id of the drop value:"+dropEvent.getDropComponent().getId());
                System.out.println("Value of the drop value (PK of the row):"+dropEvent.getDropComponent().getValueExpression("value").getValue(elContext));
                // and now work with the available data
                return DnDAction.COPY;
        } catch (Exception ex) {
            System.out.println("item drop failed with : " + ex.getMessage());
            return DnDAction.NONE;
    }

Similar Messages

  • Multiselect drag and drop in ADF

    Hi,
    Is there any way I can implement multi select drag and drop in ADF.
    Currently I have a UI where I have several cards. Each card is built using panelStretchLayout and I can drag and drop each card.
    The requirement is to be able to select multiple cards and drag and drop. Is there any way I can achieve this using ADF.
    Thanks,
    Rajesh.

    Hi,
    For the drag source and drop target previously i have used action="MOVE". I tried with action="COPY" (default action) and it worked out.
    <af:dragSource actions="COPY" discriminant="DnDDemoModel"/>
    <af:collectionDropTarget actions="COPY" modelName="DnDDemoModel"
    dropListener="#{EditMyWorld.editWorkflow}"/>
    Edited by: Priya on Jul 5, 2011 8:42 PM

  • Can  we have drag and drop functionality in xcelsius

    hi,
    i want to know wheather we can give adding and removing columns functionality to the user like we can give in the dash board created in wad.because most users want to analyse in their own way along with the standard one we show initially.
    can anyone tell me some features which are best in xcelsius than in wad or visual composer.
    so that it will be easy to choose what is the best tool according to the endusers requirement.

    There isn't a "painting" function built-in.
    You can do drag and drop in ADF Faces between components though.
    If you want to show relationship between components with lines - you might want to look into the Hierarchy Viewer.
    http://jdevadf.oracle.com/adf-richclient-demo/components/ariaXml.jspx

  • Drag and Drop Functionality in ADF

    Hi, i have a cuestion,
    I need to develop an application, but i have to determine if it is possible.
    I explain..
    I have to make an applicacion with elements with drag and drop functionality, i mean.. 3 to n containers on the page, a toolbar, with the possible elements to drag and drop on the containers,
    later on i have to join that elements with lines, and to save the view, so, when the users open their workspace, they can see their last view saved state.
    In a few words, that's my issue.
    I ve been search about it, and i found something about drop target option about panel box componnents, but nothing about drawing lines and saved view states.
    Do you know about some examples, o an example application, any help resource will be wellcome
    Thanks in Advance!!!!
    AB

    There isn't a "painting" function built-in.
    You can do drag and drop in ADF Faces between components though.
    If you want to show relationship between components with lines - you might want to look into the Hierarchy Viewer.
    http://jdevadf.oracle.com/adf-richclient-demo/components/ariaXml.jspx

  • What's up when you drag and drop a table into a jsp page?

    Hi All,
    I was wondering what's happen in dragging and drop a table into a jsp page. This question because untill yesterday i had an application up and running, with a table displaying a number of rows of the database, and an action associated with an update into a database.
    The action is managed trough JNDI, defined from Preference-Embedded.......
    It was working.
    Then the machine hosting the db changed IP addres. I went into Webcenter Administration console, I've changed the connection string into the jdbc parameters, by updating the new IP address... but it's not working anymore! The log comes out with a big error, but basically it can't connect at the db!
    So, I think there is somewhere some reference to the old db.....where???
    Thanks
    Claudio

    Yes Shay,
    I got this error:
    JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
    in few hours I'll be able to give you the full stack.
    Thanks
    Clauido
    Message was edited by:
    user637862
    Hi Shay,
    Thanks a lot..you were right.
    I've located the ba4j on the webcenter server...and I've noticed that it was with the old address.
    I think it's a bug, cause on the local machine (before to deploy) this file comes with the right address.
    So next time, before to redeploy a new application, I think I'm going to fiscally delete the folder from j2ee folder.
    Thanks again for the help!
    Claudio

  • Reordering of rows - issue with drag and drop of editable columns in table

    JDeveloper: 11.1.1.6.0
    ADF Faces - Drag and Drop for reordering of rows within the same af:table
    I have a requirement for reordering rows in a table using drag and drop. This table is loaded using a list and I am able to programmatically do the reordering of the rows based on the events of drag and drop by manipulating the list. Reordering of rows is working fine if all the columns are read only. For all the input text and input date columns the values are not getting reordered. Anyone has any idea on what the issue may be with reordering of the rows for editable columns/rows (af:inputText and af:inputDate) in af:table. Below is what Iam doing on drop event which is a collection drop target.
    public DnDAction dropCollection(DropEvent dropEvent) {
    try
    Object dropSite = dropEvent.getDropSite();
    Transferable transferable = dropEvent.getTransferable();
    DataFlavor<RowKeySet> rowKeySetFlavor = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
    RowKeySet rowKeySet = transferable.getData(rowKeySetFlavor);
    RichTable table = (RichTable) dropEvent.getDragComponent();
    if (rowKeySet != null)
    CollectionModel dragModel = transferable.getData(CollectionModel.class);
    Object dragM = dragModel.getRowData(0);
    Object currKey = rowKeySet.iterator().next();
    dragModel.setRowKey(currKey);
    table.setRowKey(currKey);
    OrderData orderData = (OrderData)this.prodReportTableData.get(Integer.parseInt(currKey.toString()));
    this.prodReportTableData.remove(Integer.parseInt(currKey.toString()));
    this.prodReportTableData.add(Integer.parseInt(dropSite.toString()), orderData);
    OrderData orderDataAdded = this.prodReportTableData.get(Integer.parseInt(dropSite.toString()));
    JSFUtils.addPartialTarget(this.getProdReportTableBinding());
    catch(Exception e)
    e.printStackTrace();
    return DnDAction.MOVE;
    Code snippet from UI:
    <af:table value="#{pageFlowScope.prodReportBackingBean.prodReportTableData}"
    var="row" styleClass="AFStretchWidth" rowBandingInterval="0"
    rows="40" emptyText="No data to display." id="t1"
    partialTriggers=":::cb1" columnStretching="column:c3"
    binding="#{pageFlowScope.prodReportBackingBean.prodReportTableBinding}" summary="PROD TABLE">
    <af:dragSource actions="MOVE" defaultAction="MOVE"
    discriminant="rowmove"
    dragDropEndListener="#{pageFlowScope.prodReportBackingBean.afterDragAndDrop}"/>
    <af:collectionDropTarget dropListener="#{pageFlowScope.prodReportBackingBean.dropCollection}"
    actions="MOVE"
    modelName="rowmove"/>

    Hi,
    not sure its the reason but you have huge bummer in your configuration.
    <af:table value="#{pageFlowScope.prodReportBackingBean.prodReportTableData}"
    var="row" styleClass="AFStretchWidth" rowBandingInterval="0"
    rows="40" emptyText="No data to display." id="t1"
    partialTriggers=":::cb1" columnStretching="column:c3"
    *binding="#{pageFlowScope.prodReportBackingBean.prodReportTableBinding}"* summary="PROD TABLE">
    JSF component bindings should not be to beans in a scope larger than request to avoid stale component instances.
    Frank

  • Drag and Drop Characteristic to Rows in QD

    I am trying to drag and drop ship-to characteristic from infoprovider pane to the rows pane in query designer but the system is restricting me from doing that, but I can move other characterisitcs from other dimensions and drop them in the rows area.  Only ship-to is the problem.  Have I accidentally pressed some key or what?  The "ship-to party" was provided as filter in the characteristics restriction section as a variable with manual input, so I removed it as a filter thinking that might be causing some problems but still no success.  Any help would be appreciated.

    LMAO..You are so right,  I knew it would be something simple, but it usually takes an hour or two for my brain to warm up before I can start thinking and functioning.
    Thanks, bro..points awarded!

  • Moving Rows in ADF Table Using Drag and Drop

    I implemented a drag and drop functionality it works fine, I want to accomplish the following functionality:
    The user selects the rows and what if he drags the selected rows and wants to move to section beyond the limit of the table I want to scroll the table in the direction the user is dragging.
    I think it should be a default behavior in the ADF table but it doesn't, could you please anyone tell me how to scroll the table while dragging the selected rows?
    Thank you,

    What make you think that this is a default behavior?
    Adf tables a data bound. So the data appears in an order (mostly defined by a sort condition on the db).
    Even if you implement this behavior (which is possible but hard to do) you loose the new order by the next round trip to the db.
    You may try to use trinidad tables but then you don't have the drag & drop featur (I guess).
    Timo

  • Drag and drop row within same table.

    Version 12.1.2
    I am trying to implement drag and drop row within same table, and I am trying to follow this sample from Frank:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/106-reorder-table-rows-1921121.pdf
    But, I am getting this cast exception. The code I have in my dropEvent bean is identical to whats on the sample.
    oracle.jbo.server.ViewRowImpl cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1
    Not sure if anything has changed on 12c release, or if I am missing anything.
    Here is my complete code:
    public DnDAction doDnD(DropEvent dropEvent) {
    RichTable table = (RichTable) dropEvent.getDragComponent();
    List dropRowKey = (List) dropEvent.getDropSite();
    if (dropRowKey == null) {
    return DnDAction.NONE;
    Transferable t = dropEvent.getTransferable();
    DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
    RowKeySet rks = t.getData(df);
    Iterator iter = rks.iterator();
    List draggedRowKey = (List) iter.next();
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    Row dragRow = draggeRowNode.getRow();
    JUCtrlHierNodeBinding dropRowObject = (JUCtrlHierNodeBinding) table.getRowData(dropRowKey);
    Row dropRow = dropRowObject.getRow();
    //get the table's ADF JUCtrlHierBinding
    CollectionModel collectionModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
    DCIteratorBinding objectsIterator = treeBinding.getDCIteratorBinding();
    RowSetIterator rsi = objectsIterator.getRowSetIterator();
    int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
    dragRow.removeAndRetain();
    rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
    objectsIterator.setCurrentRowIndexInRange(indexOfDropRow);
    AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
    adfctx.addPartialTarget(table.getParent());
    return DnDAction.MOVE;
    It does not seem to like this line of code:
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    I would greatly appreciate any help.
    Thanks.

    Well there has bee a changes somehow. using 12c
    table.getRowData(draggedRowKey);
    returns a ViewRowImpl and no longer anything which can be convertet to JUCtrlHierNodeBinding. Anyway, the fix is easy:
        public DnDAction onDepartmentsRowDrop(DropEvent dropEvent) {
            //get the table instance. This information is later used
            //to determine the tree binding and the iterator binding
            RichTable table = (RichTable) dropEvent.getDragComponent();
            List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if (dropRowKey == null) {
                return DnDAction.NONE;
            //The transferable is the payload that contains the dragged row's
            //row key that we use to access the dragged row handle in the ADF
            //iterator binding
            Transferable t = dropEvent.getTransferable();
            //get the row key set of the dragged row. The "rowmove" string is the
            //discriminant defined on the drag source and the collectionDrop target.
            DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
            RowKeySet rks = t.getData(df);
            Iterator iter = rks.iterator();
            //for this use case the re-order of rows is one-by-one, which means that the rowKeySet
            //should only contain a single entry. If it contains more then still we only look at a
            //singe (first) row key entry
            List draggedRowKey = (List) iter.next();
            //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
            Object objdrop = table.getRowData(dropRowKey);
            Row dropRow = (Row) objdrop;
            //get the table's ADF JUCtrlHierBinding
            CollectionModel collectionModel = (CollectionModel) table.getValue();
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding departmentsIterator = treeBinding.getDCIteratorBinding();
            RowSetIterator rsi = departmentsIterator.getRowSetIterator();
            int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
            //remove dragged row from collection so it can be added back
            dragRow.removeAndRetain();
            rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
            //make row current in ADF iterator.
            departmentsIterator.setCurrentRowIndexInRange(indexOfDropRow);
            //ppr the table
            AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
            //note that the refresh of the table didn't work when refreshing the table
            //so I needed to refresh the container component (af:panelStretchLayout).
            adfctx.addPartialTarget(table.getParent());
            return DnDAction.MOVE;
    does the trick. I changed the line to
    //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
    so you don't need the detour through the JUCtrlHierNodeBinding any longer.
    Timo

  • An mp3 file on my computer will not import to itunes by either the drag-and-drop or the Add File to Library method.  Can't figure out what I'm doing wrong.  My OS is Windows 7.

    I purchased an mp3 from a private website on my laptop.  The itunes library i sync ipod to is on my desktop, so i copied the mp3 onto a flash drive and then into my desktop in the Downloads folder and Desktop folder as well as the itunes music folder, 3 places.  I opened itunes on the desktop and read the instructions for importing music that's already in my computer.  Neither the drag-and-drop or the Add File to Library method works.  I've tried both ways over and over.  Cannot figure out what the problem is.  I do note that the name of the mp3 file doesn't show the .mp3 extension, it appears as simply it's title, Eating Healthy, without any extension at all.  Could the filename be the problem, or do you have any other idea what I'm doing wrong?  My OS is Windows 7, using IE9.  Thanks.
    ADDENDUM AFTER READING ANOTHER DISCUSSION HERE:  I have now tried right clicking the song in Windows Explorer and choosing Open With, clicking itunes.  The mp3 plays in itunes but does not add to the library.

    I don't have a Recently Added playlist.  However, I discovered that the file I had named Eating Healthy was given the name You Can Enjoy Eating Healthy when it copied to iTunes.  I'm guessing iTunes pulled the full name of the piece from the internet.  Upshot--the mp3 did transfer to iTunes on all 3 tries, but I was looking in my alphabetized list under E, not Y, so I didn't see it there.  Thanks for your help. 

  • Multi-row "Drag and Drop" works for some users, not others

          Background: We are working on Win7 SP1 clients, Project Prof. 2010, SP2
          A couple of users have reported that they cannot move ("drag") multiple selected rows in a task sheet, only a single row at a time. Other MS Project users around them (and myself) can move multiple rows with the "Drag"
    feature. "Drag and Drop" is selected in the "Options/Advanced" section of both their local global template and the Enterprise Global.
         To my knowledge, the multiple row selections contain no collapsed summary tasks, in case that might be an issue.
         I'm suspecting some Windows setting is amiss on the offending clients, but wanted to see if anyone else had seen this behavior before in Project Prof. 2010.
         Thanks!
    JTC
    JAckson T. Cole, PMP, MCITP

        Thanks for the response, Shiva!
        User community is on MS Project 2010 (14.0.7011.1000) SP2, MSO (14.0.7128.1000)
        To reproduce the problem, MS Project user will select multiple task rows by selecting first row, then holding MB1, and "sliding" to the last row desired. The problem manifests itself by NOT turning the cursor into the "four-arrow cross"
    after selection is accomplished. If only one row is selected, the ability to move that row alone is available.
         Again, only a couple of users (that have called me!) are seeing it. Their officemates are not having an issue.
         FYI ...
    JTC
    JAckson T. Cole, PMP, MCITP

  • My hard drive crashed on my MacBook Pro crashed and I need to get my CS5 up and running on the new hard drive. I copied what I could onto an external hard drive but when I drag and drop I get directions to uninstall but the uninstall folder I have does sa

    my hard drive crashed on my MacBook Pro crashed and I need to get my CS5 up and running on the new hard drive. I copied what I could onto an external hard drive but when I drag and drop I get directions to uninstall but the uninstall folder I have does says it is an alias that is no longer present. I get error 6. I would like to get my software up and running on the laptop again please

    If you subscribed to iTunes match the songs are kept in icloud. If you didn't but you did save the actual iTunes library folder which should include the music, video, etc.  you should be able to just drag this file back to your machine in the same place and when you open iTunes it will give you a chance to identify the iTunes library folder. 
    You can test this to find out if you saved the media files or not and don't need to attach your nano to do it. 
    You are correct that once you connect the nano it will clear the existing files from it and sync it with the new iTunes library. 
    If you don't have the media files i'm not sure if/how to get them back on a windows ipod.  I have everything backed up regularly because of the horror stories I have seen & heard.

  • Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    If you have Pages you can create customs pages for your book as TD suggested. If you have Pages from iWork 09 or 11 this app will add 80 or so additional frames to those offered:  Frames and Strokes Installer. Don't use it on the latest Pages version, however.
    This tutorial shows how to create a custom page with the theme's background: iP11 - Creating a Custom Page, with the Theme's Background for an iPhoto Book.  Once the page is complete to get it into iPhoto as a jpeg file follow these steps:
    Here's how to get any file into iPhoto as a jpeg file:
    1 - open the file in any application that will open it.
    2 - type Command+P to start the print process.
    3  - click on the PDF button and select "Save PDF to iPhoto".
    NOTE:  If you don't have any of those options go to Toad's Cellar and download these two files:
    Save PDF to iPhoto 200 DPI.workflow.zip
    Save PDF to iPhoto 300 DPI.workflow.zip
    Unzip the files and place in the HD/Library/PDF Services folder and reboot.
    4 - select either of the files above (300 dip is used for photos to be included in a book that will be ordered).
    5 - in the window that comes up enter an album name or select an existing album and hit the Continue button.
    That will create a 200 or 300 dpi jpeg file of the item being printed and import it into iPhoto. For books to be printed choose 300 dpi.

  • I can't drag and drop iTunes music files into Roxio Jam 6 anymore and, now I have to import music one song at a time by using the " " or "-" buttons on the bottom. What is going on? G5 Dual 2 Ghz and OS 10.4.11

    Hi. I have not used Roxio Jam for quite a long time and I just wanted to make a few CDs. Jam used to work easily and well. I have a problem. I can't drag and drop iTunes music files anymore and, now I have to import music one song at a time by using the "+" or "-" buttons on the bottom. What is going on? I trashed the preferences file and restarted Jam to no avail. I also have selected that Jam should open files with iTunes in the Jam preferences. I have a G5 DP 2Ghz PPC  machine with OS 10.4.11, iTunes 9.2.1 and Quicktime's version is 7.6.4. I have 2 GB of RAM and the machine has dual 1.25 Ghz. processors plus a 500 GB HD. Can anybody give me any suggestions?
    Thanks in advance,
    Larry

    I found an solution.
    Uninstalling AirParrot as well as the two offending AirParrotDriver.kext and APExtFramebuffer.kext files in System>Library>Extensions was the fix. All problems disappeared.

  • Hi - I keep receiving the following error message on a song I purchased from itunes and am now trying to drag and drop to my iPad: "you must download items from icloud before you can copy then to iPad" what does this mean - please help! Thank you

    Hi - I keep receiving the following error message on a song I purchased from itunes and am now trying to drag and drop to my iPad: "you must download items from icloud before you can copy then to iPad" what does this mean - please help! Thank you

    Hi Poonam26c,
    If you do not have a local copy of a song which you have purchased (i.e. it is available via iTunes in the Cloud), you may need to redownload it before you can transfer it to your device. You may find the following article helpful:
    Apple Support: Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    Regards,
    - Brenden

Maybe you are looking for

  • Iphone has a black line around the "swipe to access" box and i can't get it to turn on"

    iphone has a black line around the "swipe to access" box and i can't get it to turn on"

  • File descritpion not getting generated for GP12N

    Hello ,   For GL planning I have maintained the planner profile with excel option . but I am not able to upload the GL planning trhoughGLPLUP. The follwoing error will reflect while uploading hte txt file No File description Kindly guide how to creat

  • Report writers and report painters

    hi i nee the difference between report writers and report painters, and how these are useful in reports,

  • Tabs in JSP- Plz help-Urgent

    I want to have 3 tabs say Tab1, tab2, tab3 in my page and based on which tab is clicked , I have to display the contents of a table. Ex: if Tab1 is clicked, i have to display contents of Table1 and tab2,table2 and so ... Plz help with how to link the

  • Inserting Multiple Rows

    Hi, I'm just evaluating Numbers and I can't figure out how to insert multiple rows within a set of existing rows. I can see how to add a single row above or below a row, but not how to open up a block to insert multiple rows. Many thanks, Jonathan