IColumns

http://docs.lansa.com/14/EN/lansa048/content/resources/images/lansa/vlf%20one.png

IColumns (IColumn1 to 3) are used to display images in the instance list. They must be added as a reference to a #PRIM_BMP object.

IColumns may only be used in business objects that are only ever executed in VLF-ONE. Instance lists that contain image columns are not supported in VLF-WIN, VLF-WAM, or VLF-WEBEVENT applications at run time.

To add an IColumn image in a filter, first define a PRIM_BMP object in your filter.

Define_Com Class(#prim_BMP) Name(#uImageEmployee) Reference(*DYNAMIC)

Then create the image, either from an image file on the webserver, or from a blob field:

#uImageEmployee <= #SYS_APPLN.CreateBitmap( VLFONE/Images/other/cross.png )

OR

#uImageEmployee <= #SYS_APPLN.CreateBitmap( #xEmployeeImageThumbnail )

Then add the image to the instance list:

#AVLISTMANAGER.AddtoList Visualid1(#xEmployeeIdentification) Visualid2(#xEmployeeTitle) ... Icolumn1(#uImageEmployee)

Image columns will accept a null reference. This is the same as not specifying the property. IColumn1(*null) indicates that no change is to be made to the item’s image.

If you want to change an instance list item’s image to null, you need to specify a reference to a special shipped component #UF_BMNULL:

#AVLISTMANAGER.AddtoList Visualid1(#xEmployeeIdentification) Visualid2(#xEmployeeTitle) ... Icolumn1(#UF_BMNULL)

This will change the instance list item’s image to null, and it will display as blank.

It is advisable to set the row height to a suitable height for the image. This can be done in the definition of the business object, or at run time during the initialize using:

Set Com(#AVLISTMANAGER.avVisualList) Rowheight(50)

If you want to add margins around images you can use logic like this in the initialize routine:

 

#For Each(#Column) In(#AVLISTMANAGER.avVisualList.Columns)

If (#Column *Is #PRIM_LIST.Image)

(#Column *As #PRIM_LIST.Image).CellMarginTop := 2

(#Column *As #PRIM_LIST.Image).CellMarginBottom := 2

Endif

Endfor

See DF_T76F1O for a full example.