[RPG]Reset highlight current row

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

[RPG]Reset highlight current row

Post by MegumiSawada »

Hi

Is there any way to reset Highlight row when button (above the table) is clicked?
IMG_1627.PNG
IMG_1627.PNG (41.8 KiB) Viewed 5652 times
I can reset highlight row by setting HighlightCurrentRow to OFF when button is clicked.
However, it will stop showing highlight row afterwards.
I would like to set table to be highlighted again when one of table row is clicked again.

It seems none of the following way acheives the expected result.
-Retreive the current row id and set ROW%N.Highlight to OFF
-Set table's CurrentRowID to null
-Set table's CurrentRowID to non-existing value
-Set table's HighlightCurrentRow to OFF and ON again

I appreciate your kind advice!

Best Regards,
Megumi Sawada
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG]Reset highlight current row

Post by jasonzhou »

The Row.HighLight property can implement this. The implementation steps are:

• Set HighlightCurrentRow to False

• Set Row.HighLight to True when current row is touched

• Set all Row.HighLight properties to False when reset highlight

Please see the following demo code:

Code: Select all

// Highlight touched row
Begsr ON_ROW_TOUCHED;
    // Clear previously highlighted row
    For Local.Index = 1 to 50;
        LRNG_Using('/Form.Fields.TABLE1.ROW' : Idx(Local.Index));
        LRNG_SetProperty('HighLight' : 'False');
    endfor;
    
    // Get Current row id
    RowId = LRNG_GetPropAsStr('/Form.Fields.TABLE1.CurrentRowID');

    // Highlight selected row
    HighLightedRow = '/Form.Fields.TABLE1.ROW%' + RowId + '.HighLight';
    LRNG_SetProperty(HighLightedRow: 'True');
Endsr;

// clear all highlights when click clear button
Begsr ON_CLEAR_HIGHLIGHT_BUTTON_CLICKED;
    // Clear all highlighted rows
    For Local.Index = 1 to 50;
        LRNG_Using('/Form.Fields.TABLE1.ROW' : Idx(Local.Index));
        LRNG_SetProperty('HighLight' : 'False');
    endfor;    
Endsr;
Post Reply