How to get the selected row in a programmatic table of the ADF (table generated from a bean)

Hi all


We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


How to get the selected line in a programmatic (using a SortableModel custom not a display object) ADF table (generated from a bean)?


We are trying to get the selected row in a bean of a programmatic ADF table to retrieve data based on the selected line.


Any idea?

Well, you can use selectionListener to set the selected line to a variable of bean (but this bean must be in extended view or some superiors)

Something like this: http://www.awasthiashish.com/2015/07/get-selected-row-singlemultiple-from.html

Dario

Tags: Java

Similar Questions

  • How to display the HTML page generated from a bean managed OUCSSPortalADFLibrary?

    ? Hello

    I have an af:commandButton in my jsff. By clicking on the button will perform an action of the managed bean located in the OUCSSPortalADFLibrary. The action of the method generates the HTML string of the new page to display in the same window. I tried what follows but failed to make it work.

    In my jsff:

    < af:commandButton action = "#{pageFlowScope.MyManagedBean.generateHtml}" id = "cb1"/ > "

    < af:outputText value = "#{pageFlowScope. . "{MyManagedBean.html}" id = "ot1" escape = "false" / >

    In my bean managed:

    SerializableAttribute public class MyManagedBean extends SSBaseManagedBean {}

    private String html;

    public void generatehtml() {}

    generate the html string

                   html = "<! "" DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional / / as"------"http://www.w3.org/TR/html4/loose.dtd------" > < html >... < / html > "; " "

    }

    public String getHtml() {}

    Returns the html;

    }

    }

    Kindly help/tips how to operate or any other way.

    Thank you in advance.

    Hi Lena,.

    ADF managed beans, you can use ExtendedRenderKitService to call the javascript. Something like window.location.href or similar can be used to replace the URL data: text / html mentioned in response format.

    Kind regards

    SAI

  • How to get the value of varStatus in managed Bean

    Hi all

    I use jDeveloper 11.1.2.4 version.

    I had a table with table with departments view object. I added an extra column to the table to display the serial numbers of the lines like this.

    < af:table...

    varStatus = 'vs' rowSelection = "multiple" id = "t1" binding = "#{ReferenceBeans.departmentTable}"> "

    < af:column id = "c5" headerText = "varStatus" >

    < af:outputText value = "#{vs.index + 1}" id = "ot1" binding = "#{ReferenceBeans.varStatus}" / > "

    at the bean, I get all the values of the selected line, but I don't get the varStatus value of the column.

    If I use

    Object varStatus is getVarStatus () .getValue ();.

    System.out.println("varstatus::"+varStatus);

    That's the impression first value only, but not the values of the selected line.

    varStatus.jpg

    How to get the varStatus value in the bean selected lines.

    Best regards

    Claude Reynier.

    You can get the index of the line of the ViewObject.getRangeIndexOf (row) method. Something like this:

    empIter.getViewObject () .getRangeIndexOf (currentRow)

    example:

        RowKeySet selectedEmps = getTable().getSelectedRowKeys();
        Iterator selectedEmpIter = selectedEmps.iterator();
        DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
        DCIteratorBinding empIter = bindings.findIteratorBinding("EmployeesView1Iterator");
        RowSetIterator empRSIter = empIter.getRowSetIterator();
        while (selectedEmpIter.hasNext())
        {
          Key key = (Key) ((List) selectedEmpIter.next()).get(0);
          Row currentRow = empRSIter.getRow(key);
          System.out.println("FirstName" + currentRow.getAttribute("FirstName") + "  - Row Index= " + (empIter.getViewObject().getRangeIndexOf(currentRow) + 1));
        }
    
  • How to get the files to and from the host

    Is there something that I can read which explains how to get the (ftp, memory stick or other) files to and from the host?

    Sorry if this is a noob question, I looked but could not find something specific...

    There are many ways of doing so:

    1 activate not supported ssh and scp use

    2. use VI Client access to your storage space on configuration files and server transfer

    3 configure the iSCSI or NAS to deal directly

  • How to get the computer to boot from a USB?

    I use offline windows Defender. Start the computer to the USB you need. How can I get the computer set up to do this?

    my computer is a HP Pavilion e9100z.

    Thanks for any help

    Hello

    We will determine if your PC can not even boot from USB devices.  Plug the USB and turn on your PC.  When you get to the HP splash screen, then start typing the escape key to bring up a boot selection menu. If you do not see the USB device then your PC can't boot from a USB device.

    If your PC does support booting from a USB device and then read this MS post article.

    You always have the option to start Windows Defender from a CD or a DVD.

  • How to get the Installation of Vista from Toshiba disk?

    I work with Microsoft technical support to solve a security problem on my Satellite Pro A210 and were now required to use a Vista installation disc.

    Microsoft says that I am entitled to an installation of the original provider of my kit disc - Toshiba. But we're not happened with my laptop - only a recovery disc has been provided.

    How can I go on the acquisition of an installation of Vista from Toshiba disk?

    Kind regards

    Kevin C.

    With Toshiba laptop, you'll get the Toshiba CD/DVD facilities only.
    This recovery media is designed for your laptop only.

    Installations from Microsoft Vista disc is not given and there is no way to get it from Toshiba.

    Microsoft can offer that you support if you only use Microsoft installations CD. Using this disk, you can install and repair Vista on each portable office/computer option. Unfortunately with the restore disc it will not work.

  • ASP / PHP pages: how to get the streaming of information from an XML file?

    Hi all

    I use Adobe Flash Media Streaming Server 3.5 but I can't find any file output (an XML fx) that I can pull info from and use it on my site via a script PHP or ASP. It might be nice - website - to retrieve the info like 'attending of online users', ' running / streaming State "(online or offline) and other relevant information on streaming, so I on the site Web can I view how many who are online when a webtv event is streaming.

    I see the news when I connect to the web admin for FMS, but I need a solution that can work with ASP or PHP.

    Simply, I can't find any file / address for this type or exit out of FMS - can you help me?

    Thank you

    Kind regards

    Jens

    What is rtmp url to which you are connected? RTMP://servername/live/Server1 or just rtmp://serverName/live?

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to get the element selected listfield and goto next page?

    Assalaamualikum

    I try parsing the XML from a url and show in listfield.

    problem:

    How to get the selected item and passing the variable and than goto next page?

    my code:

    package parsepack;

    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Vector;

    Import javax.microedition.io.Connector;
    Import javax.microedition.io.StreamConnection;

    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.DrawStyle;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.Manager;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ListField;
    Import net.rim.device.api.ui.component.ListFieldCallback;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.container.VerticalFieldManager;
    Import net.rim.device.api.xml.parsers.DocumentBuilder;
    Import net.rim.device.api.xml.parsers.DocumentBuilderFactory;

    to import org.W3C.DOM.document;
    Import org.w3c.dom.Node;
    Import org.w3c.dom.NodeList;

    extends xmlparsing public class UiApplication implements ListFieldCallback, FieldChangeListener
    {

    Public Shared Sub main (String [] args)
    {
    xmlparsing app = new xmlparsing();
    app.enterEventDispatcher ();
    }

    public long mycolor;
    Connection _connectionthread;
    private static ListField _list;
    private static Vector listElements is new Vector();.
    public display display = new MainScreen();
    MainManager VerticalFieldManager;
    VerticalFieldManager subManager;

    public xmlparsing()
    {
    Super();
    pushScreen (screen);

    final Bitmap Imagearriereplan = Bitmap.getBitmapResource ("blackbackground.png");

    mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR)
    {

    public void paint (Graphics graphics)
    {
    graphics.drawBitmap (0, 0, Display.getWidth (), Display.getHeight (), Imagearriereplan, 0, 0);

    Super.Paint (Graphics);
    }

    };

    subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR)
    {
    protected void sublayout (int maxWidth, maxHeight int)
    {
    int displayWidth = Display.getWidth ();
    int displayHeight = Display.getHeight ();

    Super.sublayout (displayWidth, displayHeight);
    setExtent (displayWidth, displayHeight);
    }
    };

    Screen.Add (mainManager);

    _list = new ListField()

    {

    public void paint (Graphics graphics)

    {
    graphics.setColor ((int) mycolor);
    Super.Paint (Graphics);

    }

    };
    myColor = 0x00FFFFFF;
    _list. Invalidate();
    _list.setEmptyString ("* only supplies not available *", DrawStyle.HCENTER "");
    _list.setRowHeight (50);
    _list.setCallback (this);
    mainManager.add (subManager);
    listElements.removeAllElements ();
    _connectionthread = New Connection();
    _connectionthread. Start();
    }

    protected boolean navigationClick (int status, int time)
    {
    Try
    {
    Here, go to another screen if you need.

    }
    catch (System.Exception e)
    {
    System.out.println ("Exception:-: navigationClick()" + try ());
    }
    Returns true;
    }

    private class login extends thread
    {
    Public connection()
    {
    Super();
    }

    public void run() {}
    Doc document;
    StreamConnection conn = null;
    InputStream is = null;
    try {}

    Conn = Connector.open (StreamConnection) ("http://ec2-54-248-241-248.ap-northeast-1.compute.amazonaws.com/koperasi-akr-trial/cgi-bin/gw-pinjama...

    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance ();
    docBuilderFactory.setIgnoringElementContentWhitespace (true);
    docBuilderFactory.setCoalescing (true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder ();
    docBuilder.isValidating ();
    is = conn.openInputStream ();
    doc = docBuilder.parse (is);
    doc.getDocumentElement () .normalize ();
    List of NodeList = doc.getElementsByTagName ("ID");
    for (int i = 0; i)< list.getlength();="" i++)="">
    Node node = list.item (i) .getFirstChild ();
    listElements.addElement (textNode.getNodeValue ());
    }
    } catch (Exception e) {}
    System.out.println (try ());
    } {Finally
    If (is! = null) {}
    try {is.close ();
    } catch (IOException ignored) {}
    } If (conn! = null) {}
    Try {conn.close () ;}
    catch (IOException ignored) {}
    }} UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    _list. SetSize (listElements.Size ());
    subManager.add (_list);
    Screen.Invalidate ();
    }
    });
    }

    }

    ' public void drawListRow (list ListField, Graphics g, int index, int y, int w)
    {
    Your string = (String) listElements.elementAt (index);
    int yPos = 0 + y;
    g.drawLine (0, yPos, w, yPos);
    g.drawText (, 5, 15 + y, 0, w);
    }

    public {get {Object (ListField list, int index)
    {
    Return listElements.elementAt (index);
    }
    public int indexOfList (String prefix, ListField list, int, string)
    {
    Return listElements.indexOf (prefix, string);
    }
    public int getPreferredWidth (ListField list)
    {
    Return Display.getWidth ();
    }
    public final void insert (String toInsert, int index) {}
    listElements.addElement (toInsert);
    }

    ' Public Sub fieldChanged (field field, int context) {}

    }
    }

    Thank you.

    I told you that replace the navigationclick() method where initialize you your listfield

    as I think that changing your code and then answer me

    _list = new ListField()
    {
    protected boolean navigationClick(int status, int time)
    {
      Dialog.inform("hi");
      return true;
    }
    
    public void paint(Graphics graphics)
    {
    graphics.setColor((int) mycolor);
    super.paint(graphics);
    }
    };
    
  • DVT:pivotFilterBar - how to get the selected values of the filter

    Hi all

    I have a question: how to get the selected values from the pivot table filter bar programmatically?

    I tried to use
    pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);
    but to the edge of the side DATA INCORRECTESdeclarations page, it seems that it will return the cached values.

    Environment: JDev 11.1.1.3.0 without tasks.

    Thank you
    Miroslaw

    Hello

    You can retrieve the value selected in the PivotFilterBar through the PivotFilterBar model, instead of dataaccess:

    Download the template of the bar pivot filter instance
    QueryDescriptior queryDescriptor = (QueryDescriptor) pivotFilterBar.getValue ();

    retrieve a list of criterion, each of them is used to fill each lov in the pivot filter bar
    ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion ();
    List criterionList = conjunctionCriterion.getCriterionList ();
    for (int i = 0; i)<_criterionList.size(); i++)="">
    AttributeCriterion = (AttributeCriterion) criterionList.get (i) criterion.

    _selected is the currently selected value
    Selected object = criterion.getValues () .get (0);

    System.out.println (_selected);
    }

    Hope that helps,
    Chadwick

  • How to get the value of a selected character unicode?

    Hi all

    How to get the value of a selected character unicode?

    The content property of a 'Character' InDesign object is a simple Unicode string. For access to the various characters is a basic javascript operation, and a google gives this as a good first result: http://www.w3schools.com/jsref/jsref_charCodeAt.asp

    Therefore, the value of a selected character unicode is

    App.Selection [0]. Characters [0].contents.charCodeAt (0)

  • How to get the FileSystemTree coordinates selected item?

    Hi can we idea me in how to get the coordinates of the itwn selected in a FileSystemsTree?

    THX

    g

    You should do something like this:

    var itemRenderer:DisplayObject = fileSystemTree.itemToItemRenderer (fileSystemTree.selectedItem) as DisplayObject;
    Contact information: Point = itemRenderer.parent.localToGlobal (new Point (itemRenderer.x, itemRenderer.y)) var;

    contact information is now an object point representing the coordinates of your itemRenderer in the global coordinate system.

  • How to get the date of end of week max and its rows of a table

    Hello
    Table [temp2]
     
       id          name        dt
      123        a             2-mar-2010
      124        b            1-feb-2010
      125        c             3-apr-2010
      123        a             13-mar-2010
      125        c             13-mar-2010
      123        a             12-feb-2010
     
    This table how to get this line by id - name (id and the name of the composite key) whose date is the date of last weekend (last Saturday).
    for example, suppose to have IDs 123 values date February 12, 2010, 13-mar-2010 this date falls on the last Saturday 13-mar-2010, how to get the value of the line on Saturday last for all the unique id and the name?

    So I wrote this but probably there a few traps...
    select id,name,dt from (select id,name,dt,max(dt) over(partition by id,name) as 
    max_date from temp2) t where dt=t.max_date and dt in ('3-apr-2010'
    ,'27-mar-2010','20-mar-2010','13-mar-2010')
    Here I have spent in the in clause 4 last weekend dates manually (although either has been calculated by programming) in front.
    Thank you

    Here's another option:

    SELECT     *
    FROM
    (
         SELECT     ID
         ,     NAME
         ,     MAX(CASE WHEN TO_CHAR(DT,'DY','NLS_DATE_LANGUAGE=ENGLISH') = 'SAT' THEN DT END) AS DT
         FROM     TEMP2
         GROUP BY ID, NAME
    )
    WHERE DT IS NOT NULL
    

    It is always useful to provide the following information:

    1. oracle version (SELECT * FROM V$ VERSION)
    2. examples of data in the form to CREATE / INSERT commands.
    3. expected results
    4 explanation of the expected results (alias "business logic")
    5. use.

     tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
  • How to get the selected DataGrid item?

    Hello

    I have a datagrid

    < mx:DataGrid = "10" XY = dataProvider "36" = "{acEmaillist}" width = "319" >
    < mx:columns >
    < mx:DataGridColumn headerText = "Full name" dataField = "cn" width = "150" / >
    < mx:DataGridColumn headerText = "Email" dataField = "mail" width = "150" / >
    < / mx:columns >
    < / mx:DataGrid >

    I want to select a name, click it, get the selected name and save it in a string variable. Please let me know how to get the selected name when I click it. Thank you very much.

    M

    This code can help.


    http://www.Adobe.com/2006/mxml"width ="100% ">

    Import mx.controls.DataGrid;
    Import mx.events.ListEvent;

    [Bindable]
    private var nameStr:String;

    public void getName(event:ListEvent):void {}
    var dg:DataGrid = DataGrid (event.target);
    nameStr = dg.selectedItem.cn;
    }
    ]]>



    Bob Smith
    [email protected]


    Ted Alan
    [email protected]


    Fred Tobs
    [email protected]








  • How to get the selected values from the shuttle

    Hello

    Please tell me how to get the values of the option chosen by the shuttle leading the list.

    Thank you

    Check out this link and that this might help you.

    Attack-shuttle leak problem

    Thank you
    -Anil
    http://oracleanil.blogspot.com/

Maybe you are looking for