Issue with Drag/Drop of multiple rows from ListView

I am working on a sample application with 2 list views i.e. players and team, and implement drop and drop such that players can be dropped from one list view to the other. Everything is working as expected when there is single selection model is enabled on the source list view. However, if I enabled Multiple selection model and drag 2 or more rows from source list view to target list view, seeing the following exception after the drop is completed.
Exception:
java.lang.IllegalArgumentException: Only serializable objects or ByteBuffer can be used as data with data format [subListPlayers]
  at com.sun.javafx.tk.quantum.QuantumClipboard.putContent(QuantumClipboard.java:513)
  at javafx.scene.input.Clipboard.setContent(Clipboard.java:230)
1) What should be the DataFormat used in order to be able to drag and drop multiple rows? Looks like we do not have for Object type, so I have created the following one which does not solve the problem.
   private DataFormat dataFormat = new DataFormat("subListPlayers");
2) I have made changes to support serialization on the data object which also does not seem to solve the issue. Tried by implementing Serializable interface as well as by implementing Externalize interface.
Can someone please guide if there is an easy way to implement this behavior?
Code:
public class Player
   private String name;
   public Player(String name)
      this.name = name;
   public String getName()
      return name;
   public void setName(String name)
      this.name = name;
   @Override
   public boolean equals(Object o)
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
      Player player = (Player) o;
      if (name != null ? !name.equals(player.name) : player.name != null) return false;
      return true;
   @Override
   public int hashCode()
      return name != null ? name.hashCode() : 0;
public class JavaFXDnDApplication extends Application
   private static final ListView<Player> playersListView = new ListView<Player>();
   private static final ObservableList<Player> playersList = FXCollections.observableArrayList();
   private static final ListView<Player> teamListView = new ListView<Player>();
   private static final GridPane rootPane = new GridPane();
   private DataFormat dataFormat = new DataFormat("subListPlayers");
   public static void main(String[] args)
      launch(args);
   @Override
   public void start(Stage primaryStage)
      primaryStage.setTitle("Drag and Drop Application");
      initializeComponents();
      initializeListeners();
      buildGUI();
      populateData();
      primaryStage.setScene(new Scene(rootPane, 400, 325));
      primaryStage.show();
   private void initializeListeners()
      playersListView.setOnDragDetected(new EventHandler<MouseEvent>()
         @Override
         public void handle(MouseEvent event)
            System.out.println("setOnDragDetected");
            Dragboard dragBoard = playersListView.startDragAndDrop(TransferMode.MOVE);
            ClipboardContent content = new ClipboardContent();
//            content.putString(playersListView.getSelectionModel().getSelectedItem().getName());
            content.put(dataFormat, playersListView.getSelectionModel().getSelectedItems());
            dragBoard.setContent(content);
      teamListView.setOnDragOver(new EventHandler<DragEvent>()
         @Override
         public void handle(DragEvent dragEvent)
            dragEvent.acceptTransferModes(TransferMode.MOVE);
      teamListView.setOnDragDropped(new EventHandler<DragEvent>()
         @Override
         public void handle(DragEvent dragEvent)
//            String player = dragEvent.getDragboard().getString();
//            ObservableList<Player> player = (ObservableList<Player>) dragEvent.getDragboard().getContent(dataFormat);
            String player = dragEvent.getDragboard().getString();
            teamListView.getItems().addAll(new Player(player));
            playersList.remove(new Player(player));
            dragEvent.setDropCompleted(true);
   private void buildGUI()
//      rootPane.setGridLinesVisible(true);
      rootPane.setPadding(new Insets(10));
      rootPane.setPrefHeight(30);
      rootPane.setPrefWidth(100);
      rootPane.setVgap(20);
      rootPane.setHgap(20);
      rootPane.add(playersListView, 0, 0);
      rootPane.add(teamListView, 1, 0);
   private void populateData()
      playersList.addAll(
            new Player("Adam"), new Player("Alex"), new Player("Alfred"), new Player("Albert"),
            new Player("Brenda"), new Player("Connie"), new Player("Derek"), new Player("Donny"),
            new Player("Lynne"), new Player("Myrtle"), new Player("Rose"), new Player("Rudolph"),
            new Player("Tony"), new Player("Trudy"), new Player("Williams"), new Player("Zach")
      playersListView.setItems(playersList);
   private void initializeComponents()
      playersListView.setPrefSize(250, 290);
      playersListView.setEditable(true);
      playersListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
      playersListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
         @Override
         public ListCell<Player> call(ListView<Player> playerListView)
            return new ListCell<Player>()
               @Override
               protected void updateItem(Player player, boolean b)
                  super.updateItem(player, b);
                  if (player != null)
                     setText(player.getName());
      teamListView.setPrefSize(250, 290);
      teamListView.setEditable(true);
      teamListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
      teamListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
         @Override
         public ListCell<Player> call(ListView<Player> playerListView)
            return new ListCell<Player>()
               @Override
               protected void updateItem(Player player, boolean b)
                  super.updateItem(player, b);
                  if (player != null)
                     setText(player.getName());

Yeah, this is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 a while back. Go ahead and vote for it if you are inclined...
I think the issue in your case is that the observable list provided by MultipleSelectionModel.getSelectedItems() is not Serializable. So even if you make your Player class Serializable, the list itself isn't. The first thing I would try, I think, is to make Player implement Serializable and then pass in an ArrayList instead of the observable list. So you can do
content.put(dataFormat, new ArrayList<Player>(playersListView.getSelectionModel().getSelectedItems()));
and
List<Player> player = (List<Player>) dragEvent.getDragboard().getContent(dataFormat);
teamListView.getItems().addAll(player);
If that doesn't work, a workaround is just to store the "dragged list" in a property:
final ListProperty<Player> draggedPlayers = new SimpleListProperty<Player>();
// Drag detected handler:
content.putString("players");
draggedPlayers.set(playersListView.getSelectionMode().getSelectedItems());
// Drag dropped handler:
if (dragboard.hasString() && dragboard.getString().equals("players")) {
     teamListView.getItems().addAll(draggedPlayers.get());
     draggedPlayers.set(null);

Similar Messages

  • Strange UI sticking issue with drag/drop and JList

    Hi all,
    I have implemented drag/drop between a jtree and jlist. The jtree can accept drops from the jtree (nodes to other parent nodes) and from the jlist. The jlist can accept nodes of the tree being dropped on it.
    Let me say this much, it all works. Works fine and great. BUT, the purpose of my post is I am seeing a very strange and not easily reproducible problem.
    I should first say that after a successful drop, the list removes the selected items. I do support drag/drop for multiple items.
    When I drag items from the list to the tree, reasonbly normal (not too fast), everything seems to work every time. But if I drag an item quickly from the list to the tree, for some reason after the items are removed from the list, another item is selected, sometimes NOT in the place of where the item(s) were selected. Infact, when I drag quickly, I notice the selection changes in the list itself. I only accept tree objects being dropped in the list, so there is no ability to drag/drop list items onto itself, and thus if I drag a list item around the list normally, nothing changes..the item I am dragging stays selected and the cursor shows the drag arrow.
    So this problem seems seems odd. I can reproduce it fairly easily, but only when I click and drag quickly.
    Anyone have ideas? I don't see where in my list code that as I drag, when drop is done, etc that I select anything in the list. I have tried JDK 1.4.1 and 1.4.2 and it does it in both. I don't see a bug in the bug database for it, and I am not sure its a bug in the JVM or my own code!
    Any help is appreciated. Can't really post code as its a large set of code and it is dependent on our company project, so it would take some time to take the code out into its own app to test it again.

    Hi,
    +" Please note that dropSite==null is a legal value for collection components. dropSite=null and DropOrientation==ON indicates that the drop has happened outside the data portion of the collection component and should be treated as a drop on the entire component Also note that dropSite==null and DropOrientation==AFTER indicates that the drop has happened on an empty collection component and the user intends to append the data."+
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e10684/oracle/adf/view/rich/event/DropEvent.html#getDropSite__
    List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if(dropRowKey == null){
                return DnDAction.NONE;
            }Frank
    Edited by: Frank Nimphius on Feb 18, 2011 11:18 PM

  • Printing Issues with HP D145 and multiple users from G5

    Hi - I've a HP D145 All-In-One connected via USB to a G5 (as described below). The machine has multiple accounts on for different members of my family. The printer is directly connected to the G5 via USB connection but is shared with other Macs. Printing has become increasingly difficult, and we now have the following problems:
    1. Printing will only work from the administrators account.
    2. Printing periodically (daily, generally after a few hours of use) stops from the administrators account
    Solutions tried:
    a. Check set up for the non-administrators accounts....Looks OK for printing
    b. When printing stops - I've tried repairing the permissions with the Disk Utility. This no longer works.
    c. Run Printer Setup Repair (with option to repair all user accounts) - Works for the administrators account providing the computer and printer are restarted, otherwise no effect.
    d. Reinstalling the software - No effect
    It’s beginning to look like I need to replace this printer with one that works.
    You can help me in two ways - how to solve the printer problems, or alternatively suggest a colour All-in-One printer that can work with multiple accounts and does not have the problems mentioned above.
    Many thanks in advance,
    Regards,
    Melvyn

    Below I've copied the fix HP proposed and some additional information that they have sent me.
    1. The proposed fix that we could not make work:
    Hello Melvyn,
    Thank you for contacting HP Total Care.
    Simply reinstalling the software will not be enough to solve the
    problem. Try these steps to resolve the issue at hand:
    From the Administrator account:
    Double-click on the Macintosh Hard Disk.
    Open Applications.
    Click and drag Hewlett Packard Folder to the trash.
    Close all windows.
    Double-click on the Macintosh Hard Disk.
    Open the Applications folder.
    Open the Utilities folder.
    Double-click on Process Viewer/Activity Monitor
    If Activity Monitor does not appear:
    Choose Monitor in the toolbar across the top.
    Check Show Activity Monitor.
    Ensure the Activity Monitor shows "All Processes", instead of "My
    Processes".
    Single-click and quit each of the applications starting with HP, using
    the Stop Sign that says "Quit Process" beneath it.
    Close Activity Monitor.
    Double-click Macintosh Hard Disk.
    Open the Library folder.
    Open the Preferences folder.
    Click and drag either HP AIO Preferences or Hewlett Packard Preferences
    to the trash.
    Remove the HP Registry file.
    Go back to the Library folder.
    Open the Printers folder.
    Remove the HP folder
    Double click Macintosh Hard Disk.
    Open the Users folder.
    Choose the User logged into.
    Open the Library folder.
    Open the Preferences folder.
    Click and drag either HP AIO Preferences or Hewlett Packard Preferences
    to the trash.
    Click and drag files beginning with com.hp to the trash.
    Click and drag files beginning with HP to the trash.
    Double-click the Macintosh Hard Disk.
    Open the Applications folder.
    Open the Utilities folder.
    Double-click Printer Setup Utility.
    Delete any HP All-In-One printers listed (click the printer name to
    highlight it, then click the Delete button on the printer list)
    Repeat process for all HP All-In-One Printers.
    Remove HP Director/Image Zone from dock by dragging to the trash.
    Restart the Macintosh.
    Empty the Trash.
    From each user account:
    Double click Macintosh Hard Disk.
    Open the Users folder.
    Choose the User logged into.
    Open the Library folder.
    Open the Preferences folder.
    Click and drag either HP AIO Preferences or Hewlett Packard Preferences
    to the trash.
    Click and drag files beginning with com.hp to the trash.
    Click and drag files beginning with HP to the trash.
    Double-click the Macintosh Hard Disk.
    Open the Applications folder.
    Open the Utilities folder.
    Double-click Printer Setup Utility.
    Delete any HP All-In-One printers listed (click the printer name to
    highlight it, then click the Delete button on the printer list)
    Repeat process for all HP All-In-One Printers.
    Remove HP Director/Image Zone from dock by dragging to the trash.
    Restart the Macintosh.
    Empty the Trash.
    From the Administrator account:
    Download and install the latest software for this product. You can
    obtain this software from the following link:
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?lc=en&cc=us⟨=en&os=219& product=64992&dlc=en&softwareitem=oj-35225-1
    From each user account:
    Double-click the Macintosh Hard Disk.
    Open the Applications folder.
    Open the Utilities folder.
    Double-click Printer Setup Utility.
    Click Add, ensure you are in the Default Browser.
    Select the HP All-In-One Printer.
    Click Add at the bottom-right corner of the screen.
    Set this printer as the default.
    You should now be able to print from all accounts.
    Sincerely,
    2. The reasons why it may not have worked:
    We need to be sure that you are fully logging out of one account and
    then back into the next. The fast user switching feature of the Mac OS
    can create problems with our printer drivers. For this reason, fast user
    switching is not supported by HP.
    The other issue we may be running into would be the Mac OS itself. Over
    the past few months the Mac OS has gone through several updates. When
    the 10.4.4 version was released it created some issues with our existing
    software. An updated version of our software has been developed which
    works well with 10.4.4 and higher, but it is not available for this
    printer.
    It may be that as each new OS update is installed on your computers that
    the issue becomes worse. If you are running the Mac OS 10.4.3 or lower
    then the version 7.3.1 of our software should work fine. If it is 10.4.4
    or higher there will be some issues as the new OS versions do not seem
    to like the older drivers.
    I would have to recommend retrying the full uninstall the Derek had
    outlined. This time however, just install the downloaded 7.3.1 software
    from our web site for the D145. Once it has been installed we need to
    test it fully without adding the scanjet software. I am hoping that
    without both version of our software installed it may work better.
    This should resolve the issue. If you need further assistance, please
    reply to this message and we will be happy to assist you further.
    3. The repsonse to questions on switching and OS X 10.4.4
    You are correct, since you are running the 10.4.4 I cannot guarantee
    that the older software version will allow full functionality. It should
    allow for printing and as long as you avoid the fast user switching,
    when trying to print, it should keep working well.
    I understand the convenience of fast user switching but you will have to
    log completely out of one user, and then log properly into the next
    before you can expect the printer to function.
    I would still recommend trying the steps I had outlined as it really is
    the only thing you can do that may work.
    G5, 2 GHz dual processor, 2Gb RAM, 500GB Hard disk   Mac OS X (10.4.3)   Clarification of the issues from HP

  • Issue with Drag&Drop between table and tree component

    I want to drag table rows and drop it on the tree node. I use following code to achieve this:
    <af:table value="#{bindings.pricingObjects.collectionModel}"
    var="row"
    rows="#{bindings.pricingObjects.rangeSize}"
    emptyText="#{bindings.pricingObjects.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.pricingObjects.rangeSize}"
    selectionListener="#{workspaceBean.onTableSelect}"
    rowBandingInterval="0" id="poTable"
    partialTriggers=":::csTree :::cbRefresh"
    columnStretching="column:c4"
    displayRow="selected"
    contentDelivery="immediate"
    clientComponent="true"
    binding="#{workspaceBean.table}"
    rowSelection="multiple">
    <af:dragSource actions="MOVE" defaultAction="MOVE" discriminant="rowmove"/>
    </af:table>
    <af:tree value="#{bindings.privateChangeSets.treeModel}"
    var="node" displayRow="selected"
    selectionListener="#{workspaceBean.onTreeSelect}"
    rowSelection="single" id="csTree"
    expandAllEnabled="false"
    binding="#{workspaceBean.tree}">
    <af:dropTarget dropListener="#{workspaceBean.dropListener}" actions="MOVE">
    <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"
    discriminant="rowmove"/>
    </af:dropTarget>
    </af:tree>
    With this code I am getting the data of dragged rows but I am not able to get the tree node where rows are dropped. Dropevent.getDropSite() always returns NULL.
    Strangely, I tried to use deprecated tags <af:collectionDragSource> and <af:collectionDropTarget> and everything works fine. Dropevent.getDropSite() returns me the correct rowkey of tree node.
    Any idea why am I not getting desired result with <af:dropTarget>?

    Hi,
    +" Please note that dropSite==null is a legal value for collection components. dropSite=null and DropOrientation==ON indicates that the drop has happened outside the data portion of the collection component and should be treated as a drop on the entire component Also note that dropSite==null and DropOrientation==AFTER indicates that the drop has happened on an empty collection component and the user intends to append the data."+
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e10684/oracle/adf/view/rich/event/DropEvent.html#getDropSite__
    List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if(dropRowKey == null){
                return DnDAction.NONE;
            }Frank
    Edited by: Frank Nimphius on Feb 18, 2011 11:18 PM

  • Passing Multiple rows from one external webpart list to another

    Hi Folks,
                    I have almost spent 1 week looking into this without any success. I have an external list "List A"  (in a webpart) with one of the columns as "State".
    Another external list "List B"  (in a webpart ) has state and user as columns. In some case I want to pass 1 state and in another I want to pass multiple state.  Passing one state from List A to List B works fine. But Multiple state does
    not work because the webpart list has the property "Send First row to connected web parts when page loads".  If I disable this option then the web part does not pass anything. Is there a way to pass multiple rows from one Webpart
    external list to other?

    http://www.sharepointanalysthq.com/2010/07/bcs-external-list-limitations/
    No Lookups
    Unfortunatly the only thing that you can do a look up on in an external list is on the ID column, anything else and you are out of luck.
    http://social.technet.microsoft.com/Forums/en-US/615771a0-ba78-4e38-9e2d-ded0204173ba/external-list-referenced-as-sharepoint-lookup?forum=sharepointgeneralprevious
    Try below webpart. it should help
    http://www.sparqube.com/SharePoint-Lookup-Column/
    If this helped you resolve your issue, please mark it Answered

  • Retruring Multiple rows from a Stored Procedure

    The Oracle JDBC documentation shows how to return a cursor pointer through the parameter list of a stored procedure allowing a Java program to use the cursor like a normal result set. I've tried it (using the thin driver) and it works fine - however, I'm having trouble getting this to work running the program under a Weblogic server (using their own JDBC implementation). So, I have two questions:
    1) Has anyone had this problem before and solved it ??
    2) Are there any other techniques for getting multiple rows back from the database without having to fire "raw" sql at it ?

    Hi
    You could return not resultset but array, for example:
    PACKAGE TEST:
    type string_table is table of varchar2(80)
    index by binary_integer;
    function get_something (
    something1 out string_table,
    arraylength in number
    ) return number;
    PACKAGE'S BODY:
    function get_something (
    something1 out string_table,
    arraylength in number /** length of the array **/
    ) return number as
    cursor C is
    select something1, ...
    from test_table;
    pos number := 1;
    begin
    for position in C loop
    exit when (pos > arraylength);
    something1(pos) := position.something1;
    pos := pos + 1;
    end loop;
    return (pos - 1);
    end;
    Of course in this example you need to know length of your array
    (arraylength parameter), but you can avoid such problem, for
    example, by using DBMS_SQL package (or dynamic SQL feature in
    the Oracle8i).
    Andrew
    Mladen Gogala (guest) wrote:
    : Phil Hildebrand (guest) wrote:
    : : Is there a way that I can return multiple rows from a stored
    : : procedure for function ?
    : : Something like:
    : : CREATE FUNCTION sp_get_children (my_nip IN port.nip_num%
    TYPE)
    : : RETURN my_nip
    : : IS
    : : CURSOR child_cur IS
    : : SELECT nip_num
    : : FROM logical_port
    : : WHERE port_num = my_nip;
    : : child_rec child_cur%rowtype;
    : : BEGIN
    : : FOR child_rec IN child_cur
    : : LOOP
    : : RETURN my_nip;
    : : END LOOP;
    : : END tmp_sp_get_children;
    : : I know how to do it in Informix ( RETURN WITH RESUME ), but
    : I'm
    : : not running Informix ;)
    : : Thanks,
    : : Phil
    : In contrast with Informix, SQL Server and Sybase, Oracle
    : can not return a result set. the only workaround is to
    : return the cursor variable as such.
    null

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How do I insert multiple rows from a single form ...

    How do I insert multiple rows from a single form?
    This form is organised by a table. (just as in an excel format)
    I have 20 items on a form each row item has five field
    +++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
    +Product| qty In | Qty Out | Balance | Date +
    +------------------------------------------------------------------------+
    +Item1 | textbox1 | textbox2 | textbox3 | date +
    + |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
    +------------------------------------------------------------------------+
    +Item 2 | textbox1 | textbox2 | textbox4 | date +
    + |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
    +------------------------------------------------------------------------+
    + Item3 | textbox1 | textbox2 | textbox3 | date +
    +------------------------------------------------------------------------+
    + contd | | | +
    +------------------------------------------------------------------------+
    + item20| | | | +
    +------------------------------------------------------------------------+
    + + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Database Structure
    +++++++++++++++++
    + Stock_tabe +
    +---------------+
    + refid +
    +---------------+
    + item +
    +---------------+
    + Qty In +
    +---------------+
    + Qty Out +
    +---------------+
    + Balance +
    +---------------+
    + Date +
    +++++++++++++++++
    Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
    Please anyone help me out, on how to get this concept started.

    Hello,
    I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
    Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
    Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
    I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
    Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
    In your code view, the Custom Trigger will look something like this:
    function Trigger_Custom(&$tNG) {
    if($tNG->getColumnValue("Item_1")) {
    $item1 = $tNG->getColumnValue("Item_1");
    $textbox1_1 = $tNG->getColumnValue("Textbox_1");
    $textbox1_2 = $tNG->getColumnValue("Textbox_2");
    $textbox1_3 = $tNG->getColumnValue("Textbox_3");
    $date1 = $tNG->getColumnValue("Textbox_3");
    $queryAdd = "INSERT INTO Stock_table
    (item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
    $result = mysql_query($queryAdd) or die(mysql_error());
    This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
    $tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
    // Add columns
    $customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
    There will be one for each field you created with the Custom Form Wizard.
    Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
    Hope this helps.
    Shane

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • Deleting Multiple Rows From Multiple Tables As an APEX Process

    Hi There,
    I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
    On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
    A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
    What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
    BEGIN
    UPDATE tblDebitNotes d
    SET d.Paid = 0
    WHERE 1=1
    AND d.DebitNoteID = :P7_DEBITNOTEID;
    INSERT INTO tblDeletedPayments
    ( PaymentID,
    DebitNoteID,
    Amount,
    Date_A,
    SupplierRef,
    Description
    VALUES
    ( :P7_PAYMENTID,
    :P7_DEBITNOTEID,
    :P7_PAID,
    SYSDATE,
    :P7_SUPPLIERREF,
    :P7_DESCRIPTION
    DELETE FROM tblPayments
    WHERE 1=1
    AND PaymentID = :P7_PAYMENTID;
    END;
    The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
    However this process is not doing anything!! Any insights greatly appreciated.
    Many thanks,
    Gary.

    ...the "button" is using a page level Target,...
    I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
    Scott

  • Custom database functoid to return multiple rows from database

    Hi,
    I have created a custom database fucntoid to execute a stored procedure which returns just single row from the database.But I could not manage to return multiple rows from the database.
    Does anyone know how to return multiple rows from DB and create a node with that many occurrences in the target schema?
    Thanks
    JB

    If you want to do this in messaging-only way without orchestration, then only option let to you is using .NET in BizTalk:
    We had similar requirement with one of our clients, where they didn’t want to use orchestration (though we emphasised on less impact orch would have compared to manageability),
    they still wanted to have pure-messaging only.
    We extended the custom XslTransform component that ships with BizTalk SDK (<BizTalk installation directory>\SDK\Samples\Pipelines\XslTransformComponent)).
    Created a custom disassembler pipeline component, used the XslTransform component from SDK to execute the map’s XSLT. Here we created a map with every links except the database ones. After executing the map, access the database, execute the store procedure
    which returns more than one row/dataset, enrich the XSLT transformed message with the dataset from your database in disassembler.
    Since .NET gives you the flexibility of access the dataset with more than one row, you can enrich the message in custom pipeline code.
    Other option is code the message transformation completely in .NET code in custom disassembler by passing the received message to method/code which would code the map/enrichment.
    While enriching you can execute the store procedure which returns more than one row/dataset, enrich the message further with the dataset from db.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Selecting Multiple Rows from ALV GRID Display

    Hi,
    I am having a ALV GRID Display. I want to select multiple rows from the Output and move them to an internal table.
    Please let me know how do I acheive this.
    Thanks in advance,
    Ishaq.

    Hi,
    Have a look on the following code. It displays the selected rows which hv been selected in basic list.
    TABLES:
      spfli.
    TYPE-POOLS:
      slis.
    DATA:
      BEGIN OF t_spfli OCCURS 0,
        checkbox.
            INCLUDE STRUCTURE spfli.
    DATA:  END OF t_spfli.
    DATA:
      t_sspfli LIKE STANDARD TABLE OF t_spfli .
    DATA:
      fs_spfli LIKE LINE OF t_sspfli.
    DATA:
      fs_layout TYPE  slis_layout_alv,
      w_program TYPE sy-repid.
    SELECT *
      FROM spfli
      INTO CORRESPONDING FIELDS OF TABLE t_spfli.
    *fs_layout-info_fieldname = 'COLOR'.
    fs_layout-box_fieldname = 'CHECKBOX'.
    w_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program       = w_program
        i_callback_pf_status_set = 'FLIGHT'
        i_callback_user_command  = 'SPFLI_INFO'
        i_structure_name         = 'SPFLI'
        is_layout                = fs_layout
      TABLES
        t_outtab                 = t_spfli
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  FLIGHT
          text
         -->RT_EXTAB   text
    FORM flight    USING rt_extab TYPE slis_t_extab..
      SET PF-STATUS 'FLIGHT' EXCLUDING rt_extab.
    ENDFORM.                    "FLIGHT
    *&      Form  SPFLI_INFO
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM spfli_info USING ucomm LIKE sy-ucomm
                           selfield TYPE slis_selfield.
      selfield-refresh = 'X'.
      CASE ucomm.
        WHEN 'FLIGHT'.
          LOOP AT t_spfli.
            IF t_spfli-checkbox = 'X'.
              t_spfli-checkbox = ' '.
             t_spfli-color = 'C51'.
              MODIFY t_spfli TRANSPORTING checkbox.
              fs_spfli = t_spfli.
              APPEND fs_spfli TO t_sspfli.
            ENDIF.
          ENDLOOP.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR fs_spfli.
      fs_layout-info_fieldname = 'COLOR'.
    fs_layout-confirmation_prompt = 'X'.
      fs_layout-key_hotspot = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = w_program
          i_structure_name   = 'SFLIGHT'
          is_layout          = fs_layout
        TABLES
          t_outtab           = t_sspfli
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH t_sspfli.
    ENDFORM.                    "SPFLI_INFO
    Regards,
    Chandu

  • How to pass out multiple rows from EJB method?

    I need a sample for passing multiple rows from a EJB query method
    (using SQLJ). All I found in existing sample code is query on a
    single row and pass out as a bean class e.g Emp class with some
    getXX() method.
    What I'm currently doing is to convert the Iterator to a Vector
    and pass the Vector out, which means I've to code a bean class,
    use a Vector and later use a Enumeration to read the result. Is
    there a simpler way to receive multiple rows from EJB?
    In EJB:
    while ( empIter.next() ) {
    EmpVect.addElement( new Emp( emps.empNo(), emps.eName(),
    emps.job(), emps.deptNo()) );
    return EmpVect;
    In client:
    Vector empVect = empEJB.getEmployees(123);
    Enumeration employees = empVect.elements();
    while ( employees.hasMoreElements() ) {
    emp = ( Emp ) employees.nextElement();
    System.out.println(" " + emp.getEName());

    Hi Ankit,
    There is a workarround that requires some excel work.
    Here you need to follow the above mentioned steps along with this you need an additional combo box (wont be displayed at runtime, it will fetch the entire data if we select blank for the first combo box).
    Now suppose we are using 2 combobox C1 and C2 and our data is from B3 to F6.
    Now for C1 (one we are using for selection)
    1. select the labels as Sheet1!$B$2:$B$6 (a blank cell is added for all selection)
    2. Insertion type as filtered Rows
    3. Take source data as Sheet1!$B$2:$F$6 (includeing one blank row)
    4. selected Items as none
    5. for C2 labels as Sheet1!$A$3:$A$6 source data as Sheet1!$B$3:$F$6 destination as Sheet1!$B$14:$F$17.
    6. Selected Item : Sheet1!$B$9  (blank  Type dynamic). So it will select the entire table, if nothing is selected.
    7. take a Grid component and map it to Sheet1!$H$9:$L$12. use formula as =IF(IF($B$9="",B14,B9)=0,"",IF($B$9="",B14,B9)) on cell H9. Where we take H6 to L12 as final data set. Tis will become the data for next set fo Combo box for further selection.
    8. follow the same steps for other combobox selections.
    9. control the dynamic visibility of grids on the basis of Destination cell (like B9).
    Revert if you need further clarification.
    Regards,
    Debjit

  • How to select multiple rows from List Of Values

    Hello,
    I use ADF 11g to create my list of values (LOV). I want to select multiple rows from it. but i can't.
    so how i can select many rows to set them in my adf table.
    Thank in advance

    Hi,
    LOV is map to an attribute in the viewObject so it will return only one value or more values from selected row. You can't select multiple rows from LOV.
    But you can do this by using popup which you can select multiple rows and insert the selected rows to another table.
    This blog post explain how to achieve this :
    http://husaindalal.blogspot.com/2009/11/search-from-popup-and-add-to-new-table.html#comments
    Sameh Nassar

  • I just restored my 13" MBP i5 at the apple store to the newest version of Lion after issues with a previous Time Machine backup from Snow Leopard- this time I created a new account and just ported files and folders, and now MS Office doesn't work. Help?

    I just restored my 13" MBP i5 at the apple store to the newest version of Lion after issues with a previous Time Machine backup from Snow Leopard- this time I created a new account and just ported files and folders, and now MS Office doesn't work.
    ^^ that's the main problem. Here's the full history.
    I bought a new 13" i5 MBP, early 2011 edition. I had an old white Macbook 2.14 ghz core2duo on Snow Leopard. I attempted to port over my time machine backup, but encountered problems in that my User was inaccessible from the new computer after the import finished, and I had to go in and change the root password, etc, and for some reason or another, I couldn't install any programs at all from that administrator's account. By "couldn't" I mean I could install them, but upon installation they would never boot. So, I took it to the apple store and did a clean install from the most up to date Lion OSX. Then, I created a brand new admin account, instead of trying to import the old one, and things seemed great. Then, I just imported my old files from the TM backup, but not any system settings, permissions, or user data. Just my Docs, pics, vids, apps, and itunes stuff.
    Here's where things get weird again. I imported this stuff under the name "old", but all of these folders have a red negative sign on them, marking them as restricted. So, from my main admin account, I cannot even peruse these folders. Since I didn't import user data, I can't sign in to the "old" account to change permissions. I already tried to change the permissions from system preferences, but that didn't change anything. And now, for whatever reason, of all the apps that were imported then, MS Office is the only set of apps that does not work. When I click on it, it just says there was a problem and asks if I'd like to send a report to apple. I tried reinstalling it to no avail. I'm an English student, so i really need access to Word. Can anyone help? The Apple store is a major detour for me and would like to fix this issue myself.

    Most likely you have Office 2004 which are PPC-only applications and will not work in Lion. Upgrade to Office 2011. Other alternatives are:
    Apple's iWork suite (Pages, Numbers, and Keynote.)
    Open Office (Office 2007-like suite compatible with OS X.)
    NeoOffice (similar to Open Office.)
    LibreOffice (a new direction for the Open Office suite.)

Maybe you are looking for

  • Purchase Order and Goods Recipt

    Pls tell me the differnce between the effects of Purchase Order Form in Purchase A/P Module  and Goods Reciept Form in Inventory Transaction Module ..Both of these increses the qua

  • Oracle database not starting up in oracle 10g RAC

    Hi! Recently I came across one problem with one node oracle 10g RAC.When the Oracle database is started,while opening it is giving ORA-03113:End of file on communication channel error.When I saw the the alert trace file and other trace files I found

  • PAR files need to be used

    hi can anyone specify the PAR files that need to be modified to customize the registration page thanks in advance regards yoga

  • Adobe 8 Write/Print Problems

    I'm trapped: can't create a pdf from my Adobe 8 standard after I finished my 30-day trial of 9 Pro, but decided not to purchase it. The system keeps asking me for my 9 serial # and says that Adobe is not installed even though the reader works.

  • Find out duplicate rows in a flat file before using sqlldr

    Hello i want to import via sqlldr from a flat file to a table inside my data base. My flat file has unfortunately some duplicate copies inside. So, i defined my upload table with two primary keys- date and time(and sometimes there are more than one r