Snap in Instance List

Visual LANSA Framework

Snap in Instance List

If you have coded a snap in instance list handler, it can be modified to handle changes to row color like this:

define_com #prim_vs #TempVisualStyle Reference(*dynamic)

...

 

* --------------------------------------------------------------------------------

* Redefine the standard uAddListEntry method

* --------------------------------------------------------------------------------

Mthroutine Name(uAddListEntry) Options(*Redefine)

...

 

*  Add the details to the instance list

 

Add_Entry #Inst_List

 

Set_Ref #KeyedGridItems<#uInstanceIdentifier> To(#Inst_list.CurrentItem)

 

* Set the visual Style based on the RowColor

invoke #avListManager.uGetRowColor uUII(#uInstanceIdentifier) RowColorStyle(#TempVisualStyle)

if_ref #TempVisualStyle is_not(*null)

 

* the filter has set a RowColor to a Visual Style, or has set it back to DEFAULT

set #Inst_List.Currentitem VisualStyle(#TempVisualStyle)

 

else

* The filter has not specified the RowColor or has specified it as blank - no change to row style - do nothing

 

endif

 

endroutine

You can handle changes to row color similarly in mthroutine UpdateListEntryData.