Cell selectable in table

Hi everybody,
is it possible to make a single cell selectable in a  table in Web Dynpro for ABAP?
In simple ABAP it is possible and you can catch the coordinate while raising an event (button).
In Web Dynpro when I am using "input fields" instead of "text view" for the cell editor I can go into a cell, but it isn't selected.
By the way the table should not be editable ...
Thanks for all answers ...

Problem is solved.
Solution:
As described I have a context attribute "marked_cell" typed WDR_EXT_ATTRIBUTE_POINTER.
After selecting a cell my method behind the button could read the coordinates with the following code.
  DATA lo_el_context    TYPE REF TO if_wd_context_element.
  DATA ls_context       TYPE wd_this->element_context.
  DATA lo_marked_cell   LIKE ls_context-marked_cell.
  DATA lv_marked_column TYPE string.
  DATA lv_marked_row    TYPE string.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).
* get single attribute
  lo_el_context->get_attribute(
    EXPORTING
      name =  `MARKED_CELL`
    IMPORTING
      value = lo_marked_cell ).
* lo_marked_cell contains direkt the column
  lv_marked_column = lo_marked_cell-attribute_name.
* Additionaly we need the row number the user selected
  lv_marked_row = lo_marked_cell-element->get_index( ).

Similar Messages

  • Cell Selection & ALV Table (SALV_WD_TABLE)

    Hi Experts,
    is it possible to select  more than one cell (not row!) in an ALV Table?
    I changed the cell editor to cl_salv_wd_uie_input_field and set the whole table editable.
    Now I am able to select one cell, but what about multiple selections? In the Java world I found this one: TableSingleMarkableCell
    Sounds good - what about ABAP?
    And if there is no way with the ALV Table, how I might get the functionality with other components?
    Thanks for your help, have a great week!
    Hendrik
    Edited by: Gedicke, Hendrik on Jul 28, 2008 11:06 AM

    Hi Thomas,
    I tried to integrate the cell variant TableSingleMarkableCell. But I think the ALV table does not support this cell variant, or am I wrong? The runtime class is .CL_WD_TABLE_SNGL_MARK_CELL
    (see http://help.sap.com/saphelp_nw70/helpdata/EN/a5/b8fa41c915da6fe10000000a1550b0/frameset.htm)
    I will try to explain:
    When you want to use a cell variant, it is necessary to "add" it to a column. Therefore you can use the public method "ADD_CELL_VARIANT" of the class "CL_SALV_WD_COLUMN".
    This method has got a "value" import parameter which is a referencing the class "CL_SALV_WD_CV".
    The thing is that the only sub class of "CL_SALV_WD_CV" is "CL_SALV_WD_CV_STANDARD" and this means that the TableSingleMarkableCell is not supported.
    Or did I made a mistake? This is my last chance to use a cell selection with the alv component.
    Thanks & Regards,
    Hendrik

  • How to get the position of a selected cell in a table ?

    Hi,
    How can I get the position of a selected cell in a table or in a list multicolumn cmd ?
    Thanks.

    Invoke node >>> point to Row Column
    Ben
    Message Edited by Ben on 07-19-2007 03:14 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Point_To_Row_Column.PNG ‏22 KB

  • How to select adjacent cells in OpenOffice table

    After checking select block in the Edit menu, I click on an end cell in my table and drag along the section of a row to select the cells. Only the typing in these cells is selected. Yesterday I succeeded after about a dozen failures. Today the battle is on again. Does anyone have a possible solution please?
    Lill73

    LibreOffice is the way to go... swithed and never looked back.
    Same source code as OpenOffice but it works 10x better. They also have localization in many languages which is very nice, very well done.

  • Large Table Cell Selection (CS6)

    Hi
    I've a table 37 rows x 10 columns (no header or footer rows). Even without any formatting or content there seems a random limit on how many cells I can select at any one time. I seem to be able to select the top third of the rows. Below this it's very random what it will allow me to select.
    It won't allow me to merge rows together that straddle this two thirds point either.
    Is the table simply too big for Indesign?
    Thank you.
    Additional information: If I attempt to add rows (in the dialoue in the toolbar) it adds tham at the same point where it limits me to either selecting the cells above only... or below only.

    I don't do a lot of work with tables, but I've very successfully selected large tables over multiple pages in the past. One problem you might be encountering is that ID will not split a row across a frame or column break, so if there is a lot of data in a cell that might be a factor in your merge problem.

  • Selecting data from a cell in a table

    I want to be able select data from a cell in a table by looking up a specified header row and header column. For example, if my table has column headings of "Micro", "Emerging", and "Large" and my rows are labeled "Silver", "Gold", and "Platinum", how do I find the data in the table that is associated with column "emerging" and row "Platinum"?

    I thought that pointing to the User Guide was clear enough but it seems that it wasn't.
    Assuming that you have a spreadsheet with two sheets.
    The first one is named "jardin"
    it contains a table named "potager"
    a column header of this table is "carotte"
    a row header of this table is "longue"
    The cell of row "longue" of column "carotte" contains "cuite"
    The other sheet is named "garden"
    it contains a table named "potager"
    the column header of column 3 of this table is "carotte"
    the row header of row 5 of this table is "longue"
    In cell E10 of this table insert the formula :
    =INDIRECT("jardin"&" :: "&"potager"&" :: "&"carotte"&" "&"lapin")
    It will grab the value of row "lapin" of column "carotte" of table "potager" of sheet "jardin"
    This result is "cuite"
    I hope that now you are able to achieve your goal which we may write, in French :
    Les carottes sont cuites.
    Yvan KOENIG (VALLAURIS, France) lundi 7 juin 2010 16:59:52

  • How to get the position of a selected cell in a table without using the mouse event?

    Dear All,
        I have a question about table:After clicking the cell of a table, the cell is into the edit status. How to know the row number and column number of the cell, when I click a button?
       The link below is using the mouse down event:
       http://forums.ni.com/ni/board/message?board.id=170&message.id=260102&query.id=55917#M260102
       Is there any other way to do it? Having tried to using the "edit position"  property, but it seems not working well.
       Thanks for any suggestion.
    Hugo 
    Attachments:
    table.vi ‏17 KB

    It works well with the "edit position" property.
    See attached
    Attachments:
    table.vi ‏12 KB

  • F4 help for only a single cell in a table

    Dear All,
    The requirement here is to provide input help for only a particular cell in a table.
    This cannot be achieved by assigning search help to the attribute of the context as this will render all the cells of that particular column with F4 help. I tried applying the cell variant concept but only go up to a certain extent.
    I tried OVS as well. But for this to work we need to lead select the entry and then go ahead with F4, which will make is inconvenient for the user.
    I even searched the forum for some answers, but i could only go to a certain extent with the help of those.
    So, if anyone out there has any idea, please help me out. Also, if this is a repeat post by any chance (i think not) kindly provide me with the link of the original.
    Thanks and Best Regards,
    Pramod

    I am running older versions, so i didn't find any sample dynpros..
    You can try with this peace of code..nyways..
    DATA: LR_TABLE TYPE REF TO CL_WD_TABLE.
    DATA: LR_COLUMNS TYPE CL_WD_table_column=>tt_table_column.
    DATA: LR_COLUMN TYPE REF TO CL_WD_TABLE_COLUMN.
    DATA: LR_EDITOR TYPE REF TO CL_WD_VIEW_ELEMENT.
    DATA: LR_TEXT   TYPE REF TO CL_WD_TEXT_VIEW.
    DATA: BINDING TYPE STRING.
    DATA: LR_CELL TYPE REF TO CL_WD_TABLE_STANDARD_CELL.
    IF FIRST_TIME EQ ABAP_TRUE.
      LR_TABLE ?= VIEW->GET_ELEMENT( 'TBL_COMPONENTS' ).
      LR_COLUMNS = LR_TABLE->GET_COLUMNS( ).
      LOOP AT LR_COLUMNS INTO LR_COLUMN.
        LR_EDITOR ?= LR_COLUMN->GET_TABLE_CELL_EDITOR( ).
        BINDING = LR_EDITOR->BOUND__PRIMARY_PROPERTY( ).
        IF BINDING EQ 'RRSO.SOCOMP.POSNR' OR
           BINDING EQ 'RRSO.SOCOMP.MATNR' OR
           BINDING EQ 'RRSO.SOCOMP.KWMENG' OR
           BINDING EQ 'RRSO.SOCOMP.NETPR' OR
           BINDING EQ 'RRSO.SOCOMP.POPRICE' OR
           BINDING EQ 'RRSO.SOCOMP.QUANTITY'.
           LR_CELL = CL_WD_TABLE_STANDARD_CELL=>NEW_TABLE_STANDARD_CELL( VIEW = VIEW
                                VARIANT_KEY = 'TOTAL' ).
           IF BINDING EQ 'RRSO.SOCOMP.QUANTITY'.
             LR_TEXT = CL_WD_TEXT_VIEW=>NEW_TEXT_VIEW( VIEW = VIEW
                                                       TEXT = 'Total'
                                                       H_ALIGN = CL_WD_TEXT_VIEW=>E_H_ALIGN-FORCED_RIGHT ).
           ELSE.
             LR_TEXT = CL_WD_TEXT_VIEW=>NEW_TEXT_VIEW( VIEW = VIEW ).
           ENDIF.
           LR_CELL->SET_EDITOR( LR_TEXT ).
        ENDIF.
         LR_COLUMN->ADD_CELL_VARIANT( LR_CELL ).
      ENDLOOP.
    ENDIF.
    This code is for setting Text View as cell editor, instead text view u can take input field and use bind_value method to bind with another context attribute.
    Abhi

  • Is it possible to havedrop down lists in cells of a table?

    Hi -
    I have LV7.1 Dev Suite. I would like to create a table that I can have drop-down lists in any given cell of the table. Is there a way to do this with the "table" selection in the lists & tables section of the controls palette?
    Thanks for any help.
    Rob

    Another option that is a bit more extensible is to use a borderless VI launched when you click/context-click on the table. Use the mouse-down event to launch it. I don't have an exact example, but the attached context menu example (LV7.0) shows the basic principle and may be more what you want anyway. You can dynamically change the size and number of elements in the borderless VI to anything you want before you open it.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    Pop-Up_Menu.zip ‏402 KB

  • How to restrict the cell selection in JTable based on cell contents...

    Hi all,
    I have some problem related to table cell selection.
    I have a table that represets the calendar of some month and year.
    I have the restriction that at one time only one cell could be selected.
    Now i want the cell seletion like this,
    I want only those dates to be selected if that date is after 'today'.
    that is I want to restrict the selection of previous dates.
    how can i do this.
    I have overridden the table methods like this, still no use.
    table = new JTable(model) {
    setOpaque(false);
    setSurrendersFocusOnKeystroke(false);
    setRowHeight(20);
    JTableHeader header = getTableHeader();
    header.setOpaque(false);
    getTableHeader().setReorderingAllowed(false);
    setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    getTableHeader().setResizingAllowed(false);
    setCellSelectionEnabled(true);
    setFocusable(true);
    setBackground(new Color(247, 251, 255));
    setFont(newFont);
    public boolean isCellEditable(int row, int col) {
    return false;
    public boolean isCellSelected(int row, int col) {
    int r = getSelectedRow();
    int c = getSelectedColumn();
    String val = (String)getValueAt(r,c);
    Calendar cal = Calendar.getInstance();
    cal.set(currentYear+1900, month,Integer.parseInt(val));
    Date d = cal.getTime();
    Date currentDate = new Date();
    if (d.before(currentDate)) {
         return false;
    } else {
         return true;
    Someone please help...
    -Soni

    Try overriding the changeSelection(....) method of JTable.
    public void changeSelection(int row, int column, boolean toggle, boolean extend)
         if (d.after(currentDate)
              super.changeSelection(row, column, toggle, extend);
    }

  • [CS3/CS4 JS] How can you get the associatedXMLElement of a merged cell in a table?

    Hi!
    Inserting a table, and autotagging it, I get a table with a number of cell elements in the XML Structure.
    Selecting an item in the table, I can find the associated XML by the following line of code:
    app.selection[0].associatedXMLElement
    My problems begin when cells are merged. Then the associatedXMLElement for the cell returns null.
    How can I find the associatedXMLElement for a merged cell?
    Using the getElements makes no difference.
    app.selection[0].getElements()[0].associatedXMLElement
    (returns null)
    In the XML structure I can see that the merged cell is still associated to an XML Element, which becomes underlined and also referrs back to the cell, selecting it when double clicking the XML Element link in the structure.
    Is there no way to get to the xml element of a merged cell?
    I have tested in CS3 and CS4 as well, and they act in the same way.
    I also found a similar, unanswered, question from Anne-Laure Jallon in the "With CS3, some things have changed" ( http://forums.adobe.com/message/1105813#1105813 ):
    Hello,
    I'm working with VBscript.
    Is there a difference between cell.associatedXmlElement in CS2 and CS3?
    All my cells in CS2 had an associatedXmlElement.
    In CS3, my table has an associatedXmlElement, but all its cells don't (The value is Nothing)
    Is this a bug? Is it linked with XML evolution?   Thanks Anne Laure
    Adding some more info:
    I made a test, by selecting the XMLElement in the structure, and from that object finding the cell, and finding back to the assiciatedXMLElement:
    app.selection[0].getElements()[0].cells[0].associatedXMLElement
    Result: [object XMLElement]
    So that kind of "chain" works.
    But with the merged cell as only reference, I can't find its associatedXMLElement. Any ideas would be appreciated.
    Best regards,
    Andreas Jansson
    Message was edited by: Andreas Jansson

    In my opinion, locate a cell according to his content is not so effortable. What happens if contents of more than two cells are equals?
    I take xml elements of associated xml element of table and put them into an array.
    This array contains associated xml elements of every cell ordered by cell positions into table.
    Now, locate associated xml element of a cell based on its array position (index) is more reliable:
    var myCell_cell = app.selection[0];
    var myElement = myCell.associateXMLElement
    if (!myElement || !myElement.isValid)  {
         var table =  myCell.parent;
         var xml_tab = table.associatedXMLElement;
         var xml_cells_arr = xml_tab.xmlElements.everyItem().getElements();
         var idx = myCell.index;
         myElement = xml_cells_arr[idx];
    Alex ;-)

  • How do you change/adjust border width for all the cells in a table created in Pages?

    How do you change/adjust border width for all the cells in a table created in Pages?
    Note- I am trying to figure out how to create and format tables in the latest version of the Pages app on an iPad air (iOS 8.1.1.1) . Creating tables, adding or removing borders for individual/all cells in a table seems straight forward. However the default border style seems to be a heavy black line. How do I change this?
    I found the option add or remove borders for all/ individual cells in a table, however I can't find any option within style/format dialogue screens for changing colour or line thickness for table cells. Likewise I can't find any clear instructions on how to do this in apple help pages or support website
    Btw- I'm assuming  it is possible to customize/adjust the colour & thickness of selected lines in a table created in this app (it's fairly easy to do this word processing apps like MS Word) please let me  know if this is not actually possible in Pages

    They know perfectly well what they took out of Pages '09.
    Well over 90 features.
    Do you think you posting feedback is going to remind them of what they did?
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter

  • How can I use the property 'top left visible cell' in a table?

    Hi! I use a table in my program and I want to show the top left cell of the table every time when the user clicks a button .I don't know how to do this. If I use a multicolumnListbox I can select the property 'top left visivle cell'. Is it possible with a table ?
    Thanks for any help.

    Yes, it's possible - use the "index value" property to set top-left cell for arrays and tables. See example attached.
    Attachments:
    Index_value_ex.vi ‏30 KB

  • Problem in cell selection in JTable Java Swing

    hii
    I am using JTable that shows data from database. I have developed one functionality. I change one cell value and then select multiple cell. If I press F12 function key then it copies first selected value and past it to another selected cells. it is working properly but when I press F12 it sets the last selected cell in editable mode. I want that all cell which has been pasted should be selected (with default blue colour not in editing mode). I am using ListSelectionListener for JTable Cell Selection and KeyListener for F12 functionality.
    Please give some solution
    I can not override editCellAt Method because i have already extended JFrame. and i tried to do this with Jtable.getSelectedColumn and getSelectedRow it is displaying the same value, by this how can I get the particular area of selection means Row nd Column Selected.
    How would I know the current selection when user selects more than one cell???
    Thanks
    Edited by: 850979 on 11-Apr-2011 02:13
    Edited by: 850979 on 11-Apr-2011 03:59

    camickr wrote:
    Presumably, JTable installs an action for the F12 key that results in starting editing the last selected cell.
    There are no bindings for F12. See the [url http://www.camick.com/java/blog.html?name=key-bindings]Key Bindings listing. (...)
    Right.
    Of course it doesn't make sense that a F? key should invoke the editorI thought he meant F2 ("edit" on Windows), so that sounded natural.
    All KeyEvents are passed to the editor for the cell and the editor is psuedo invoked. That is, the caret is not placed on the text field used as the editor, but the character typed is added to the editor. You can then either use tab/enter to save the text or use the escape key to cancel the editing.Thanks for the explanation. I had never noticed (I kept on double-clicking my JTable cells when I wanted to edit them! :o)
    Of course it doesn't make sense that a F? key should invoke the editor, but this is a by product of all KeyEvents being forwarded so you don't have to have special Key Bindings for every character.You're right - as always.
    They (Sun) could have filtered out some of the keys such as those, though, because as noted by the OP the current behavior is unintuitive.
    To better control when the cell is editable based on the KeyEvent you can override the table with code like <snipped>
    As you suggested using a Key Binding will prevent this behaviour as well (but only for that key).Right again, but in this specific case that is acceptable (the developer wants to attach a specific behavior to a specific key only).
    OP here is an SSCCE of that second approach:
    public class TestKeyBindingsOnJTable {
        public static void main(String... args) {
            final DefaultTableModel dtm = new DefaultTableModel(new String[] {"A", "B"}, 0);
            dtm.addRow(new String[]{"A1", "B1"});
            dtm.addRow(new String[]{"A2", "B2"});
            dtm.addRow(new String[]{"A3", "B3"});
            JTable table = new JTable(dtm);
            table.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), "clear");
            table.getActionMap().put("clear", new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    dtm.removeRow(0);
            JOptionPane.showMessageDialog(null, table);
    }Edited by: jduprez on Apr 8, 2011 9:36 PM

  • Cell Hieght in table

    HI
      I am trying to print 6 line items in a single cell of a table  . I have put a loop and called the internal table in the cell . Upto 3 line items it prints perfectly but fails to give any output if it exceeds to more then 3 .
    My questions :
    1.    Is it possible to adjust Cell hieght in a table .
    2. Which option in smartform_trace I should select to overlapping Cell error message .
    Please help .

    Hi,
    You can define a paragraph in smartstyle and increase the gap there.
    Apply the same to that particular  row.
    If you want to debug.. Put a break point in the FM for the smartform.FInd out where that particular error message is being called by checking on the msg no.
    Edited by: sap_wiz on Jun 16, 2011 10:41 AM

Maybe you are looking for

  • How to get a pulse in a specified sampletime

    Hi. We are making a LabVIEW program to communicate with PumpWorks through DDE, and have established communication. The problem we can't find a solution to is this: We want to start the pump (TRUE) and stop (FALSE) it in LabVIEW. PumpWorks can only re

  • JCOP : can't set a new key set (put-key pb)

    Hi! I have this brand new cell phone out of the box , and I've been asked to install a javacard applet on it. I did it for other phones already, but I can't manage to install my app on this one. For new phones I have to install a new key set. That's

  • Action - Display smartform in PDF format

    Hi All, I have a requirement whereby on triggering of a print form action in crmd_order, the smartform should be displayed in PDF format and from there, user should be able to choose whether to save or to print the form. How can this be done? Thanks!

  • Text messaging Lumia 820

    Hi, I recently used my phone with global roaming. While overseas i cracked my screen.... DOH. Got it replaced (non genuine).... But now i recieve text messages in the home page preview but they dont appear in my inbox. I send messages and other peopl

  • How to call a FoxPro .prg file through SQL statement

    I created a program exclusive.prg which basically consisted of the statement USE my table exclusive. How can i call this function through a SQL statement using java