Drag to Reorder Rows in AdvancedDataGrid

Is it possible to reorder the rows in an AdvancedDataGrid via
drag and drop? Similar to the way columns can be reordered.

In answer to my own question - yes it is possible by having
the dragMoveEnabled property set to true.
I was not getting this behavior to start with because I am
using a checkbox itemRenderer within the datagrid which, in
overriding selectedItem, was always returning false unless the
selection was made on the checkbox.

Similar Messages

  • 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

  • How to update one row in AdvancedDataGrid

    My App have a AdvancedDataGrid and it has so much rows. Some
    data rows for AdvancedDataGrid has changed and i don't want to
    update all rows ... But i don't know how to update one row for my
    AdvancedDataGrid
    Some body help me ...
    Thanks so muchs !

    thanks ntsii.
    my problem is:
    [Bindable]
    var dp:ArrayColection = new ArrayColection({...});
    <mx:AdvancedDataGrid dataProvider="{dp}">
    <mx:groupedColumns>
    </mx:groupedColumns>
    </mx:AdvancedDataGrid>
    //==================================
    in my dp have more rows and some time one of them is changed
    then i guess the AdvancedDataGrid must build all rows when
    it's dataProvider (dp) have changed.
    And i don't want to that...
    But i am not sure the AdvancedDataGrid buld all rows from
    begin to end ... i don't know.. !

  • Drag and Drop rows between tables in JSP

    I have to convert a swing application into a web project. One of the screens in my swing application uses drag and drop of records between two tables. The key is that when one of the rows is picked and dropped in the other table values get allocated to each column accordingly. I need to bring this functionality into a JSP. There is no constraint on using Javascripts. Please help me asap.
    Regards,
    KK

    Yes it is possible, but not so easy. If you'll be at OOW this year, you can come to my session (S301752, Monday 13:00-14:00) - I will show something similar there. If you're not so lucky, you can read the excellent blogpost of my colleague at [http://rutgerderuiter.blogspot.com/2008/07/drag-planboard.html]
    Cheers
    Roel

  • LR4 drag to reorder images

    I hope LR4 includes being able to drag images around in "Grid View" to reorder them. This is a huge issue for a wedding photog who is working with assistant and has to order images from 4 or 5 camera bodies. Not good enough to select "sort by capture time" because sometimes just a 2 seceond difference between the bodie's clocks can put an image slightly out of sequence. Right now I have to do it in Bridge and then rename all images followed by re-importing into LR. Huge hassle. Somebody dropped the ball with not including this ability in LR and I will not pay to upgrade to LR4 unless this is fixed. I am furious everytime I have to do this and won't even consider spending more $$ while having to go to Bridge.. Also, If I rank images by stars or color in Bridge the rankings don't carry over to LR and vise versa (unless I'm missing something). Bridge is so intuitive with this kind of thing. I would like LR to be just as intuitive.
    Hope the right eyes see this
    Mike
    Michael C Photography

    You can not reorder into a User order from within a Folder. You need to be in a collection to do so. Move all the images from an event into a single collection and you can reorder them via drag and drop.
    Capture time can be altered by camera if you use your filter bar to select individual camera serial numbers and then alter that group of photos' time signatures.  This will solve your out of sequence issues.  Most people with more than one camera in a situation like this sync the camera times before an event to avoid just this problem. But, even if you don't or can't, the ability to filter by camera and adjust time by using Metadata>Edit Capture Time… solves this and puts your capture time in true chronological order regardless of camera settings.
    I haven't been in Bridge in 3 years and cannot think of why, with Lightroom, I would ever go back there.  I find Bridge to be counterintuitive and Lightroom to by very intuitive. I think as you discover more about recommended workflows in Lightroom you will find that your experience will be much better.
    I am also concerned by your use of the phrase "re-importing into LR". It is almost never a good idea to re-import. I hope you meant import.

  • Duplicate rows in AdvancedDataGrid when pushing updates via custom Assembler?

    We are trying to use LCDS transactions to dynamically push updates from a server side application via custom Assembler to AdvancedDataGrid.  Latter is using fill result ArrayList as its data source.
    Unfortunately we haven't been fully successful thus far. Grid shows fine initial snapsot delivered by fill but subsequent record updates result in a duplicate rows shown in a grid. 
    We are using Flex 3, SDK 3.5 and LCDS ES 2.6.1.
    Here is the relevant code in our custom assembler to do the update push:
    _results.add(dataUpdate); // _results is the ArrayList object returned with data on the original fill
    DataServiceTransaction dtx = DataServiceTransaction.begin("FOO", false);
    dtx.addItemToFill(_assemblerId, _currentParams, _results.size()-1,dataUpdate);
    dtx.commit();
    // we see this method gets called as result of the code above
    public Object getItem(Map identity) {
          Object item = null;
          String id = identity.get("ID").toString();
          for (LinkedHashMap<String,Object> itemMap : _results) {
          if (itemMap.get("ID").equals(id)) {
                item = itemMap;
           break;
          return item;
    And finally here is the destination configuration for the assembler in the data-management-config.xml file:
    <destination id="updates">
      <properties>    
             <source>UpdatesAssembler</source>
            <scope>session</scope>
      <auto-sync-enabled>false</auto-sync-enabled>
      <metadata>
                     <identity property="ID"/>
      </metadata>
      <network>
                     <paging enabled="false"/>
      </network>
    </properties>
    </destination>
    And naturally, we bind the datagrid dataProvider to the array collection returned by the original fill call.
    As stated above, this solution results in two rows of the same data appearing in datagrid for every updated pushed by the assembler.
    Can you please advise what are we doing wrong.
    Thanks!

    What events are coming back to the client?
    If you add an event listener to the dataService object in ActionScript, you can see what events are coming in.
        dataService.addEventListener(MessageEvent.RESULT, resultHandler);
    This might help diagnose it.

  • How to reorder rows in advanced table

    Hi ,
    I have a requirement to create a advanced table on a page which has col say A,B ,C
    i need to create 2 rows as the pageload which will show fixed values in column A for initially created two rows
    1) free
    2) chargeable
    after this if user clicks on the add another row button
    he should create another row and Column A should be editable and user has to fill value as below
    3) Extension
    i am able to do this much on the page, but the problem is with ordering of rows
    order of rows should be
    1) free
    2) chargeable
    3) extension
    but when user click to create the row it always create the row on the top rather than on bottom
    Please help!!

    Hi
    On the Add New Row button click
    Get the reference to Vo
    Row row=vo.last()
    vo.setCurrentRow(row);
    vo.next()
    vo.insertRow(vo.createRow())
    Thanks
    Ivar

  • Drag & Drop ALV row to a picture control

    Hello.  I'm trying to implement drag&drop functionality from an ALV grid to a picture/icon(CL_GUI_PICTURE).  Anyone know if this is possible.  I can't get my events to fire when dragging/dropping.  I have been able to do it from ALV to ALV, but am getting stuck on ALV to Picture.  I want some kind of "shopping cart" functionality like in ME22N, where the user can drag a PO from a list into the "shopping cart" picture/icon.
    Anyone can help?
    Regards,
    Rich Heilman

    Good afternoon!
    I'm trying to do the same, to drag a node of a tree and drop it on a picture control. I have called the set_dragdrop_control and set_dragdrop_picture methods and I'm sure of the set handler statement, but no event is fired.
    Can you help me?
    Thank you,
    Fabiano (from Brazil).

  • I can't drag to reorder bullets in a build. The different bullets don't move and the "order" menu can't be activated. Any help?

    When I open the Animate bar, and select Delivery by Bullet, then Build Order, it's impossible to change the order in which the bullets appear (it's much easier in Powerpoint). eg. in a series of bullets 1 / 2 / 3 / 4 I may want to display 1 and 3 (as questions) and then only show the answers 2 and 4 after, but still have them show in numerical order. I can't do this with Keyword. 
    How can this be resolved?

    fizzogg wrote:
    Can I just add that I was always able to do this with the previous version of Keynote (before Mavericks and the upgrade).
    If you havnt deleted it, continue to use verion 5, its still in the applications folder, iWork 09.

  • Disable the dragging of the "group" rows

    We are using the AdvancedDataGrid as a tree dataGrid, using
    GroupingCollection as the dataProvider. The items in the dataGrid
    can be dragged, so dataGrid.dragEnabled is set to "true".
    But by setting dragEnabled to true, all rows seems to be
    draggeable, even the "group" rows! We would like to disable the
    possibility to drag the group rows, without managing the entire
    drag/drop process ourself using the DragManager. Is it possible?
    Thanks in advance!

    Any 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

  • JTable: How to reference the selected row during a drag?

    I am implementing Drag and Drop on the rows of a JTable.
    I want to change the background colour of each successive JTable row ("highlight" the row) as another row is dragged over it (I already have similar functionality implemented in a custom TableCellRenderer, but the Drag and Drop code knocks it out) .
    I have run into a problem: All of the JTable methods refer to the rows as ints--0, 1, 2, etc.
    Here is my approach:
    I get the reference to the row by using:
         "int dragEnteredRow = table.rowAtPoint( e.getPoint() ); "
    With the intention to use the variable dragEnteredRow to change each row's foreground colour:
         "dragEnteredRow.setForeground( selected ); "
    That gives me an error message from the compiler:
    "... Can't invoke a method on a int.
         dragEnteredRow.setBackground( Color.yellow ); ... "
    Here is some more of the code (it implements the Macintosh Drag and Drop API):
    [javacode]     
    "     public boolean dragMoved( DragEvent e ) {
         dragEntered( e );
              return true;
         public boolean dragEntered( DragEvent e ) {
         int dragEnteredRow = table.rowAtPoint( e.getPoint() );
              dragEnteredRow.setBackground( Color.yellow ); // These two lines fail at the compiler
    //     table.rowAtPoint( e.getPoint() ).setBackground( Color.yellow );
              if ( dragEnteredRow == -1 ) {;
                   System.out.println( "out of bounds !!" );
              } else {               
                   System.out.println( "Drag Entered at : Row" + dragEnteredRow ); // This test code works
                   System.out.println( "" );
                   return true;
    [javacode]
    My Question: What is the proper approach to solving this problem?
    Many thanks in advance for a solution.
         

    the method rowAtPoint(e.getPoint()) returns an integer with the index of the row at point e, and not the instance of the row.
    You have to use this integer to reference the row through a method like getValueAt(row int,col int) of the DefaultTableModel
    Hope this helps

  • 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

  • Dragging rows in JTable

    Can anybody tell me how to drag and drop rows in JTable?
    if someone could give me a code snippet (Or) refer to an example, i will be very happy !.\
    Thanks
    Shriram

    By the way, I just tested this assumption of mine, and found I was wrong if you're using default JTable drag and drop.
    However, I'm using my own implementation. I notice in a simple program without any drag and drop, I get the behavior I mentioned above, so I'm guessing this IS default JTable behavior, which is then modified by the built-in drag and drop support.
    So the trick will be, how to do what built-in drag and drop is doing, without using built-in drag and drop. :-)
    - Tim

  • I can't reorder app tabs by dragging

    created 5 app tabs. when i drag to reorder the tabs, it shows the placement marker (icon that looks like a blue pin) but the location never changes. im guessing this is a bug.

    Create a new profile exclusively for the Firefox 4 version.
    * http://kb.mozillazine.org/Testing_pre-release_versions
    * http://kb.mozillazine.org/Profile_Manager#Creating_a_new_profile

Maybe you are looking for

  • Which are the standard assignment blocks that should appear in SAP Product?

    Hello Guru's Currently I am creating some new products to check the fields available in every assingment block within the product, when I create my new transaction and add a new position (product) I went in the link to see the product information whi

  • BDLS Question?

    Hello I am using SRM 5.5 extended Classic and ECC 6.0. We have recently re-pointed our test systems to a different R/3 test client and have changed some of the logical system names manually before running BDLS. Please can you advise what will happen

  • How do I add a picture from my hard drive to a contact in OSX 10

    Seriously, a friend sends me a photo over iMessage, clicking on the photo doesn't give me any viable options to save the photo, so then I copy it and paste it to the desktop (because nobody does that any more and it's not worth a shortcut...) Then I

  • Is it possible to view images at 50 and 25 percent in Bridge CS5?

    Hi, With Space-bar or keying Ctrl-L it is possible to view a larger (total) image. But at which size? An additional mouse-click will reveal 100 percent (actural pixels), and you are offered to scroll to 200, 400 and 800 percent. But what about 50 and

  • Ytd,ptd,qtd in dashboard prompt

    Hi how to use ptd,qtd,ytd as dashboard prompt i created netamount ptd,ytd,qtd in rpd my metric is netamount in dashboard if i select ptd then give ptd values selct ytd give ytd netamount qtd also same its in dashboard change all the reports in dashbo