Find row Index of edited matrix cell

Hai,
I have designed a matrix which shows some value. The user is allowed to edit the values in Matrix cell. I want to update the edited value in no object table.Is there any way to find out the row indexes of edited cell of matrix.
If so, How to achieve this?
Thanks in Advance.

Using the validate is the same as any other itemevent: C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\02.CatchingEvents
The event will be raised when a user exits a field but in this case I don't think it's what you need.
You should:
1. Put a button on your form,
2. when the user clicks it, loop through the matrix
3. Check the Titles, and if they are different to what is in the No Object UDT, do step 4
4. Update the table.
These are important SDK concepts and you should invest some time in learning how to use both the Matrix Object and the UserTables object. The SDK helpfile provides sample codes.
For example, the following method can be used to update a record in a UDT
Private Sub Add_Data_Click()
    Dim oUserTable As SAPbobsCOM.UserTable
    Set oUserTable = oCompany.UserTables.Item("NoObjectTableName")
    oUserTable.GetByKey ("CodeOfValueInNoObjectTable")
    'Set default, mandatory fields
    oUserTable.Name = "Title"
    'Set user field
    oUserTable.UserFields.Fields.Item("U_AdditionalUDF").Value = "1"
    ret = oUserTable.Update
    If ret <> 0 Then
        oCompany.GetLastError ret, Str
        MsgBox Str
    Else
        MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to " & oUserTable.TableName & " Table"
    End If
End Sub
I do not have the time to write up a full routine for this, but this information should be enough to get you started. Also check the SDK samples C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\06.UseMatrix
Edit: To answer your intial question, there is no indicator on the matrix object which shows which rows are edited - you have to implement a logic that checks this yourself.
e.g. you could use the validate event to store the row number (pVal.Row) in a List that you can then use later after the user clicks the button.

Similar Messages

  • Matrix report - row field text extends into cell field's display space

    The horizontal elasticity of the row field in the matrix is set to VARIABLE. This row field's horizontal elasticity needs to be VARIABLE (not FIXED).
    However, this causes problems because if the row field's text length is long, the matrix does not change accordingly, i.e. the cell field does not move to the right to make room for the row field. So the row field extends into the display space of the cell field, and the text of the row and cell field overlap, and so the text is almost impossible to read (as well as ugly).
    I have tried to put a frame around the row and cell field so that they are together and move accordingly, but this hasn't helped. I have also tried anchors but they cause the fields to appear NULL when they are not.
    Any help is appreciated.
    -nelson
    [email protected]

    I think you'll need to revert to a fixed sized field and increase the height of the field to cope with the number of rows that you could have.
    You might be able to create a repeating frame above the matrix that tracks the matrix and pushes the whole matrix down as it expands, but I don't see how you could do this within the matrix structure itself.

  • How to get the TableRow from TableView with given row Index.

    Hi ,
    I want to retrieve the TableRow object or Cells of that row of the TableView, for the given row index. How i can get that.
    Here is the below code what i am actually looking for
    TableView table = new TableView();
    table.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
         @Override
         public void changed(ObservableValue<? extends Number> paramObservableValue,Number prevRowIndex, Number currentRowIndex) {
              System.out.println(":::::::::>  Previous Row : "+prevRowIndex+" Current Row : "+currentRowIndex);
              if(prevRowIndex.intValue()>-1){
                   // TODO: Get the TableRow object of prevRowIndex or the cells in that row.
    });Thanks in advance !!

    Jonathan, Thanks for the info !
    Actually my requirement is ,
    1) I have an editable table with four columns. Where the first three colums are editable and the last column is a delete button to delete the record.
    2) My requirement is such that, whenever the user edits a cell, it is not comitted on focus out but the whole row(all cells) is comitted at a time when the user hits "enter". If the validation is not successfull, the textfields are styled with error class and focuses on it.
    So based on the key event on the textfield in the editable cell, i am fetching all the cells in the same row, with the below code.. and doing the save/update operation.
    textBox.setOnKeyReleased(new EventHandler<KeyEvent>() {
         @Override
         public void handle(KeyEvent t) {
              if (t.getCode() == KeyCode.ENTER) {
                          TableRowSkin<ContactPersonResponse> rowSkin = (TableRowSkin<ContactPersonResponse>) cell.getParent();
                    ObservableList<Node> cells = rowSkin.getChildren();
                    view.setCellAction(cells);
                          // The setCellAction(cells) will iterate through all the cells, validates the text field,
                          // if validation is success commits all the cells else styles the cells and focuses on the cell.
    });Till now everything is fine and working properly.
    Now I have new requirement that when the user edits a row (not yet comitted) and if he selects another row, the previous selected row should be automatically committed with validation.
    So my final action is to call the setCellAction(cells) by passing the cells of the previous selected row.
    table.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
         @Override
         public void changed(ObservableValue<? extends Number> paramObservableValue,Number prevRowIndex, Number currentRowIndex) {
              System.out.println(":::::::::>  Previous Row : "+prevRowIndex+" Current Row : "+currentRowIndex);
              if(prevRowIndex.intValue()>-1){
                   // TODO: Need to call the setCellAction method by passing the cells of previous selected row. (prevRowIndex)
                            // Here i am not getting how to get the cells of the previous row.          
    });In the selectedIndex listener , i am not getting how to get the cells/row from the index.
    Any solution or workaround for achieving this functionality is highly apprieciated .
    Thanks & Regards,
    Sai Pradeep Dandem.
    Edited by: Sai Pradeep Dandem on Jan 2, 2012 10:23 PM
    Edited by: Sai Pradeep Dandem on Jan 2, 2012 10:23 PM

  • Theme Editor: where to change backgroundcolor of editable table cells?

    Hi all,
    I need to change the color of an editable table cell.
    I navigated to the theme editor --> tables.There is a section "Editable Tables". The preview shows an example with three columns and tree rows. I want to change the backgroundcolor of the cell in the first row, third column (in SAP standard it is lightgrey).
    The backgroundcolor of the rows beneath can be changed in section "Selected Cells", the backgroundcolor of the first two columns in the first row can be changed by "Background Color of Standard Table Cell" but I can't find the field where I can change the color of the last cell.
    Best regards,
    Sandra

    Hi,
    The blue color come from your definitions on "Labels and Fields" to read-only color of input field.
    Regards,
    F.F

  • How to get row index in table?

    I will show row no in table.
    In help,I find a example and follow it,I test:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="rowSetProperty"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetProperty name="estimatedRowCount"/>
    </boundAttribute>
    </bc4j:input>
    </contents>
    </bc4j:column>
    It's OK! But I couldn't get current row index.
    I test:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="rowSetProperty"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetProperty name="currentRowIndex"/>
    </boundAttribute>
    </bc4j:input>
    </contents>
    </bc4j:column>
    It's error! How can I do?

    Thanks
    I try:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="Seq No"/>
    </columnHeader>
    <contents>
    <textInput readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetIteratorProperty name="currentRowIndex"/>
    </boundAttribute>
    </textInput>
    </contents>
    </bc4j:column>
    Nothing be showed in the table cells.
    Here, I finished using Javabean:
    public class ClsRowIndexBean
    private int _counter=0; 
    public ClsRowIndexBean()
    public int getCounter()
    return _counter++;
    public int getCurrentCounter()
    return _counter;
    public void setCounter(int counter)
    _counter = counter;       
    }

  • How to disable right click on a Matrix Cell??

    Hi,
    It is impossible to disable a number of cells in a matrix. So I use the BubbleEvent = False in application item event to disable certain cells. My code is :
    If pVal.FormUID = "MyForm" And pVal.BeforeAction = True And pVal.ItemUID = "MyMatrix" Then
         If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK Then
              If pVal.Row <4 Then
                  BubbleEvent = False
              End If
         End If 
    End If
    It works great with left click. But the cell still can be selected  with a right click button. I've tried this code :
    If pVal.FormUID = "MyForm" And pVal.BeforeAction = True And pVal.ItemUID = "MyMatrix" Then
         If pVal.EventType = SAPbouiCOM.BoEventTypes.et_RIGHT_CLICK Then
              If pVal.Row <4 Then
                  BubbleEvent = False
              End If
         End If 
    End If
    and also this code in application rightclick event :
    Private Sub SBO_Application_RightClickEvent(ByRef eventInfo As SAPbouiCOM.ContextMenuInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.RightClickEvent
         If eventInfo.FormUID = "MyForm" And eventInfo.BeforeAction = True And eventInfo.ItemUID = "MyMatrix" Then
              If eventInfo.Row < 4 Then
                   BubbleEvent = False
              End If
         End If
    End Sub
    But it doesn't work... It just make the right click menu not appear, but I still can click and edit the cell with a right click...
    Is there a trick?
    Regards,
    Rinaldi Sugiono

    It is still the same.. 
    up to now, I use this trick :
    Private Sub SBO_Application_RightClickEvent(ByRef eventInfo As SAPbouiCOM.ContextMenuInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.RightClickEvent
            If eventInfo.FormUID = "MyForm" And eventInfo.BeforeAction = True And eventInfo.ItemUID = "MyMatrix" Then
                If SBO_Application.Forms.Item(eventInfo.FormUID).Items.Item("MyMatrix").Enabled = True And eventInfo.ItemUID = "MyMatrix" Then
                    If eventInfo.Row > 4 Then
                    Else
                        SBO_Application.Forms.Item("MyForm").Items.Item("MyMatrix").Specific.Columns.Item("MyColumn-1").Cells.Item(SBO_Application.Forms.Item("MyForm").Items.Item("MyMatrix").Specific.RowCount).Specific.String =_
                        SBO_Application.Forms.Item("MyForm").Items.Item("MyMatrix").Specific.Columns.Item("MyMatrix").Cells.Item(SBO_Application.Forms.Item("MyForm").Items.Item("MyMatrix").Specific.RowCount).Specific.String + ""
                        BubbleEvent = False
                    End If
                End If
            End If
    End Sub
    But it seems too ineffective... It runs slow, and results some "flicky cell"..
    Edited by: Rinaldi Sugiono on Sep 23, 2010 4:49 AM

  • Matrix Report - REP-1813:Object object name too large to fit in matrix cell

    I had this problem when running a matrix report. The report details are as follow :
    Query : select department,work,salary from sal;
    matrix row field : department
    matrix column field : work
    matrix cell field : salary
    data inserted into table sal :
    department : 10
    work : clerk
    salary : 1000
    I had created the same record for 60 times. Meaning there are 60 records(with same data) in the table. When I run the report, I got the error. But, if I deleted some records, it worked fine.
    In fact, I had already changed the 'Vertical Elasticity' property for all repeating frames to 'Variable'.
    Could somebody please help me to solve this. It is urgent. Thanks in advance.

    Hi,
    Your problem is bacause the innermost fame which is printing salary per row&column is printed 60 times. (because the job & dep are same for all 60 records). You get this error when the inner most frame grows to next page. Try this with setting the max no.of records per page to some 38 or 30 depending on page size. You will get it without error.
    Regards,
    Chandra

  • Default behaviour of the Escape key while editing a cell in JTable??

    Hi all,
    i have a Jtable which get its data from an own model object which extends DefaultTableModel.
    If i overwrite the isCellEditable(row, col) method within the tablemodel object and set a specific column to editable, then i notice while editing a cell in that column that the default behaviour of the Escape key is that independet from what you have entered before in to the cell the editing stops and the cell gets the value it had before editing.
    This is the case for me even if i apply a custom editor to a column (one that extends DefaultCellEditor). It is just a JTextField that limits the number of digits a user can enter. Everything works fine. If the user edits the cell and presses ENTER or the "down arrow key" i can check what he has entered with the help of the getCellEditorValue() method. But if the user hits the ESC key after editing a cell this method is not invoked!!!
    My question is :
    is there any way to detect that the user cancels editing with the ESC-key.
    this is very important for me because if the user goes editing the cell i lock the related record in the database, if i cannot detect this it is locked till the application terminates.
    Thanks for any help in advance

    I try override the JTable editingCanceled() ==> does not work.
    I try the addCellEditorListener( CellEditorListener l ) ==> does not work.
    Finally, I try the addKeyListener ==> it works.
    Here is a quick demo. program:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class Test {
    public static void main(String[] args){
    JFrame f = new JFrame();
    String[] colName = {"a", "b"};
    String[][] rowData = {{"1", "2"}, {"3", "4"}};
    JTable table = new JTable(rowData, colName);
    JTextField t = new JTextField(10);
    t.setBackground(Color.red);
    t.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
    // do what ever you want ex. un-lock table
    System.out.println("ESCAPE");
    DefaultCellEditor editor = new DefaultCellEditor(t);
    TableColumnModel colModel = table.getColumnModel();
    for (int i = colModel.getColumnCount()-1; i >= 0; i--) {
    colModel.getColumn(i).setCellEditor(editor);
    f.setContentPane(new JScrollPane(table));
    f.pack();
    f.setVisible(true);

  • Making particular rows as non editable before displaying the TABLE

    Hi everyone,
                               I would like to know how to make a particular rows as non editable in UI element "TABLE" before it is displayed . The scenario is :
    On entering the Personnel number, I am getting family dependants in the table. Then, I am selecting any of the family members on some condition and saving each member with the request.
    Next time when i enter the same personnel number, I would like to show the table with already saved request for the family members rows as non editable & other members row as editable.????
    Please provide a feasible solution.

    Hi Pradeep,
    follow as per suggested. if not work use cell variants concept. it will work.
    Please check this wiki...
    http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants
    Cheers,
    Kris.

  • Make rows as non editable in ALV

    Hi Experts,
    I have a standard ALV table where records are fetched from backend table. Here I have a field Approved as check box.
    My requirement is I need to make all the rows as non editable, if the Approved checkbox is checked. How can I achieve this.
    I went through the below discussion, but still am not clear of how to achieve it.
    How to set some rows in ALV to be editable or some non editable.
    I know to set a field as non editable in WD, but don't know how to set some specific rows as non editable in alv.
    Please help me.
    With Regards,
    Ramakrishnan M

    Hi,
    Create an Attribute in the Context say READ_ONLY of type wdy_boolean and bind the read only of cell editor to that attribute using set_read_only_fieldname( ) method. Then set the value of attribute READ_ONLY to abap_true/abap_false based on check box value.
    check this wiki for reference: How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki
    Hope this helps u,
    Regards,
    Kiran

  • Help with editing a cell in a JTable. DESPERATE

    Hi! Is there someone out there that could help with some source code for editing a cell in my JTable when I run it as an applet??
    It works fine when I run it as an application.
    I manage to select the row and write a number in it, but I can't get out of the cell (it seems that the program stops??). I want to enter an integer in a cell and when I click enter or with the mouse in an other cell the value that I enter should update some other cell( multiply the entered value with some fixed number and update a cell in a second coloumn)
    I am really desperate now..... I have thought about using a MouseListener....
    I am using a tablemodel that is from AbstractTableModel.

    Are you using some cell editors?
    While converting inside them, you might be getting some exceptions (like parseexception)which is stopping you from proceeding further.
    Are you using your own tablemodel with custom datatypes?
    Hope this helps,
    Ramkumar

  • Populating a matrix cell with data selected from a picker

    Dear All,
    I am new to SAP Bussiness one, please let me know how to get the selected data from a picker in to a matrix cell. I have warehouse code and warehouse name in the picker. I want the user selected warehouse code in the matrix cell
    Below is my code But I am not getting the selected code in the matrix cell
    I am adding the datasource as below
    oUserDataSource = oForm.DataSources.UserDataSources.Add("UDCFL", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
    Then I am adding the choose  list  as below
    Private Sub AddChooseFromList()
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "64"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)                
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
    *Then I am binding the data as below to the matrix column*
    oColumn = oColumns.Item("colToWhs")
            oColumn.DataBind.SetBound(True, "", "UDCFL")
            oColumn.ChooseFromListUID = "CFL1"
    Then in the event i have added the  below code.
                        Dim oDataTable As SAPbouiCOM.DataTable
                        oDataTable = oCFLEvento.SelectedObjects
                        Dim val As String
                        Try
                            val = oDataTable.GetValue(0, 0)
                        Catch ex As Exception
                        End Try
                        oForm.DataSources.UserDataSources.Item("UDCFL").Value = val
                       End If
    But the code is not getting populated in the matrix cell. Please let me know at the earliest
    Thanx in Advance

    sOLVED

  • Table Maintenance Generator - Rows should be editable

    Hi
    I have created one TMGfor a database table. In that im having two screens one is overview & other is single screen. based on the requirement i have changed the second screen that means single screen. There I have put one table control and copy paste the first screens code here.
    Here im facing one problem. When im clicking on New Entries it will move on to second screen but only 8 rows are in editable mode. I want all the rows should be in editable. The problem is first screen that means overview screen has 8 entries and that many rows are in editable mode in second screen.
    Please help me.

    Hi,
    In PBO of the single screen, there will be a variable which stores number of records to be edited.
    By debugging try to find out that variable and change its value to number of records in the
    output internal table..
    Expecting that variable name will have a pattern as maxlines*.

  • Editing in cell

    i just switched from pc/excel to mac/Numbers, and i can't figure out how to (a) change my preferences so that the cursor doesn't move down a cell after i press return and (b) edit in cell. in excel and lotus, you pressed f2 to edit in cell (and to switch between editing in cell and moving the cursor around the sheet); in Numbers i can't find that option.

    Hi dre1973,
    Welcome to Numbers forum.
    1. Regarding the cursor movement: Enter or Return moves it down Tab moves it to the right. As in other programs there isn't any way to make a change.
    2. In cell editing: double click on the cell.
    If those answers are not satisfactory please contact Numbers development team: At the top of the screen to the right of the blue apple click Numbers > Provide Numbers Feedback. Your request goes directly to the Numbers team. Then hope your request is implemented in the next version of Numbers.
    Because of different design philosophies MS and Apple do things differently, neither is incorrect.
    Sincerely,
    RicD

  • Find row in 2d array

    please help...
    i have 2d array of double and i wanna find specific row an extract to new 2d array.
    My 2d array is:
    100
    31,3
    25,3
    32,1
    25,6
    100
    31,3
    25,3
    32,1
    25,6
    160
    32,4
    25,5
    33,5
    26
    170
    33,2
    25,8
    34,3
    26,2
    100
    33,9
    26
    35,2
    26,4
    160
    32,4
    25,5
    33,5
    26
    160
    32,4
    25,5
    33,5
    26
    100
    31,3
    25,3
    32,1
    25,6
    170
    33,2
    25,8
    34,3
    26,2
    and i wanna find row with numbers 100,160,170 and build new 2d array
    100
    31,3
    25,3
    32,1
    25,6
    160
    32,4
    25,5
    33,5
    26
    170
    33,2
    25,8
    34,3
    26,2
    please help....tnx, tnx
    Solved!
    Go to Solution.

    I guess you should be more specific about your question. If you are planning to find the values that are present in the 1st column then you can use search 1D array and pass the index to index the 2D array so you will get 1D array of row then build the array by finding the element.
    This is what Yamaeda explained
    The best solution is the one you find it by yourself

Maybe you are looking for

  • Array of Strings?

    How can I make an array of strings?

  • Mail application

    when i opened the mail application, there was this spam letter. (I get junk mail a lot.) However, i just set up the mail application. And this one email i received was in yellow, and there is a strange symbol. what does this mean? Please Help me!! Ma

  • What is the Count function in formula of Query Design?

    What is the Count function in formula of Query Design?  Could someone gives an example? Thanks!

  • Custom Axis Labeling

    Is there an easy way of custom axis labeling? I saw a LabVIEW application that was labeling frequency on a logarithmic scale like: 10Hz, 100Hz, 1kHz, 10kHz, 100kHz, 1MHz, 10MHz instead of: 10, 100, 1000, 10000, 100000, 1000000, 10000000 Can this be d

  • Multiple Simultatenous Imports?

    I have hundreds of old tapes I want to put on DVD. They are in three different formats: VHS, Dig8 and MicroMV (surprisingly, iMovie does import MicroMV directly). I want to get this done ASAP, so is there a way to import from all three sources (assum