The selected row and cursor/focus behavior of af table

Hi,
A selected row in the af table can be changed by clicking the row, then the background color of selected row will be changed.
But if I navigate to another row by pressing TAB or ENTER, the 'selected row' will not change.
Is there any way to change this behavior?
That is, if I use TAB/ENTER to move the cursor to another row, the 'selected row' will change accordingly.
Thank you~~

Hi,
actually I looked into this a while ago and the problem comes from the focus being in the input text field, not on the table. Using JavaScript I currently don't see how we can get a handle to the row to manually set it. I'll keep a note and file an enhancement request to see if the dev team has an idea
Frank

Similar Messages

  • How to set the Selected row and Column in JTable

    Hi,
    i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
    Praveen K Saxena

    Is that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
    myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column);

  • Delaying a function so ADF will get all the selected rows and run only 1 time ?

    Hello,
    I'm using JDeveloper 12.1.2.0.0.
    I have a group of functions that are executed after i click on one or more rows, which is called:
    public void onDimProjectSelect(SelectionEvent selectionEvent)
    Whenever i shift-click some rows (lets say, for the purpose of this example, that i shift-click the 1st row to the 5th row, so i shift select and i get selected the rows: 1,2,3,4 and 5).
    I did notice that what happens is that the function onDimProjectSelect will execute with the 1st row, and after it runs all the functions, it will run again the function onDimProjectSelect with the 1, 2, 3, 4 and 5 rows as it should in the first place.
    Why is this happening? I've tried to add a delay but i did not work.
    This is really a pain because its spending time executing a function without all of the rows that is suppose to have, so it will run again.
    I think the problem here is how ADF does the selections for the function but i don't know how to change it.
    Any ideia of why is this happening? What can i do to correct this?
    Regards,
    Frederico.

    Hey Frank,
    I mean that my function onDimProjectSelect has other functions inside that need to be executed so when i say that is runs all the functions i mean the functions that are suppose to execute when onDimProjectSelect is executed.
    Maybe the problem is my implementation approach but it was required to use the selection. But the funny part is that i select with the shift-click and he knows that, since it will run the function with all the rows that are selected but firstly he will execute the function with just the first selected row.

  • Make Select rows and columns as read only in Table Control

    Hi All,
    I would like to know how to make certain cells in a Table Control as display only.
    Table control should look like-(Those in bold are read only or in display mode)
    <b>Name1            Idno1 </b>         Address1
    <b>Name2            Idno2</b>          Address2
    <b>Name3            Idno3  </b>        Address3
    <b>Name4            Idno4</b>          Address4
    (Blank row to enter name idno and address)
    (Blank row to enter name idno and address)
    (Blank row to enter name idno and address)
    My table control should display all the above fields the way it is above of which first two colums and 4 rows should be read only,and the rest of the empty rows in the TC should be in change mode.i.e it must have provision to add new rows but not change the first two columns of existing rows.
    In short I am looking at solution to hide particular no of rows and columns and <b>not the entire column.</b>

    In the PBO of the table control loop. just write these statements
    NAME and IDNO considering the fields on the screen.
    and WA_TAB is the table work area being passed to the table control to display the rows.
    if not WA_TAB-NAME is initial and not WA_TAB-IDNO is initial.
    loop at screen.
    if screen-name = 'NAME' or
       screen-name = 'IDNO'.
    screen-input = <b>0</b>.
    modify screen.
    endif.
    endloop.
    endif.
    which means that the fields are disabled only if NAME and IDNO are not initial.
    Regards
    - Gopi

  • Getting the contents of the selected row in table webitem

    Hi,
    If i have a table web item in a web template,how do i get
    the selected row and row contents of the table.
    regards
    kaushik

    Just incase if you have not looked at the following documents:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6eb89190-0201-0010-89bf-ad46d1503ef9
    http://help.sap.com/saphelp_nw04/helpdata/en/99/08629bd3e41d418530c6849df303c9/frameset.htm

  • Is there any way to convert the selected rows to text in javascript??

    Hi All,
    I have place some word file to indesign cs 5.5 it is almost in one table, i need to separate the text from the real tables, Is there any way to convert the selected rows to text in javascript??
    If there is no way to make that, any one can help me to make a script to cut the selected rows and place it in privies pointer of the table to make it independent table and after that convert it to text ?

    This insert the rows contents after the table instead of being before:
    for (var r = app.selection.length - 1; r >= 0; r--) {
        for (var t = app.selection[r].rows.length - 1; t >= 0; t--) {
            for (var u = app.selection[r].rows[t].cells.length - 1; u >= 0; u--) {
                for (var c = app.selection[r].rows[t].cells[u].paragraphs.length - 1; c >= 0; c--) {
                    app.selection[r].rows[t].cells[u].paragraphs[0].move (LocationOptions.AFTER, app.selection[r].rows[t].parent.parent.storyOffset.parent.insertionPoints.nextItem(app.se lection[r].rows[t].parent.parent.storyOffset));
                    if (c != 0)
                        app.selection[r].rows[t].parent.parent.storyOffset.parent.insertionPoints.nextItem(app.se lection[r].rows[t].parent.parent.storyOffset).contents += "\r";
                if (u != 0) {
                    app.selection[r].rows[t].parent.parent.storyOffset.parent.insertionPoints.nextItem(app.se lection[r].rows[t].parent.parent.storyOffset).contents += "\t";
                else {
                    app.selection[r].rows[t].parent.parent.storyOffset.parent.insertionPoints.nextItem(app.se lection[r].rows[t].parent.parent.storyOffset).contents += "\r";
    for (var r = 0; r < app.selection.length; r++) {
        for (var t = app.selection[r].rows.length - 1; t >= 0; t--) {
            app.selection[r].rows[t].remove ();

  • Looping the selected row in JTable

    By default, when the first row in a JTable is selected and the up arrow is pressed, the first row remains selected. What I need in this case is the selected row to change to the last row in the table, in effect creating a circular selection. I might have missed something in the API, but is there a way to (easily) change the default selection behavior?
    I have thought of adding a listener that would select the last row when the up arrow is pressed and the first row is selected, but it seems like a hack. Searching the web has provided little to no help.
    Does anyone know of an elegant way to do this? ...or can anyone provide any links that could be of help?
    Thanks!
    Glenn

    Thanks for the help! I made some minor changes to the code you provided because it was not allowing me to select the first and last row (it just skips them). Also, the row that is selected must be in edit mode in order for it to work.
    Here is the modified code. For simplicity, I just put the operations for the up and down arrow in the same method.
      protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
                                          int condition, boolean pressed) {
        // if pressed == false, no looping is needed, so perform default action
        if (!pressed)
          return super.processKeyBinding(ks, e, condition, pressed);
        // up arrow
        if (e.getKeyCode() == KeyEvent.VK_UP) {
          // if the current selected row is 0 or less, then loop.
          if (this.getSelectedRow() <= 0) {
            // if the cell is in edit mode, stop editing
            if (this.getCellEditor() != null)
              this.getCellEditor().stopCellEditing();
            int rowCount = this.getModel().getRowCount();
            this.getSelectionModel().setSelectionInterval(rowCount-1, rowCount-1);
            return true;
          } else {
            return super.processKeyBinding(ks, e, condition, pressed);
        } else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
          // if the selected row is the last row, then loop
          if (this.getSelectedRow() >= (this.getModel().getRowCount() - 1) ) {
            // if the cell is in edit mode, stop editing
            if (this.getCellEditor() != null)
              this.getCellEditor().stopCellEditing();
            // loop the selection to the first row
            this.getSelectionModel().setSelectionInterval(0, 0);
            return true;
          } else {
            return super.processKeyBinding(ks, e, condition, pressed);
        } else {
          return super.processKeyBinding(ks, e, condition, pressed);
      }The above code does not attempt to restore the editor component when a new row is selected like the code you provided.
    Thanks again for providing such a thorough example!

  • Can you move a row in a DataGridView to the first row and move the other rows down to make room?

    I'm using a DataGridView (I call it "dg") to display a list of items. I want the user to be able to position the cursor on a row in the middle of the list then click a button to move that row to the top of the list (and move the other rows between
    the first row and the row being moved down one row to accomodate the new first row).
    Robert Homes

    Hello,
    If the DataGridview does not have it's DataSource set we can use the following logic
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim data = (From T In DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells.Cast(Of DataGridViewCell)() Select T.Value).ToArray
    DataGridView1.Rows.RemoveAt(DataGridView1.CurrentRow.Index)
    DataGridView1.Rows.Insert(0, data)
    End Sub
    If the DataSource is set then we need to do what was done above but against the underlying data rather than the DataGridView itself. The base logic can be found in
    the following article in LanguageExtensions.vb but please note the code there is for a different type of move yet the logic is still the same in the end.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • After upgrading to CF10, the selected row of my cfgrid is no longer passed on form post.

    I have a cfform which contains a cfgrid and prior to the 9 to 10 update, upon submission of the cfform, the selected row of the grid was passed/posted to my form action page as:
    __CFGRID__gridForm__renewalGrid
    This contained all the data from the selected row, I.e.:
    __CFGRID__COLUMN__=PROJECTID; __CFGRID__DATA__=T01081002AP; __CFGRID__COLUMN__=APPLICATIONS; __CFGRID__DATA__=PQFD; __CFGRID__COLUMN__=OWNERUID; __CFGRID__DATA__=HT2008; __CFGRID__COLUMN__=TEAM; __CFGRID__DATA__=Roberts; __CFGRID__COLUMN__=ROLE; __CFGRID__DATA__=AASBOAPMX; __CFGRID__COLUMN__=REGION; __CFGRID__DATA__=Southwest; __CFGRID__COLUMN__=EXISTING; __CFGRID__DATA__=K8045F; __CFGRID__COLUMN__=SOD; __CFGRID__DATA__=0; __CFGRID__COLUMN__=INITIALEMAILDATE; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=MESSAGEDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=SECONDEMAILDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=ESCALATIONDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=COMPLETEDBY; __CFGRID__DATA__=TH2878; __CFGRID__COLUMN__=COMPLETIONDATE; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MONTHPULLED; __CFGRID__DATA__=Jan2013; __CFGRID__COLUMN__=TOTALITEMS; __CFGRID__DATA__=2; __CFGRID__COLUMN__=RELIEVINGPSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=MODIFIEDBYTS; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MODIFIEDBY; __CFGRID__DATA__=T228Y8; __CFGRID__COLUMN__=CREATEDBY; __CFGRID__DATA__=KV3M36; __CFGRID__COLUMN__=CREATEDTS; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=NEWSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=DELEGATESTATUSNOTE; __CFGRID__DATA__=Access; __CFGRID__COLUMN__=STATUS; __CFGRID__DATA__=Completed; __CFGRID__COLUMN__=DATATYPE; __CFGRID__DATA__=Appl New
    After upgrading to CF10, and with no changes to the code, performing this same process, __CFGRID__gridForm__renewalGrid is still passed in the form scope to my action page, but now it is empty.
    I have not yet uninstalled CF9, so I brought it up on a different port, and I can run the same code as CF9 or CF10 and watch... in 9 the selected row is passed, in 10 it is empty.
    Is this a bug? Is there a work around? Please help.

    appears that apple has changed SMB code, and now its not possible login from windows on mac.
    i installed snow leopard and now works fine.
    apple is capable to make it run paying new license of smb code, but isnted of this, apple has created new protocol smbx and now, all others need to adapt your code to apple..
    bad movement.. i am thinking sell imac and no back to apple anymore..

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How to change the default color of the selected row

    hi all,
    I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
    thanks and regards,
    rpk

    The chart colors are being referred to *'palette.cxml'* file in these directories
    BI_HOME\web\app\res\s_oracle10\chartsupport
    BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
    you can change to your custom colors.
    Restart OC4J and PS to make the new ones work..
    Regards,
    Raghu

  • [UIX-ADF] How to get the selected row in my ViewObjImpl.java

    Hi,
    I have a uix table with a select column. I dragged my method from my ViewObjImpl
    and dropped it on the select column (radiobutton) as a submitbutton.
    If I run my application and select a row and press my button it always reads the first
    row. Why?
    I also tried including a param in my method, for the record id, but I dont know what to
    pass to my action binding as a param, where can I find the selected row?
    This is what I want, my method in ViewObjImpl.java
    public void doDelete() {
      ViewObjRowImpl pRow = (ViewObjRowImpl)this.getCurrentRow();
      try {
        pRow.setIsDeleted("Y");
        //this.executeQuery();
        this.getDBTransaction().commitAndSaveChangeSet();
        //this.validate();
      } catch(Exception e) { System.out.println("ERROR doDelete" + e);  }
    }It should set the IsDeleted field to 'Y' for the selected row. Perhaps im not doing the
    right thing for this?
    Can anyone give me some pointers?
    Thanks in advance
    Ido

    Thanks. So even if you select a row and then press the button, your method still only finds the first row?!
    Are you sure that the selection mechanism of your table is working? Your tableSelection fires a select event and your page contains a select handler?
    When you wire your page using drag and drop the binding should always use the default iterator of the ViewObject. And getCurrentRow() should always give you the current row of that iterator. So my feeling is that the selection doesn't take place.
    Or could it be that something resets the currency in the ViewObject from another place?
    Sascha

  • To capture the selected rows along with edited field contents in alv report

    Dear All,
             I do have requirement where, in alv report output one field is editable and need to save the content of the edited field along with the selected rows.
             For example If there are 10 records displayed in the alv output with 20 fields.
    Out of this 20 fields one field (say XYZ) is editable. Also i have already created a new pushbutton (say ABC) on alv output. Now in the alv output if we maintain some value in the field (XYZ ) for the 2nd and 4th record and select this two records, and when clicked on the pushbutton (ABC) it has to update the DB table.
          I am using the Func Module  'REUSE_ALV_GRID_DISPLAY'. 
          Your early reply with sample code would be appreciated.
    Thanks in Advance.

    HI Naveen ,
    There is an import parameter "i_callback_program" in the function module,
    plz pass the program name to it.
    Capture the command by passing a field of type sy-ucomm to "I_CALLBACK_USER_COMMAND ".  Check the returned command and
    and program a functionality as desired.
    u can try the event double_click or at line selection. there u can use READLINE command to c if the line has been selected.
    In case it is , process the code segment.
    Regards
    Pankaj

  • How to delete the selected rows with a condition in alv

    dear all,
    i am using the code in object oriented alv.
    WHEN 'DEL'.
    PERFORM delete_rows.
    FORM delete_rows.
    DATA : lv_rows LIKE lvc_s_row.
    data : wa_ROWs like LVC_S_ROW.
    FREE : gt_rows.
    CALL METHOD alv_grid->get_selected_rows
    IMPORTING
    et_index_rows = gt_rows.
    IF gt_rows[] IS INITIAL.
    MESSAGE s000 WITH text-046.
    EXIT.
    ENDIF.
    loop at gt_rows into wa_ROWs .
    if sy-tabix ne 1.
    wa_ROWs-INDEX = wa_ROWs-INDEX - ( sy-tabix - 1 ).
    endif.
    delete gt_sim INDEX wa_ROWs-INDEX .
    endloop.
    the rows to be deleted from int.tab gt_sim not in the alv display.
    all the rows should not be deleted if one of the field in gt_sim eq 'R'.
    how to check this condition

    dear jayanthi,
            ok if i am coding like that as u mentioned ,
              it will exit the loop when first time the field value is 'R'.
      if any of  the selected rows contains  field value 'R'. it shold not delete all the selected rows.
    as u suggested it will not delete after first time the field value is r.
    i am deleting it by tab index so,
    suppose if i am selecting the row without field value R say its tabix is 1.
      the next row with tabix 2 with field value R.
      it deletes the first row and exits , it should not delete the first row also.

  • Check box als column in a standard table, how to get the selected row

    Dear experts,
    I habe standard tablt with check box as column. Now I want to get the current selected row structure and do some changes. How could I solve this problem? till now I just know to get the structure via lead selection.
    lo_node->get_element().
    lo_element = lo_node->get_static_attributes ( static_attributes = ls_row).
    How could I get the element through check-box in stead of lead selection. Many thanks!

    check this code
    To get the selected row number
    data: lr_element type ref to if_wd_context_element,
              lv_index type i.
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
      lv_index = lr_element->get_index( ).
    Thanks
    Bala Duvvuri

Maybe you are looking for