How to select a row dynamically in a TreeTable?

I am trying to select a row in a treeTable when the user right clinks on a row. how I do this? I tried giving the following. I don't see visually that the row is selected. What I try to achieve this?
....me.getX() here "me" is the MouseEvent. I see the selRow has the right value too but can' tsee it visually the selected row.
int selRow = treeTableData.rowAtPoint(new Point(me.getX(),me.getY()));
treeTableData.setRowSelectionInterval(selRow,selRow);
treeTableData.repaint();
treeTableData.updateUI();
component = me.getComponent();
popEditor.show(me.getComponent(), me.getX(), me.getY());

use
setRowSelectionInterval(int fromRowIndex, int toRowIndex);example if your table has 10 rows then u want to select the rows from 4 to 8 then use
setRowSelectionInterval(3, 7);if you want to select just one row for example 5 then use
setRowSelectionInterval(5, 5);

Similar Messages

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • How to select multiple row in ALV report

    Hi friends,
    1. How to select multiple row in ALV report
                   ( How to set tab in ALV report and want to select multiple line.)
    Thanking you.
    Subash

    Hi Sahoo,
    If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
    in layout structure you will find field SEL_MODE
    pass :
    LS_LAYOUT-SEL_MODE = 'A'.
    In PAI.
      CALL METHOD GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = T_ROWS
          ET_ROW_NO     = T_ROWID.
    Hope these will solve your problem.
    Regards,
    Kumar M.

  • How to select a row in Jtable at runtime

    how to select a row in Jtable at runtime.

    use
    setRowSelectionInterval(int fromRowIndex, int toRowIndex);example if your table has 10 rows then u want to select the rows from 4 to 8 then use
    setRowSelectionInterval(3, 7);if you want to select just one row for example 5 then use
    setRowSelectionInterval(5, 5);

  • How to select a row in datagrid by checking the check box in that row

    how to select a row in datagrid by checking the check box in that row.
    Im using <html:checkbox> tag, and also a VO which is in request scope. i wanna display the values in the VO in a row and corresponding to this i want a checkbox..
    Thanx in advance
    Message was edited by: me
    Hemanth@SA
    Message was edited by:
    Hemanth@SA

    Hello,
    I got the solution:
    final int pRow = row;
    final int pCol = column;
    final JTable myTable = mytable;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    myTable.requestFocusInWindow();
    myTable.changeSelection(pRow, pCol, true, true);

  • How to select multiple rows from List Of Values

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

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

  • How to select a row in a single-select table view?

    Hello folks,
    I have a table view with a 'details' button. When a row is selected and 'details' is pressed, the table view disappears and a form view is displayed (like the toggle button in PCUI). I have implemented this using a navigation link. When I press 'cancel' in the form view, another navigation link takes the user back to the table view.
    My problem is, when the table view reappears, there is no row selected (the row that was selected previously, is de-selected). How do I make sure that the row remains selected?
    I tried using the collection_wrapper->mark() method in the inbound plug of the table view, but it works only for multi-select table.

    Hi Masood,
    Thanks for your reply.
    I had already tried using MARK ( iv_index = lv_index ), but it did not work because the first statement in the MARK method is
      check ME->MULTI_SELECT = ABAP_TRUE.
    Mine is a single-select table. So, using the MARK of the iterator object, with either the IV_BO or the IV_INDEX parameter also does not work. Is there any other way for a table with single row selection?
    Thanks!!!
    Rohan.

  • How to select a row in LSMW

    Hi,
    I have a requirement to create new materials copying from exsting material.For this we have custom transaction which will display all the materials in a plant in the table cotrol.Now in this table control i have to select a material based on the input file material.
    can any one please tell me how to select a particuler row in table control In lsmw.
    Thank you.
    CS Reddy.

    hi
    Using the read statement. y bcoz u r putting data in an internal table for a table control. so u want to retieve a particular row so use index position along with read statement.
    if it is useful,please reward points.
    Regards,
    satish

  • HOW TO SELECT ALL ROWS IN A MULTI SELECT TABLE!!!!!

    Hello
    I have a table with tableSelectMany component. how can I set the page to initially select all rows when first opened?????

    efffffttttttt? are you saying you will do an electronic funds funds funds funds funds transfer transfer transfer transfer transfer transfer to anyone who answers?
    What version of JDeveloper are you using - that is quite important in order to be able to give you an answer.
    What also might be useful is "please" and "thank you" instead of SHOUTING IN ALL CAPS THAT YOUR QUESTION IS IMPORTANT. Realizing that you asked this question over a weekend when most people dont sit and read the forum...
    You have a habit of saying all your questions are URGENT!!!!!! which is generally considered, um...., impolite.

  • How to select a row in Grid? no a cell

    Clict the grid, I want to select a whole row, not a cell
    and that the Cell of Grid  is readonly
    how to do? thanks

    Hi Tony,
    All you have to do to select a row in the grid is, after declaring the grid, add this line.
    objGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
    The above line will help you to select one row at a time in a grid.
    Satish.

  • How to select a row in JTable

    Hello,
    I have a problem selecting a row in a JTable.
    I use
    mytable.getSelectionModel().setSelectionInterval(row, row);
    to select a row, but after that this row is only highlighted. After calling this method I cannot change the selection using the arrow keys.
    Can anybody give me a hint, how I can get the row selected, so that I can use the arrow keys immediately after selecting the row?
    Any help is welcome.
    Thanks,
    Fritz

    Hello,
    I got the solution:
    final int pRow = row;
    final int pCol = column;
    final JTable myTable = mytable;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    myTable.requestFocusInWindow();
    myTable.changeSelection(pRow, pCol, true, true);

  • How to select multiple row of table using check box?

    hi,
             i am having table on view having first field as checkbox. what i want, when i click on checkboxes in multiple rows, and i click on any button i need to use those content to next view...
              my problem is if i select only one row , i can use onlead select property of table..but when i select multiple rows  through check box how should i read contents of table....?
    Plz solve it.
    Thanks,
    Saurin Shah

    Hello Saurin,
    You are right using LeadSelection you can select only 1 row at a time. You will have to make use of Selection for achieving this. First you will have to change the selection mode of the table to multiple & also change the selection property for the related context to 0..n . Please find a code extract which might help you. (However this facility is only available from SP 14.) The main part is using the set_selected method of if_wd_context_node.
    data: node_zcourse_details type ref to if_wd_context_node,
             node_course_assign type ref to if_wd_context_node,
             elem_course_assign type ref to if_wd_context_element,
             stru_course_assign type if_v_details=>element_course_assign ,
             item_popin_selected like stru_course_assign-popin_selected.
    "     navigate from <CONTEXT> to <ZCOURSE_DETAILS> via lead selection
    node_zcourse_details = wd_context->get_child_node( name = if_v_details=>wdctx_zcourse_details ).
    "     navigate from <ZCOURSE_DETAILS> to <COURSE_ASSIGN> via lead selection
    node_course_assign = node_zcourse_details->get_child_node( name = if_v_details=>wdctx_course_assign ).
    "     @TODO handle not set lead selection
    if ( node_course_assign is initial ).
    exit.
    endif.
    data elem_set type wdr_context_element_set.
    field-symbols <wa_elem> like line of elem_set.
    elem_set = node_course_assign->get_elements( ).
    loop at elem_set assigning <wa_elem>.
       <wa_elem>->set_selected( TRUE OR FALSE ). " Supply either TRUE/FALSE in here
    endloop.

  • How to select the row on right click.

    Hi,
    I want row selection when user right click on the table.
    Right now when user right click on table a pop up menu comes but no row selected at this time.
    Can any body tell how select the row when right click over the table.

    Hi,
    look at this thread:
    http://forum.java.sun.com/thread.jspa?threadID=501957&messageID=2374481
    L.P.

  • How to select migrated rows?

    Hi All,
    ANALYZE TABLE <table name> LIST CHAIN ROWS;
    it will collect information about both migrated and chained rows and store them into chained_rows.
    How can I select only rows having row migration problem from chained_rows table?

    So this won't be absolutely exact solution but probably you can try it.
    For these rows that are in chained_rows table you can simply calculate how much it takes using function vsize.
    for example SQL> create table x (a varchar(4000), b varchar(4000), c varchar(4000));
    Table created.
    SQL> insert into x values (lpad('a', 4000, 'a'), lpad('a', 4000, 'a'),lpad('a', 4000, 'a'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> analyze table x compute statistics;
    Table analyzed.
    SQL> select chain_cnt from user_tables where table_name = 'X';
    CHAIN_CNT
             1
    SQL> select vsize(a) + vsize(b) + vsize(c) from x;
    VSIZE(A)+VSIZE(B)+VSIZE(C)
                         12000As my block_size = 8k, obviously this row cannot fit into one block. Of course if your block size is 8k it doesn't mean that 8K row can fit into it,
    because there is a bit overhead in each block but I hope you understood the idea.
    And of course you have to look on your tables and watch if they have many long varchar columns, or simply very many columns that are filled with long values then of course these tables are more under suspection than these that have few short columns. Of course there is also question what are you planning to do if you find for example one such table?
    Do you plan to change block size?
    Do you plan to add another tablespace with different block size?
    Have you identified that row chaining is a big problem for you or you just feel that you have to eliminate all chained rows?
    Are you sure that eliminating chained rows will make your and your user's life better?
    Gints Plivna
    http://www.gplivna.eu

  • How to select only rows which column has a null value?

    Hi,
    I adds rows to my table with data field set to null;
    "INSERT INTO administrator.subzamowienia (subzamowienia.id_zamowienia,subzamowienia.id_transakcji,subzamowienia.nazwa_o,subzamowienia.nazwa_produktu,subzamowienia.ilosc,subzamowienia.nip_d,subzamowienia.data_realizacji) VALUES (administrator.id_zamowienia.curval,'0','PRAGA','Witaminy','2','43224','0');"
    Then i would like to update this field after a time with new date.
    To do this i need to know which rows has still data field set to null, i try sth like this but it doesn't work
    "SQL> select * from administrator.subzamowienia where subzamowienia.data_realizacji='null';
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='null'
    B&#321;&#260;D w linii 1:
    ORA-01841: (pe&#322;ny) rok musi by&#263; pomi&#281;dzy -4713 i +9999 i nie mo&#380;e by&#263; 0
    or
    "SQL> select * from administrator.subzamowienia where subzamowienia.data_realizacji='0';
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='0'
    B&#321;&#260;D w linii 1:
    ORA-01840: warto&#347;&#263; wej&#347;ciowa jest za krótka dla formatu daty
    how to choose this rows?

    Hi,
    VALUES (administrator.id_zamowienia.curval,'0','PRAGA','Witaminy','2','43224','0');I don't see null value...
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='null'Should be :
    select * from administrator.subzamowienia where subzamowienia.data_realizacji is nullNicolas.

Maybe you are looking for

  • Connection pooling and auditing on an oracle database

    Integration of a weblogic application with an oracle backend, Connection pooling, and auditing ,2 conflicting requirements ? Problem statement : We are in the process of maintaining a legacy client server application where the client is written in Po

  • IPhone 5 No Service Issue (Connected/Dropped Cellular) Help please :)

    Hi Apple Forums! I have a iPhone 5 (16gb) with Verizon Wireless. Last week, while at the hair dresser, i was using my iPhone just fine and than boom, no service. I looked outside and noticed it was a little dark and stormy so i assumed weather was me

  • Install photoshop elements on MacBook with no disc drive

    I purchased photoshop elements from a store.  My Macbook doesn't have a dvd drive to install the program.  How do I install from the internet?

  • Reduce size of all items and text

    I have 2 30-page A4 booklets in which I want to reduce everything by about 15% to increase white space by widening the top and outside margins. The booklets include text and some images, all of which I want to reduce proportionally. I thought of incr

  • Change Spot Color to CMYK?

    Is there a way in 8.1.4 Professional to change a spot color to another color space? I know colors can be convert in Print Production > Convert Colors but what I'm trying to do is change colors in a PDF from 0AA0 ( 100 magenta, 100 yellow) to 0A50 (10