List UIBB - Access to cell editor for a certain table line possible

Hi,
I am looking for a way to access the cell editor of the last table line as I want to mark it as a special - summary - line.
I intend a similar approach like in WebDynrpo ABAP when accessing the node info and modifying the "CELL DESIGN" attribute like in the following code (copied from WD Comp WDR_TEST_TABLE, View CELL DESIGN, method FILL_CELL_DESIGNS) :
  data tab type IF_CELL_DESIGN=>Elements_Cell_Designs.
  data line type IF_CELL_DESIGN=>Element_Cell_Designs.
  data node_info type ref to if_wd_context_node_info.
  data attribute_info type wdr_context_attribute_info.
  data attr_value type WDR_CONTEXT_ATTR_VALUE.
  node_info = node->get_node_info( ).
  attribute_info = node_info->get_attribute( 'CELL_DESIGN' ).
  line-is_expanded = abap_true.
  line-is_leaf     = abap_false.
  line-key         = 'FIRST'.
  loop at attribute_info-value_set into attr_value.
    line-text = sy-tabix.
    concatenate 'Text #' line-text into line-text. "#EC NOTEXT
    line-cell_design = attr_value-value.
    insert line into table tab.
    line-is_leaf = abap_true.
    line-key = attr_value-value.
    line-parent_key = 'FIRST'.
  endloop.
  node->bind_table( tab ).
I suspect the method IF_FPM_GUIBB_LISTGET_DATA (or IF_FPM_GUIBB_LISTGET_DEFINITION) of my feeder class to be the right access point.
But unfortunately, I have not yet found out how to change the cell design for specific lines, only for whole columns.
Can anyone give me a hint here?
BTW: The "summary" line is not a sum of the lines above, but determined by backend logic, so not ALV-summary line for me.
Kind Regards

Hi,
A short update for all interested:
My current work around is to always set the lead selection to the summary line. It does in a kind "mark" that line as special as long as I cannot mark it using a different cell design.
How do I assure this?
I have implemented the following code in a redefinition of the method ADJUST_SELECTION:
*- alter selection
  DATA:
   ls_size TYPE rstabix.
  "get index of summary line
  ls_size-tabix = mo_collection->size( ).
  "change only if there are any cash conc. proposals
  IF ls_size-tabix > 0.
    "do FPM selection
    CLEAR: ev_lead_index, et_selection.
    ev_lead_index = ls_size-tabix.
    APPEND ls_size TO et_selection.
    "do BOL selection
    mo_collection->if_bol_bo_col_multi_sel~unmark_all( ).
    mo_collection->if_bol_bo_col_multi_sel~mark( iv_index = ls_size-tabix ).
  ENDIF.
The general downside is, that no other selection is possible!
The selection is always reset to the summary line with each roundtrip.
Waiting for a better solution...
Kind Regards,
Robert

Similar Messages

  • Creating a Cell Editor for a JTree

    Hi...
    I would like to be able to edit the nodes of a JTree dynamically, but I'm not sure how to do it. I have unsuccessfully tried to implement a celleditor by extended the DefaultTreeCellEditor. The editing works fine, but once the cell has been edited, I get a ClassCastException.
    I know that I need to get the edited value and then make appropriate changes to the DefaultMutableTreeNode object stored, but I am not sure where to do all this. I would really appreciate some tips on where to get the edited value entered, and how I can access the object being edited. Thanks.
    ..VJ..

    So, you have a big table whose cells each contain a little table. I assume you already have the little tables working correctly with cell editors and so on, and you want to write a cell editor for the big table. Correct?
    My problem with this is that I can't imagine how this would actually work in practice. Suppose I click on a cell in the big table; then the cell renderer displays the appropriate little table. At this point should I see one of the cells in that little table selected, and should I be able to use the Tab key to move around the little table? And if so, then I can't use the Tab key to move around the big table. Next, suppose I press F2 indicating that I want to edit the little table. What should change? Should I now be able to tab around the little table, whereas I couldn't before? And if so, how do I indicate that I have stopped editing the little table? Pressing Enter indicates to the little table's cell editor that its editing is finished, but how should I tell the big table's cell editor that its editing is finished?
    Perhaps if you can answer this, you may have a better idea of how to solve your problem. Sorry I only have questions and not answers.

  • Cell Editor for a JTable within A JTable Cell

    My individual cells each contain a seperate JTable and I need to write a cell editor for it. I'm not really sure how to write one so if someone show me where I can find some useful examples of such a cell editor I would greatly appreciate it. Thank you for your time. :-)

    So, you have a big table whose cells each contain a little table. I assume you already have the little tables working correctly with cell editors and so on, and you want to write a cell editor for the big table. Correct?
    My problem with this is that I can't imagine how this would actually work in practice. Suppose I click on a cell in the big table; then the cell renderer displays the appropriate little table. At this point should I see one of the cells in that little table selected, and should I be able to use the Tab key to move around the little table? And if so, then I can't use the Tab key to move around the big table. Next, suppose I press F2 indicating that I want to edit the little table. What should change? Should I now be able to tab around the little table, whereas I couldn't before? And if so, how do I indicate that I have stopped editing the little table? Pressing Enter indicates to the little table's cell editor that its editing is finished, but how should I tell the big table's cell editor that its editing is finished?
    Perhaps if you can answer this, you may have a better idea of how to solve your problem. Sorry I only have questions and not answers.

  • Setting cell editor for individual cell in JTable

    Hi there,
    I want to provide individual cell editor for my JTable. Basically, my JTable shows property names and values. I want to show different cell editors for different properties.
    I followed the advice in this post:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=423318
    but I have a question:
    I looked at the code of DefaultCellEditor. It just has a single editor component (the one provided in the constructor), so all the methods use the same component and certain aspects are customized for the type of component. Again, there can be only one type of component at a time.The problem that I am facing is that I will have different components for different row/column of the same table. So how do I implement some of the methods (for example, getCellEditorValue()), when I have multiple editor components?
    Also, how do I commit changes made by the user?
    I am extremely confused.
    Someone please help!
    Thanks.

    Actually, that's what I am currently doing.
    Here is my cell editor class:
    public class ObjectPropertyEditor extends DefaultCellEditor
           public ObjectPropertyEditor()
              super(new JTextField());
              Vector list = new Vector();
              list.add("Yes");
              list.add("No");
             myCombo = new JComboBox(list);
          public Component getTableCellEditorComponent(JTable table, Object value,
              boolean isSelected, int row, int column)
             String colName = (String)table.getValueAt(row,0);
             if(colName.equalsIgnoreCase("Leaf-Node?")) //if it is the "Leaf" property, return the combo box as the editor
                 return myCombo;
            else  //for all other properties, use JTextField of the super class
                return super.getTableCellEditorComponent(table,value,isSelected,row,column);
        private JComboBox myCombo;
    }The problem I have is that when I select a new item from the combo box, the new selection is not reflected in the tableModel. I don't know how I can achive that. I think I need the functionalities that DefaultCellEditor gives to its delegate when its constructor arguments is a combo box. But how can I get two different sets of functionalities (JTextField and JComboBox) ?
    Please help!
    Thanks.

  • JTree: How to set different cell editor for different tree Nodes.

    I have a JTree and I want to set different cell editors for different node depending on some condition. E.g. I want to set ComboBox as editor for leaf node but each leaf node will have its own set of data.
    Any help or pointer?
    Thanks in advance
    Sachin

    take there:
    http://www.mutualinstrument.com/Easy/FAQ/Tree/tree.html

  • Use of Cell Variant for a normal table

    Hi Experts,
    I have a requirement in a normal table where a row is first in read-only mode, then on click of edit button (given on that row),
    the row should become editable and also edit button should become invisible and two more buttons update/cancel have to be visible. How to achieve this using a cell variant for this normal table.
    A detailed reply would be appreciated.
    Thanks in Advance,
    Mirza Hyder.

    Hi Mirza,
    Cell variant property is used to chenge the cell property not for other.That means in one cell you want checkbox and in other cell you want textview like this you can change the property of cell as you want.
    Test this standard program WDR_TEST_TABLE in that test view cell varint for your understanding.
    Coming to your requirement.You can do in this way.
    Check in the below thread in that i gave code to make the entire row is editable when you click on the lead selection of row.I gave code for ALV.I hope that code is use ful for you.
    How to make all columns of alv editable
    To make tool bar buttons disable and enable:Write your logic in method handler of lead selection event like change the visible property of button to none.
    Note: In the event handler method you dont get reference of view.You only get reference of view in WDDOMODIFYVIEW only so take a global variable of type ref to if_wd_view and populate that global variable in method WDODIFYVIEW.So that you can access any view element in any method.
    For cell variant in ALV check this Article written by me.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0e7461d-5e6c-2b10-dda9-9e99df4d136d

  • Setting new cell variant for an alv table column

    Hi,
    I want to set a new cell variant for a column. Therefore I did the following steps:
    1. Create an object of CL_SALV_WD_CV_STANDARD
    2. SET_KEY( 'CELLVAR1 )
    3. set_cell_design([..]-goodvalue_medium )
    4. SET_EDITOR( lr_alv_input_field )
    After that I added the cell variant to the column by using the method "add_cell_variant".
    The last step is to call method SET_SELECTED_CELL_VARIANT.
    I checked my program by using get_selected_cell_variant( ) and the return string was okay.
    But when the table is displayed, the new cell variant isn't working. I defined an input field as the cell editor for my new cell variant but when the table is shown, it is just text - no input possible. In addition to that the selected cell design (goodvalue_medium , step 3) isn't working. So I think the cell variant is not used.
    Can you help me?
    Thanks & Regards,
    Hendrik

    Hi
    I wonder if you can help me please, I too am having issues implementing ALV cell changes in WDA?
    I am basically trying to dynamically change the individual color of a cell (not the entire column or row) dependant on certain criteria. I apologies but find that you are the closest resource for any potential information. Please see screen shot below.
    Currently my code is as follows:
    see: www.picasaweb.google.co.uk/dave.alexander69/Pictures#5244416971466907938
    data: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
    loop at table 1 row data
            loop at table columns
              for the date columns only...
              IF <fs_column>-id(4) = 'CELL'.
               get and set column header dates from select option user input - done
                loop at table 2 row data (table 2 contains date ranges for row concerned)
                  MOVE: ls_zdata-variance TO lv_variance.
                  method 1 - as in sap press WD4A -:
                  lr_cv = cl_wd_table_standard_cell=>new_table_standard_cell(
                                                     view        = view
                                                    variant_key = lv_variance ).
                 as mentioned...
                  CREATE OBJECT lr_cv.
                  lr_cv->set_key( 'VARIANCE' ).
                  lr_cv->set_cell_design( '09' ).
                  lr_cv->set_editor( lr_input_field ).
                  lr_column->add_cell_variant( lr_cv ).
                  lr_column->set_cell_editor( lr_input_field ).
                  lr_column->set_sel_cell_variant_fieldname( 'VARIANCE' ).
                  lr_column->set_cell_design_fieldname( value = 'COLOR_CELL' ).
                  lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
                  lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
                  the only way I get cell coloring to work - but this is for entire column?
                  ls_zdata-color_cell = cl_wd_table_standard_cell=>e_cell_design-one.
                  MODIFY lt_zdata FROM ls_zdata..
                ENDLOOP.
              ENDIF.
              IF <fs_column>-id = 'COLOR_CELL'.
                CALL METHOD lr_column->set_visible( EXPORTING value = '00' ).
              ENDIF.
            ENDLOOP
          ENDLOOP.
    As you see I am in the dark a bit regarding cell variants and wonder if you can point me in a better direction.
    Many thanks for any help,
    Dave Alexander

  • JTable Cell Editor For Decimal Input

    Hi friends in my program i am using jtable, in that table two columns are decimal value. I am using defaultcelleditor for to check the user input but it does not work. so how can i check the user input, ie number or string using the cell editor. My aim is to check the user input, if the user give the wrong value, ie string input the warning message want to be displayed and the editor color also want to change. Please help me.
    I refer some tutorials and get some source code and i used but it does not work. this is the code.
    DecimalFormat format=new DecimalFormat("######0.00");
    tableField=new JFormattedTextField();
    tab_Bill.getColumnModel().getColumn(3).setCellRenderer(new DecimalRenderer(format)); tab_Bill.getColumnModel().getColumn(3).setCellEditor(new ProblemEditor(tableField));
    class DecimalRenderer extends DefaultTableCellRenderer {
      DecimalFormat formatter;
      DecimalRenderer(String pattern) {
        this(new DecimalFormat(pattern));
      DecimalRenderer(DecimalFormat formatter) {
        this.formatter = formatter;
        setHorizontalAlignment(JLabel.RIGHT);
        @Override
      public void setValue(Object value) {
       /* setText((value == null) ? "" : formatter.format(((Double) value)
            .doubleValue()));*/
    setText((value == null) ? "" : formatter.format(Double.parseDouble(value.toString())));      
         class ProblemEditor extends DefaultCellEditor implements TableCellEditor{
       private JFormattedTextField ftf;
       public ProblemEditor(JFormattedTextField myfield) {
           super(myfield);
            @Override
       public Component getTableCellEditorComponent(JTable table,
               Object value, boolean isSelected, int row, int column) {
           ftf = (JFormattedTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
            Double d = null;
           try
                    if(value!=null)
            d=Double.parseDouble(value.toString());   
            catch(Exception e)
               // JOptionPane.showMessageDialog(null,"Wrong");
               d=0.0;
           ftf.setValue(d); // remove and okay
           ftf.setCaretPosition(ftf.getText().length());
           return ftf;
    }

    You might find it easer to use on of the [Table Format Renderers|http://www.camick.com/java/blog.html?name=table-format-renderers].

  • Info on cell editors for specific rows

    Hi all,
    Could anyone tell me how to return different components to be the editors for different rows in a table.
    I have certain rows that will use a checkbox editor and certain rows that will use a formatted textfield editor. I have coded an outline to my custom editor which extends Component and implements TableCellEditor. Any help would be greatly appreciated.
    Regards
    Alan

    Override getCellEditor() for the JTable
        public TableCellEditor getCellEditor(int row, int column) {
            if(row==rowOfmyChoice) //Or whatever Logic You want
                      return new MyCellEditor()
            return super.getCellEditor(row,column);
        }

  • How to list column names and data types for a given table using SQL

    I remember that it is possible to use a select statement to list the column names and data types of databaase tables but forgot how its done. Please help.

    You can select what you need from DBA_TAB_COLUMNS (or ALL_TAB_COLUMNS or USER_TAB_COLUMNS).

  • Can not access calendar, do not remember password, do not have access to cell phone for verify code, please help!

    I had created a calendar for my boss. I can not access the account or get it on his blackberry. It said the password was changed 12 months ago, if so I do not remember the password and I do not have access to his cell phone to receive the verify code. Please help!

    Just to let you know that you are Not alone. This Problem happens with The various new models of RIM. Unfortunatly untill now no Guy from BB sems to recognize The Probleme. I hope some day they will react other than with an aswer telling US to recreate Or recover pur Id account.

  • List Binding is Not Working Correctly for an ADF Table

    I created an ADF Select One Choice for a field being displayed in an ADF Table - mutliple records.
    The issue I'm seeing is that all the records in the ADF Table are showing the same value in the field defined as a "List", but the field values are not all the same.
    It almost looks like the List is taking the value in the first record and assigning the value to all the other records in the ADF Table.
    Please help.

    The solution is explained here:
    http://www.oracle.com/technology/products/jdev/tips/muench/screencasts/editabletabledropdown/dropdownlistineditabletable.html?_template=/ocom/technology/content/print

  • Regarding locks in SAP ( concurrent access by two reports for a same table)

    Hi All,
    I have a problem regarding locks. I have designed a report using lock function modules to set locks and release them after the database operations and it works perfectly. There is another report which also does some DB operation on the same table but there are no table locks using enqueue function module implemented in this report and despite of lock set by first report on the table it is able to do the changes on the db table. I need to know how to overcome this problem.
    Thanks for your solutions.
    Regards,
    Sachin

    Sachin Dangayach wrote:
    Hi All,
    >
    > I have a problem regarding locks. I have designed a report using lock function modules to set locks and release them after the database operations and it works perfectly. There is another report which also does some DB operation on the same table but there are no table locks using enqueue function module implemented in this report and despite of lock set by first report on the table it is able to do the changes on the db table. I need to know how to overcome this problem.
    > Thanks for your solutions.
    >
    > Regards,
    > Sachin
    lock procedure requires that all programs involved cooperate. Inconsistencies can occur if a program reads or changes data without having previously locked it. When a lock is set, the data records are only protected against changes by another program if this program also requests a lock before accessing the data.
    Please check the above extract from [SAP help|http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eed9446011d189700000e8322d00/frameset.htm],  to maintain data consistency, it must be ensured that all the programs should lock the data before changing.
    -Rajesh.

  • How to use the cell editor in FICO reports for YTD

    HI experts,
    I am working with BI7.0, in the below report, i have displayed result based on user input.but how to calculate the YTD values. User will give the input like 072007, results will be display one year from 072007 to 062006 (one yearback) and one more column is YTD
    Report structure is :
         user input(single value): 072007
              AUG06....JAN07....JULY07....YTD
    KEYFIGURE-1        453      -
    777     -
       232       -
      777 (Only Jan07 value of Keyfigure-1)   
    KEYFIGURE-2        879      -
    233        -
    123       -
      ???? (only sum from Jan07 to July07)
    KEYFIGURE-3        212            -
    879      -
    989                -
    KEYFIGURE-4        234            -
    656      -
    788                   -
    KEYFIGURE-5        345            -
    878      -
    878                 -
    KEYFIGURE-6        767            -
    767       -
    323                 -
    KEYFIGURE-7        879            -
    878     -
    999                -
    999 (Only last value of keyfigure-7 (July07)
    in the above report, total 7 keyfigures so 7rows of YTD column
    1) in the first YTD column, how will display only one value (keyfigure-1) of Jan07?
    2) in the last YTD Column, how will display only one value (keyfigure-7) of July07?
    3) from 2 to 6 columns of YTD, how will display the sum from Jan07 to July07?
    Note: months will be changed based on user input(single Value)
    how can use cell editor for above the senior.
    if any option is availabel please let me know
    Thanks
    kishore

    I think the following should work:
    Context:
    Rows (node,c=0:n)
    --- rowIndex (integer)
    selectedRowIndex (integer)
    Bind the "selectedKey" property of the radio button (cell editor) to attribute "selectedRowIndex" (outside table data source node) and bind "keyToSelect" to attribute "Rows.rowIndex". Make sure that the "rowIndex" attribute will contain the index of the node element in node "Rows".
    Armin

  • Setting value in a cell in JTable where editor for cell is a JComboBox

    Hi,
    I have a column in a JTable where it holds a comboBox . As the comboBox has different
    values depending on the row I've a cell editor for each row. That's fine. My problem is that one of the
    values on the comboBox launches a dialog where the user selects a new value to add to the comboBox.
    The comboBox gets updated with this new value and I call setValueAt on the table. Both get updated
    but the cell doesn't display the new value added in the JTable. I click it and the comboBox has the
    value and I've to select it to get it displayed in the cell.
    Here's the code for updating the tableModel -
    public void updateCellDetails(String value, int row)
    JComboBox combo = (JComboBox) rowEditor.getTableCellEditorComponent(
                        this,
                        value,
                        true,
                        row,
                        4);
    if (combo != null)
    combo.insertItemAt(value, combo.getItemCount() - 1);
    combo.setSelectedItem(value);
    rowEditor.setEditorAt(row, new DefaultCellEditor(combo));
    MyTableModel tableModel = (MyTableModel) getModel();
    tableModel.setValueAt(value, row, 4);
    Thanks

    Not sure if this'll help, but did you ever fire an editing-stopped event? If such an event is never fired, then editing-cancelled will be fired when you lose focus from the editor and the original value will be restored.

Maybe you are looking for