GlassPane: How to fire the ActionEvent of a JPanel

Hello Everyone,
I'm developing an application with a glasspane added to it. The idea is that some JPanels which act as an Button
can be "clicked" through the glasspane.The other components may not be clicked when the glasspane is enabled
When i click on the glasspane on a location where a JPanel is located, the correct Jpanel is found by getDeepestComponentAt (tested by using System.out).
but when i dispatch the event(mouseclick) on this JPanel the actionEvent isn't fired.
The JPanels are located in another class file then the glasspane is.
My question is how to fire a ActionEvent from another class?
Thanks in advance,

If you post a SSCCE that demonstrates your problem, someone might be able to help.
{color:#0000ff}http://www.physci.org/codes/sscce.html{color}
db

Similar Messages

  • How to fire the query: "IsuOrderItemQuery"

    Hi Experts,
                          I am trying to fire the query "IsuOrderItemQuery" by giving the BUPA_NUMBER as the input value. For this I have used the method CL_CRM_BOL_QUERY_SERVICE->GET_QUERY_RESULT but i am not able to get the result and i am not able to get any child relations. When I look from BOL browser for the same orderitemquery by giving the BP it is working fine. Can anybody throw some light on this issue to read the childnodes by triggering the "IsuOrderItemQuey".
    Contributions will be highly rewared. Thanks
    Regards,
    Lakshmana.P

    ls_parameter  TYPE crmt_name_value_pair,
    lt_parameter  TYPE crmt_name_value_pair_tab,
    query_items   TYPE REF TO cl_crm_iu_order_item_query,
    col_items     TYPE REF TO if_bol_bo_col,
    TRY.
    CREATE OBJECT query_items
    EXPORTING
    iv_query_name = 'IsuOrderItemQuery'.
    CATCH cx_crm_unsupported_object.      "#EC NO_HANDLER
    ENDTRY.
    IF query_items IS BOUND.
    ls_parameter-name  = 'CA_NUMBER'.         "#EC NOTEXT
    ls_parameter-value = ''.
    APPEND ls_parameter TO lt_parameter.
    ls_parameter-name  = 'ISU_CONTRACT_NR'.         "#EC NOTEXT
    ls_parameter-value = '55000001'.
    APPEND ls_parameter TO lt_parameter.
    query_items->set_query_parameters( it_parameters = lt_parameter ).
    col_items = query_items->get_query_result( ).

  • How to fire the adapter to revoke users?

    Currently I have written adapter for deletion of resources from target app. but for "Task Effect", I have selected "Disables process or access to application" which results in firing of my adapter when I choose to Disable a user from Web console.
    There is also an option to revoke users in web console. How can I make my adapter to be called when I choose to revoke a user.
    Thanks

    Create a task for Revoke User and attach this task in undo/Recovery Tab of other task(generally create user task).
    Now when user is revoked from web console, the Revoke User task gets called and do the operation.

  • How to change the background of a Jpanel

    All I want to do is change the background color of my JPanel. I have looked at some of the java tutorials, and I am still having a really hard time figuring it out. Is there a simple way to just change the background color, without messing with overriding the paintComponent() method?

    All I want to do is change the background color of my
    JPanel. I have looked at some of the java tutorials,
    and I am still having a really hard time figuring it
    out. Is there a simple way to just change the
    background color, without messing with overriding the
    paintComponent() method?Simple enough?
    myPanel.setBackground(Color.BLUE);Edit: You'd better learn how to use and search through the API:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JPanel.html
    null

  • How to define the position of a JPanel in a JScrollPane?

    I have put a panel into scrollpane. The panel is used to draw some graphs, if the panel enlarge the scrollbar will dispaly. it works well. I use jScrollPane.getViewport().add(jPanelDraw, null) to add panel into the scrollpane. I found the panel is always in the top left coner of the scrollpane, how could i do if i want put the panel in the center of the scrollpane?

    Try something like this:
    BorderLayout bl = new BorderLayout();
    JPanel parent = new JPanel();
    JScrollPane scrollPane = new JScrollPane();
    Then set the layout:
    scrollPane.setLayout(bl); // Our BorderLayout
    To add a component in the center:
    scrollPane.getViewport().add(myJComponent, BorderLayout.Center);
    Then add the scoller to the parent
    parent.add(scrollPane);
    Of course you should also specify a layout for the parent, too...

  • How to change the background of a JPanel when printing?

    I have a JPanel that has a background color of gray when displayed on the screen. I would like to change the background to white when printing but leave it gray on the screen. I am calling setBackground(), clearRect() and fillRect() but it still prints out with the gray background. Any thoughts on what method I could call to change this?
    public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
    if (pageIndex >= 1) {
    return Printable.NO_SUCH_PAGE;
    double pageHeight = pf.getImageableHeight();
    double pageWidth = pf.getImageableWidth();          
    Graphics2D g2 = (Graphics2D) g;
    g2.setBackground(Color.white);
    g2.clearRect((int)pageWidth/2, (int)pageHeight/2, (int)pageWidth, (int)pageHeight);
    g2.fillRect((int)pageWidth/2, (int)pageHeight/2, (int)pageWidth, (int)pageHeight);
    paint(g2);

    From reading the doc, it appears that you have to change the background color of the Component:
    setBackground
    public abstract void setBackground(Color color)
    Sets the background color for the Graphics2D context. The background color is used for clearing a region. When a Graphics2D is constructed for a Component, the background color is inherited from the Component. Setting the background color in the Graphics2D context only affects the subsequent clearRect calls and not the background color of the Component. To change the background of the Component, use appropriate methods of the Component.
    Parameters:
    color - the background color that isused in subsequent calls to clearRect
    See Also:
    getBackground(), Graphics.clearRect(int, int, int, int)
    V.V.

  • How is constructing an ActionEvent used?

    This is a general question about ActionEvents. I don't really know that much about ActionListeners and such, I am still a newbie learner, but that way I usually use an ActionEvent is as such
    public void actionPerformed(ActionEvent e)
    {}However I've seen that you can construct an ActionEvent, with all sorts of initial properties, and I was just wondering if somebody could explain in what situation you would want to construct an ActionEvent object, and what that actually means. Also how do you fire this ActionEvent object that you have already created.
    Usually I have buttons which I add ActionListeners to, and then the ActionHandler will define that method I stated above. In this scenario, the ActionEvent is automatically fired somehow by the button when I press it. But if I create an ActionEvent object how would i use it, or fire it the same way a button knows how to fire an event. Thanks in advance

    You could create your own event in support of a custom component, for example.
    On how to fire the event see the api for javax.swing.event.EventListenerList. It has nice sample code.

  • How to fire event to generate insert message for the child objects?

    We are in process to integrate CRM On Demand and existing Microsoft SQL DB.
    We have the following problem:
    For ex., we have CRM Object_1 that already synchronized with the SQL DB. CRM also has independent Object_2 and its child Object_2.1
    We dicided that we want to connect the Object_2 as child to the Object_1.
    The question is how to fire event to generate insert message for the Object_2 and Object_2.1?
    What is the best technique? Is it possible to do it by workflow configuration or it needs to be done programmatically?
    Thanks,
    Dmitry
    Edited by: 955827 on Aug 29, 2012 11:57 AM

    Hi,
    integration events can be generated only via worklow. You will need to create separate workflows for each record type (regardless if it is child or parent) because a workflow for the parent record type will not trigger when a child record is created/ associated. Also, the association workflows will trigger only when the specific event occurs.
    There is not way to generate the integrtaion events programatically. They are generated by workflows and are read/ interpreted by a code extension.

  • I have recently had to fire my web designer who was using iWeb.  Now I'm trying to figure out how to get the site to open in iWeb on my new MacBook Pro.  Is there a way?

    I have recently had to fire my web designer who was using iWeb.  Now I'm trying to figure out how to get the site to open in iWeb on my new MacBook Pro.  Is there a way?

    Firstly iWeb CAN'T IMPORT any kind of published html code as it has no import facility.  You can however add html code, javascript and css by selecting the html snippet and placing it on your page the entering the code in here and clicking on Apply.  You DO NOT create a shape as you say - you use the html snippet and place your code in there.
    There are not really a lot of ways in which you can write code - if you want to enter small amounts of code, then you would use an ordinary text editor to do this such as Text Edit on a Mac or Text Wrangler.  If you want to add code to iWeb like this, then you would either use the html snippet method in iWeb itself or you would have to publish the site to a local folder from iWeb and open the relevant html page with a text editor and add the additional code in this way and then publish.  However, if he decided to add the code with a text editor, then you would have to upload the pages directly to the server using an ftp client - if you try to upload the site directly from iWeb, all the extra code will be overwritten.
    As for checking whether the site was created using iWeb, all you need do is view the site in Safari and then click on View and then select View Source Code and it will tell you.
    Even thoough extra code was added to the site and he might well have done this by publishing to a local folder and adding the code with a text editor, he should still have the domain file for the site too.
    Ask again.  I'm sure that for adding quick code, most would not want to use programmes such as Dreamweaver, but a simple text editor will suffice.  As OT already said, if he claims that he does not have the domain.sites file, then try Flux 4 which is a web design programme and has full import facilities.  At least this way, if he just gives you the published version of the site, you have some way of opening it.
    You can download a free trial of Flux 4 and you can also purchase the full version from the Mac App Store if you decide you like it.

  • How to fire a window closing event, not clicking the X button of the UI

    I�ve an application that uses a WindowListener for the WindowClosing event of a JFrame. When the user presses CTRL-Q I needed to fire a windowClosing for that frame, in order to detect it and take some actions in the class referencig the JFrame (this class has the windowListener).
    setDefaultCloseOperation was not good for me, so i fire the windowClosing event with the following code:
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
        WindowEvent we = new WindowEvent(this,WindowEvent.WINDOW_CLOSING, null, 0, 0);
        this.getWindowListeners()[0].windowClosing(we);
    }Hope this is the right way to fire the event and this helps someone. If not please code a better way,
    Alonso

    Yes, that works and looks better:
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                            
       this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
    } "this" refers to the JFrame.

  • How to fire a schema trigger from outside the schema

    A user is using an ad hoc tool similar to SQL Developer called PeopleSoft Application Designer.
    He creates a connection to the db, then issues an alter session set current_schema = 'restricted_schema'. The connected user does not have direct privileges on the "restricted_schema" which they call SYSADM.
    After changing the schema context in that manner he creates objects in SYSADM. A schema trigger is then fired and grants privileges on the new objects created in SYSADM. Doing the same in either SQL Plus or SQL Developer does not fire the schema trigger.
    I think SQL Plus and SQL Dev are working as they should. Altering the session like that does not change your identity - just the schema context. But, when you examine v_$session, the connection with this other tool looks exactly the same as one from SQL Plus or SQL Dev when changing the schema context in the session.
    Instead of trying to figure out what this other tool is doing, is there any way for that schema trigger to fire when using this process from one of our tools?

    >
    A user is using an ad hoc tool similar to SQL Developer called PeopleSoft Application Designer.
    He creates a connection to the db, then issues an alter session set current_schema = 'restricted_schema'. The connected user does not have direct privileges on the "restricted_schema" which they call SYSADM.
    After changing the schema context in that manner he creates objects in SYSADM. A schema trigger is then fired and grants privileges on the new objects created in SYSADM. Doing the same in either SQL Plus or SQL Developer does not fire the schema trigger.
    >
    The user CANNOT create objects in any schema without the proper privileges.
    Setting the current_schema parameter does not confer ANY additional privileges to a user. See ALTER SESSION in the SQL language doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10592/statements_2013.htm
    >
    CURRENT_SCHEMA
    Syntax:
    CURRENT_SCHEMA = schema
    The CURRENT_SCHEMA parameter changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement.
    This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give the session user any additional system or object privileges for the session.
    >
    If the user connects and sets SYSADM as the current schema and creates objects in SYSADM the user already had privileges to create objects in the SYSADM schema; setting the current schema has nothing to do with it.
    So your issue is that the user has privileges to create objects in the SYSADM schema; you need to revoke those privilges (or the role that grants them) to solve your problem.

  • How to realize the function only a validator is fired when submit

    Sorry for my question.
    In a web Page here are a inputText of a code ,a search button Searching by the Code , others inputText s and a 'OK ' button.
    the question is how to fired a only 'code' validator when searching
    I made the search button immediate="true" ,So I wanted to fire the code validator by actionListener, the others validator were not fired .
    But in this way i find i can't get the code's number not only by binding
    but also by value. so What shall i do?
    the actionListener is this:
         public void commandButton_search(ActionEvent e){
              UIViewRoot UIroot=FacesContext.getCurrentInstance().getViewRoot();
              UIComponent uicomponent=UIroot;
              String strCode= (String)this.inputText1.getValue();
    MemberValidator aValidator=new MemberValidator();
              aValidator.searchAddressCheck(uicomponent,strCode);

    As I posted before a response for your post,
    if you want to use the input value in an action,
    you should not use immediate="true";
    otherwise you need to do everything JSF will do.
    The most simple way is to have two <h:form>s in the page.
    One <h:form> includes the <h:inputText> of a code and the search button.
    Another <h:form> includes other components.
    If the OK button also use the seach code, you can use Javascript to copy the
    code value from the <h:inputText> in the first form to some <h:inputHidden>
    in the second form.

  • How to have the focus right?

    Hey there,
    I have a JFormattedTextfield and two buttons below that. Each Button has another calculation function. The first button is the most used one.
    By starting the programm the focus is at the textfield, so that the user can enter numbers without struggling with the mouse. Now the user should press enter to fire the first button's function. How can I do this? At the moment the program does nothing by pressing enter.
    Thanks alot!
    SA.

    add an action listener to the field that you talk about, for example:
    txtNumber.addActionListener(
         new ActionListener() {
               public void actionPerformed( ActionEvent e ) {
                      // do some functionality
    );that way, you will register you text field to listen for enter action.
    jotnarta
    Message was edited by:
    jotnarta

  • How to Fire an Action

    Im looking for a programmatic way to fire an Action.
    So far ive tried binding it to a JButton with new JButton(action)
    and then trying to fake fire it with button.doClick().
    Ive also tried throwing a fake actionPerformed() by firing a real
    event and copying all the filed (except time).
    actionPerformed(new ActionEvent(button1, 1001, "COPY", System.currentTimeMillis(), 16));Im really a little confused as to how Action works.
    I just need a way to have the Action do its work without having
    to activate it through a gui.

    No it doesnt work.
    Im thinking maybe you have to throw the ActionEvent higher in the chain like to the EventQueue?
    Because, even without adActionListener the Action is already bound to the button.
    This is my testing class. It looks messy but its super simple and
    easy to follow.
    This all started with looking for a way to get around the stupid applet
    "security" restriction that doesnt let you copy to the system clipboard.
    The jtextcomponent already has a copy Action that DOES work, lol.
    So I just search the components Actions and steal the copy Action.
    I now want to fire this programmatically - WITHOUT being dependent
    on a GUI component (like a button press) to do it...
    because i want one button to do a series of things - ending with the copy.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    import java.io.*;
    import java.applet.*;
    public class ClipboardApplet extends JApplet implements ClipboardOwner, ActionListener{
         JTextArea textField;
         JButton button1;
         JButton button2;
         JButton button3;
         Action copy = null;
    public static void main(String[] arguments){
         ClipboardApplet ca = new ClipboardApplet();
         ca.init();
         JFrame frame = new JFrame("???");
         frame.setSize(400, 400);
         frame.setLocationRelativeTo(null);
         //frame.setUndecorated(true);
         frame.setContentPane(ca);
         frame.setVisible(true);
    public void init(){
         this.getContentPane().setBackground(Color.yellow);
         JFrame frame = new JFrame("???");
         frame.setSize(200, 200);
         frame.setLocationRelativeTo(null);
         frame.setUndecorated(true);
         frame.setVisible(true);
         textField = new JTextArea("deez nutz");
         textField.setPreferredSize(new Dimension(100, 100));
         Action[] actions = textField.getActions();
         for(int i = 0; i < actions.length; i++){
         //System.out.println("Action: " + (String)actions.getValue(Action.NAME));
         if(((String)actions[i].getValue(Action.NAME)).equals("copy-to-clipboard")){
         System.out.println("Found it.");
         System.out.println("Mnemonic: " + (String)actions[i].getValue(Action.MNEMONIC_KEY));
         System.out.println("Action Command Key: " + (String)actions[i].getValue(Action.ACTION_COMMAND_KEY));
         System.out.println("Stroke: " + (String)actions[i].getValue(Action.ACCELERATOR_KEY));
         copy = actions[i];
         button1 = new JButton(copy);
         button1.setText("COPY");
         button2 = new JButton("SELECT");
         button3 = new JButton("FIRE!");
         button1.addActionListener(this);
         button2.addActionListener(this);
         button3.addActionListener(this);
         this.getContentPane().setLayout(new FlowLayout());
         this.getContentPane().add(new JScrollPane(textField));
         this.getContentPane().add(button1);
         this.getContentPane().add(button2);
         this.getContentPane().add(button3);
    public void paint(){}
    public void actionPerformed(ActionEvent e){
         if(e.getSource() == button1){
         System.out.println("Action: Copy");
         System.out.println("Event 1: " + e.getID());
         System.out.println("Event 1: " + e.getActionCommand());
         System.out.println("Event 1: " + e.getModifiers());
    //     setClipboardContents(textField.getText());
    //     setClipboard();
         if(e.getSource() == button2){
         System.out.println("Action: Select");
         selectText();
         if(e.getSource() == button3){
         fakeFire();
    public void fakeFire(){
         textField.selectAll();
         //copy.setEnabled(true);
         button1.doClick();
         actionPerformed(new ActionEvent(button1, 1001, "COPY", System.currentTimeMillis(), 16));
         // 1001, copy, 16
         ActionEvent(Object source, int id, String command)
         ActionEvent(Object source, int id, String command, int modifiers)
         ActionEvent(Object source, int id, String command, long when, int modifiers)
    public void selectText(){
         System.out.println("Selecting...");
         textField.selectAll();
    public void setClipboard(){
    //     KeyStroke controlC = KeyStroke.getKeyStroke("control C");
    //     Action copy = textArea.getActionMap().get(textArea.getInputMap().get(controlC));
         Action[] actions = textField.getActions();
         Action copy;
         for(int i = 0; i < actions.length; i++){
         System.out.println("Action: " + (String)actions[i].getValue(Action.NAME));
         if(((String)actions[i].getValue(Action.NAME)).equals("copy-to-clipboard")){
         System.out.println("Found it.");
         copy = actions[i];
    static String ACCELERATOR_KEY
    static String ACTION_COMMAND_KEY
    static String DEFAULT
    static String LONG_DESCRIPTION
    static String MNEMONIC_KEY
    static String NAME
    static String SHORT_DESCRIPTION
    static String SMALL_ICON
    public void setClipboardContents(String text){
         try{
         System.out.println("Copying...");
         textField.copy();
    //     textField.paste();
    StringSelection stringSelection = new StringSelection(text);
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents( stringSelection, this );
         System.out.println("Copied.\n");
         } catch(Exception e){
         e.printStackTrace();
    // Clipboard Owner
    public void lostOwnership( Clipboard aClipboard, Transferable aContents){

  • How to get the selected values from a selectmanylistbox?

    Hi ADF Experts,
    <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb2"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      private List<String> lovValue;
      private List<SelectItem> actualList;
    //getters and setters
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for (String selectedItem : lovValue) {
            System.out.println("Selected item: " +selectedItem.); // this is giving 1 and 3 like this. how to get the checked values as I'm getting only the indexes. In this scenario I am populating the list programmatically.Just I wanted to know how can we get the selected values(not indexes). Please suggest.
    Thanks-
    Abhijit

    Hi Timo,
    As I am sharing the page fragment and the Java class. So its my usecase I have mentioned below
    I am sharing the jsff page fragment and java class. So that it wud be of help to others.
    jsff page fragment
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
            <af:panelGroupLayout id="pgl1">
              <af:commandButton text="Search"  id="cb1"
                                actionListener="#{viewScope.TestBean.searchSupplier}"/>
    </af:panelGroupLayout>
        <af:popup id="p1" binding="#{viewScope.TestBean.searchSupplierPopup}">
              <af:dialog id="d2"
                         type="none">
               <af:table value="#{bindings.Contacts.collectionModel}" var="row"
                      rows="#{bindings.Contacts.rangeSize}"
                      emptyText="#{bindings.Contacts.viewable ? 'No data to display.' : 'Access Denied.'}"
                      fetchSize="#{bindings.Contacts.rangeSize}"
                      rowBandingInterval="0"
                      binding="#{viewScope.TestBean.tsupportIssues}"
                      filterModel="#{bindings.ContactsQuery.queryDescriptor}"
                      queryListener="#{bindings.ContactsQuery.processQuery}"
                      filterVisible="true" varStatus="vs"
                      selectionListener="#{bindings.Contacts.collectionModel.makeCurrent}"
                      rowSelection="multiple" id="t1">
              <af:column sortProperty="name" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.name.label}" id="c2">
                <af:outputText value="#{row.name}" id="ot1"/>
              </af:column>
              <af:column sortProperty="email" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.email.label}"
                         id="c1">
                <af:outputText value="#{row.email}" id="ot2"/>
              </af:column>
            </af:table>
          <af:commandButton text="OK" id="cb5" partialSubmit="true"       actionListener="#{viewScope.TestBean.testMethod}"/>
          <af:commandButton text="Cancel" id="cb6"
                            actionListener="#{viewScope.TestBean.cancelPopupSearch}"/>
        </af:dialog>
            </af:popup>
      <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb5"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true"
                            binding="#{viewScope.TestBean.prp1}">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      <af:commandButton text="remove selected" id="cb4"
             partialSubmit="true"           actionListener="#{viewScope.TestBean.removeSelectedValues}"/>
    </jsp:root>
    TestBean.java
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<this.getLovValue().size();i++){
            System.out.println("Selected Value:"+this.getLovValue().get(i));
            System.out.println(this.getLovValue().remove(i));
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    Thanks,
    A. Abhijit

Maybe you are looking for

  • Requisition

    Hi Gurus, 1) I am getting the error message"Valuation area not defined", while creating a requisition. How to solve this problem? 2) We can put a purchase order on hold. What is the equivalent thing in Purchase requisition? 3) What is the difference

  • Acrobat 9 Pro: Importing large Word-Documents

    Hello together! I have a big problem with my doctorate thesis. I would like to import a large Word-Document (2.28 MB, about 300 pages) into Acrobat 9 Pro. That doesn't work at all. I can't beleave it. Is Adobe even worse than Microsoft?????!!!!!!!! I

  • After Saving File get Message "Could not find the included template"

    I have a strange issue going on and it's becoming very, very annoying.  When I edit a file on our web server (it's a virtual machine running Windows Server 2008) and then try to view it in my browser, I get the error message "Could not find the inclu

  • Recording sign on the ipad when i make call

    dears i have skype on my ipad, when i make a call from it, i have recording word on the top of the ipad,,,, what is this,,, is it a virus????

  • How do I uninstall photoshop cs-2

    how do I uninstall photoshop  cs-2