Select First row in a table

Hi,
I have a page with two tables - Master-Detail. Upon first load of the page, I would like the first row in the master table got selected automatically, and so the detail table is displayed with the corresponding data for the master. I have implemented similar page before, and the first row always got selected automatically. But not sure why, for this page, none of the rows in the table got selected upon first load of the page. I have to manually highlight a row in the master table, then the detail table will display the corresponding data.
Any ideas?
Thanks.
-Mina

Yes, I did set the partial trigger. That's why when manually select the row on the master table, the detail table get refreshed. The problem is the first time entering the page, and not row get selected automatically in the master table. Here is the code snipplet of the detail table:
<af:table value="#{bindings.ItasLookupCodesVO1.collectionModel}"
var="row" rows="#{bindings.ItasLookupCodesVO1.rangeSize}"
emptyText="#{bindings.ItasLookupCodesVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.ItasLookupCodesVO1.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.ItasLookupCodesVO1Query.queryDescriptor}"
queryListener="#{bindings.ItasLookupCodesVO1Query.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.ItasLookupCodesVO1.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasLookupCodesVO1.collectionModel.makeCurrent}"
rowSelection="single" id="t2" partialTriggers=":::pc1:t1"
editingMode="clickToEdit" summary="Lookup Codes">
The table is a child of a panelCollection.
Any more ideas?
Thanks.
-Mina

Similar Messages

  • How to highlight the first row of a table

    When entering the form, how do I get the first row of the table to be highlighted when it has not been selected yet? There is already data in the table. Thanks.
    Allyson

    Any ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
    MyTableModel modelS = (MyTableModel)dataModel.get("S");
    jTable1 = new JTable(modelS);
    jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
    class MyTableModel extends DefaultTableModel {
      public MyTableModel(Object[] columnNames, int numRows) {
        super(columnNames, numRows);
      public boolean isCellEditable(int row, int column) {
        if (TableKey == 'S') {
          if (column == 6) {
            return false;
        if (TableKey == 'O') {
          if (column == 0 || column == 4 || column == 5) {
            return false;
        if (TableKey == 'P') {
          return false;
      return true;
    }Can anyone help? Thanks.
    Allyson

  • Dynamic Select of Row in a table in webdynpro Abap

    Hi,
      I have an requirement, I have an table  and a button, I need to select a row in a table based on button action.
    For example : in a table i have 3 rows. I am submiting a value in a button, I want to see that row highlighted for the value I am sending through button.
    Please let us know the code how to implement this.
    Thanks

    Hi,
    First you have to go to table and set its property "SELECTION MODE" to single or multi lead depending on ur need.
    Then in the ACTION of the button you can use the following code to get the values in the selected row.
    DATA:
         node to get table node for finding no. of rows
            lo_nd_one  TYPE REF TO if_wd_context_node,
         Get selected row for finding no. of rows
       it_table               TYPE        wdr_context_element_set,
         workarea to get selected row
            wa_table                LIKE LINE OF           it_table,
    To get the Selected line item into an internal table
      CALL METHOD lo_nd_one->get_selected_elements
        RECEIVING
          set = it_table.    " data in internal format
      IF it_table[] IS NOT INITIAL.
      type conversion for work area
        READ TABLE it_table INTO wa_table INDEX 1.
    if a row is present
        IF  sy-subrc IS INITIAL.
        Get the values of each attribute
          CALL METHOD wa_table->get_static_attributes
            IMPORTING
              static_attributes = wa_final.       "<Selected data in work area.>  ---> this will have your data
        ENDIF.
    Here wa_final is the work area which is of your table fields type.
    This wa_final will have the selected row.

  • Enable Buttons after selection of row in a table

    Hi All
    Could any one give me help in this. I have a table, in table tool bar some buttons are there. at first time buttons are in disable mode, when user select any row in the table the buttons should be in enable mode. how to do this? help me
    Thanks,
    kris.

    hi,
    for table you have lead select action. you can write the code in this ction method to enable and disable the buutons based on the lead selection.
    or you ca alsoput your code in modify view and check if the instance of element is bound then enable else disable,
    lo_element = lo_node->get_element(). Lo_element will be bound only if there is a lead selection in the table.
    if lo_element is bound.
    enable the buttons.
    else.
    disable the buttons.
    endif.
    Regards,
    Madhu

  • Af:inputListOfValues popup : selecting first row

    Hi,
    Is there a way to select first row inside lov popup, the by default behaviour is it selects the rowHeader rather than row itself.
    When the lov popup is opened , there is no focus on table resides in the popup
    - to focus on table, user has to press down arrow key - which will just focus on rowHeader and not the actual row itself
    - to focus row for currently selected rowHeader user has to press right arrow key which will then select the table row itself
    its cumbersome everytime when you open lov and do these extra steps to just to select a value from lov
    any ideas?
    Thanks,
    Dev

    so, why it supports keyboard navigation at all? either support full features or nothing. the fact that user can use up/down arrow keys which selects rowHeader of every row , rather than actual row
    regarding "Search and Select : " it could be anything it has nothing to do with row selection,
    Thanks,

  • Unable to select any row(s) in table/ALV

    Hi ,
    I am having a problem while selecting a row in a table/ALV.
    I am displaying data in a table which is NOT set to 'Initialize lead selection' in the context.When it is displayed and I try to select a row the row does not get selected(highlighted) in the view.
    However,I am able to perform tasks on 'Onselect' event on the rows.Just that its not getting highlighted neither in table nor in ALV.
    What could be the reason for this ? I do not want the context element to be set as 'Initialize lead selection' as that would highlight the first line of the table when the view is rendered first time.
    Thanks for your help,
    Sandip.

    hi sandip,
    Try this method
    lo_table_sett  TYPE REF TO if_salv_wd_table_settings.
    lo_config_tab TYPE REF TO cl_salv_wd_config_table.
    lo_config_tab = lo_ref_interface_controller->get_model( ).
    lo_table_sett   ?= lo_config_tab.
    lo_table_sett ->SET_SELECTION_MODE( value ).
    value- '00' for auto
             '02' for single
             '04' for multi
             '06' for none
             '07'  for singleNolead
             '08' for multi Nolead
    Regards,
    janakiram

  • Not displaying first row in the table

    Hi
    I created web dynpro application. In that table,,
    Cardinality -
    0 to n
    Selection -
    0 to n
    public void wdDoInit()
        //@@begin wdDoInit()
         wdContext.currentLeaveElement().setLocation("1");
         for (int i = 0; i < EMP.length; i++)
                      IPrivateEtrecLeaveEligView.ILeaveElement element = wdContext. createLeaveElement();
                    element.setDepartment(EMP<i>[0]);
                    element.setLeaveType(EMP<i>[1]);
                          element.setYear(EMP<i>[2]);
                      element.setTimeSpan(EMP<i>[3]);
                      element.setNumofdays(EMP<i>[4]);
                   element.setLevel(EMP<i>[5]);
              wdContext.nodeLeave().addElement(element);
        //@@end
    In tha last declaration,,,,,,
    private static final String EMP[][] =
          { "Supply Chain", "Annual Leave", "2008", "Yearly", "20", "JC-16 Manager grade"},
         { "Finance", "Sick Leave", "2008", "Yearly", "23", "WL-2A"},
         { "Brands & Development", "Monthly Leave", "2008", "Monthly", "23", "WL-4A"},
         { "Supply Chain", "Annual Leave", "2008", "Yearly", "23", "WL-5A"},
         { "Finance", "Sick Leave", "2008", "Yearly", "23", "WL-6A"}
    But its not taking first row data in the table....
    will any one please help me where i did mistake.
    Regards
    Sushma

    Hi Sushma,
                     there is no problem in the below code :
    for (int i = 0; i < EMP.length; i++)
    IPrivateEtrecLeaveEligView.ILeaveElement element = wdContext. createLeaveElement();
    element.setDepartment(EMP[0]);
    element.setLeaveType(EMP[1]);
    element.setYear(EMP[2]);
    element.setTimeSpan(EMP[3]);
    element.setNumofdays(EMP[4]);
    element.setLevel(EMP[5]);
    wdContext.nodeLeave().addElement(element);
    //@@end
    but in the doinit method u have written this line  :
    wdContext.currentLeaveElement().setLocation("1");
    which means that , u have create a LeaveElement some where before this line and thats the reason the first row of ur table is empty.
    if the location value is same for all rows(for all leave element) then in the for loop set the value of the location as shown below:
    element.setLocation("1");
    Hope it helps
    Thanks and Regards

  • Selecting multiple rows in a table

    Hi All,
    I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
    please provide me solution for this.
    Thanks & Regards,
    Sreelakshmi.

    HI
    Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
      for(int i=0;i<wdcontext.nodeModelNode.size;i++)
        if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
               String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
               String  address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
               String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
            Create a method for the Table Property onLeadSelect() where you can open a popup window
             Create a value node and with attributes same as Table attributes and then set the values of the table
             to the value node attributes.
    Thanks

  • Select all rows in af:table

    Hi,
    I need to select all rows in af:table, not only on current page.
    I have following code on custom select all action:
    getTable2().getSelectionState().addAll()and on button that needs to perform some action on selected rows I have this code
            Set selectedRowSet = getTable2().getSelectionState().getKeySet();
            if (!selectedRowSet.isEmpty()) {
                Iterator it = selectedRowSet.iterator();
                while(it.hasNext()) {
                    Key key = (Key)it.next();
           }selectedRowSet.iterator() method throws java.lang.ClassCastException: oracle.jbo.Key.
    When I select rows with af:tableSelectMany, which is inside selection facet and selects only rows on current page, this works fine.
    Any ideas?
    Thanks

    Hi,
    you can only access those data that is queried and part of the CollectionModel to the time you select all
       RichTable _table = employeesBackingBean.getEmployeeTable1();
       RowKeySet rks = new RowKeySetImpl();
      CollectionModel model = (CollectionModel)_table.getValue();
      int rowCount = model.getRowCount();
          for (int i = 0; i < rowCount; i++) {
               model.setRowIndex(i);
               //note that in the simple POJO case, the row key is the same
               //as the index. However, it would be wrong to just rely on this
               //because other models or custom table models my return a more
               //comples key. Therefore we iterate over the available rows to
               //obtain the keys.
               Object key = model.getRowKey();
               //add the row keys to the RowKeySet to mark selected
               rks.add(key);
       _table.setSelectedRowKeys(rks);
       AdfFacesContext.getCurrentInstance().addPartialTarget(_table);Frank
    Frank

  • Select a row from a table and throw an url

    Hi experts,
    I'm trying to select a row from a table in Visual Composer. What I need to do it's to click over this row and throw an Url. At the moment, I've added a column with a Pushbutton with the formula to show the link; it works fine. But I need to do it without buttons just selecting the row.
    Is there anyboby who knows about that?
    Thanks a lot.
    Belen

    Hi
    To do this you will have to use a data store and a guard condition on the line which is triggered by the select action. You need to store a value in the data store each time a select action is performed. The guard condition should check for this and only perform the action when the value in the data store is greater than 0.
    Jarrod Williams

  • Select multiple rows from dual table

    Is it possible to select multiple rows from dual table using a single select statement.
    i.e., i want the out put to be
    column_name
    1
    2
    3
    4
    Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AM

    Aside from the fact you're responding to an old thread...
    1002424 wrote:
    While using CONNECT BY, I see it always leave behind one row.
    Suppose I have a condition based on which I have to generate constant rows like
    SELECT 1 FROM DUAL WHERE ROWNUM < N;
    Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
    SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
    no rows selected
    SQL>

  • Easy Question:Select many rows from a table and execute BAPI for these rows

    Hi Experts,
    I have created one WD project. The WD project fetches some records of backend using BAPI and displays in a table. I have to select some rows from the table and then execute BAPI for selected rows.
    How I can select multiple records from the table and then execute another BAPI for selected rows.
    Regards,
    Gary

    Hi,
    In the Node which you binded to the table create one more attribute of type boolean.
    For example your node is as below:
    //Table Node
    TableNode
    > Att1
    > Att2
    > isSelected(boolean) - Newly created attribute for this requirement.
    //Result Node contains the elements selected in TableNode
    ResultNode
    >Att1
    >Att2
    Now in the table create one more Column with Checkbox as tablecell editor. Now bind this boolean attribute to that check box.
    Now in the code you can get the selected rows by user as below:
    for(int i=0;i<TableNode().size();i++)
      if(wdContext.nodeTableNode().getTableNodeElementAt(i).getIsSelected()==true)
        IPrivateTestView.IResultNode element=wdContext.createResultNodeElement();
        element.setAtt1(wdContext.nodeTableNode().getTableNodeElementAt(i).getAtt1());
        element.setAtt2(wdContext.nodeTableNode().getTableNodeElementAt(i).getAtt2());
       wdContext.nodeResultNode().addElement(element);
    Regards,
    Charan

  • Selecting multiple rows of a table

    Hi Forum,
    How to select multiple rows of a table at a time? Please help me..
    Thanks
    Swapna

    Hi Swapna,
    To select more then one row in table, just set the selectionmode property of table to 'multi' or 'auto' and also change the selection property of the node (to which table is binded) to  0:n.
    I hope it helps.
    Regards
    Arjun
    Edited by: Arjun on Feb 4, 2009 11:52 AM

  • Select discontiguous rows in a table with the keyboard

    I am using jdk 1.3.1 and have tried this on 1.4 as well. I don't seem to be able to select discontiguous rows in a table using the keyboard. I can Ctrl-click with the mouse to do this but can't find a way to do this with the keyboard. I searched and found somebody asked this same question before and the reply was it works in 1.3.1. I am not seeing this. What could I be missing? The Ctrl-Up and Ctrl-Down keys don't do anything and neither does the spacebar.

    I'm pretty sure you can't do this using the standard JTable interface.
    You might be able to write your own keyboard listener and fake focus events for up&down arrow, but making this work seamlessly with JTable seemss like it would not be trivial.

  • Pie Chart Only Displays the Data of the First Row of the Table

    Hi Experts,
    I have a problem that the pie chart will not change when click on a second row or other rows on the table. It only displays the data of the first row of the table. How can I set up to make it reflect on any rows when I click the table? Please help, and I would very appreciate that.
    Thanks,
    -Don

    Thanks a lot for your response. I have realized that the pie chart behaves that way, so I just use the filter to see the specific data that I want. Also, you can drag the row and drop it right at the first row to see the data in the pie chart.

Maybe you are looking for

  • How do I get an actor to wait for its nested actors to stop running before stopping itself?

    I'm developing a series of projects that are based on the Actor Framework and my actor dependency hierarchy is starting to get some depth. One of the issues I'm facing now is making sure that each actor will only stop running (and signal this via a L

  • Audio Jack of my HP Envy 4 is not working anymore

    Hi all,             I have purchased HP Envy 4 just a 4 months ago and now something worong with its audio jack for headphone and its not working anymore. The hardware profile for this audio jack shows no error but its still not working. Is there any

  • Calculating glyph length

    Hello, I want to know if there is a possiblity to calculate the length of a given String with all Font-parameters given as well without drawing the glyph on a screen device. I need to find out the length of the String in pixels in order to calculate

  • Balance sheet adjustment

    Hello, How to do balance sheet adjustments for accounts for which business area is not determined in ECC 6.0?

  • SERVER COMPONENT id=UTLRP_END

    Any idea on why the alert log file comes with the following message?? replication_dependency_tracking turned off (no async multimaster replication found) Starting background process QMNC QMNC started with pid=15, OS id=19502 Wed Apr 11 11:07:54 2007