EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
Expand all | Collapse all

Get TextField value from DataGrid

  • 1.  Get TextField value from DataGrid

    Posted Wed October 25, 2017 04:16 AM

    Hi everyone,

    I have the following code:

     

    myGrid DataGrid {behaviors = [addEditors],
            columns = [    new DataGridColumn { name = "myField" , displayName = " ", width= 22},
                ....
            ], 
            data = []    
        };
        
    private function addEditors (grid DataGrid in, cell Widget in, rowData any in, dataIndex int in, column DataGridColumn in)
            if(column.name == "myField")            
                cell.children =[new TextField{text = grid.data[dataIndex].myField as string}];
            end
    end

     

    I want to take TextField value, but  myGrid.data[1].myField as TextField).text doesn't work. What's the correct command?

    xarlap


  • 2.  Re: Get TextField value from DataGrid

    Posted Wed October 25, 2017 04:36 AM
     
    try this: 
      
    function editorBehaviors(grid DataGrid in, cell Widget in, rowData any in, dataIndex int in, column DataGridColumn in, value any in) returns(Widget)   rowNumber int = cell.getAttribute("row");                cell.children =[new DojoTextField{maxLength = 20, width = "100%", placeHolder = "Phone",                text =  SearchGridArray_ui.data[rowNumber][column.name], maxLength = 10 ,constraints = new Dictionary{dataType = "digit"},validators =[Validator]}                               ];    end

     

    michaeldefox


  • 3.  Re: Get TextField value from DataGrid

    Posted Wed October 25, 2017 05:26 AM


  • 4.  Re: Get TextField value from DataGrid

    Posted Wed October 25, 2017 10:50 AM

    Hi,

    in the editorbehaviour you could use 'value' instead of this: 'SearchGridArray_ui.data[rowNumber][column.name]'

     

     

        function EditorBehaviors(grid DataGrid in, cell Widget in, rowData any in, rowIndex int in, column DataGridColumn in, value any in) returns(Widget)        if(column.name == "FIELD")            TextLabel TextLabel{text = value};            cell.children =[TextLabel];        end            end

     

    Marcel-D