Image

Field Name

NATION (Alpha 3)

Description

How to visualize a field as an Image set in a grid.

Uses

This Visualization type is useful to provide a more visual means of selecting values from a list.

Details

Through the Field Component source add a Picklist visualization ( PRIM_EVPL ) and a Picklist. Note that these are separate classes in the Field source. Add picklist items to represent nationalities and attach an image to each picklist item.Change the Appearance property of the PRIM_EVPL to Image. Save the field and use the VisualPicklist class on a form.

1.  Through the Field Component source add a Picklist visualization ( PRIM_EVPL ) and a Picklist. Note that these are separate classes in the Field source. Add picklist items to represent nationalities and attach an image to each picklist item. Save the field.

2.  Create a grid component. From the fields tab add the NATION field to the grid as a column. Set the following properties on the column.

3.  Load the grid and the column is  displayed and edited as an image set.

Field Source

Begin_Com Role(*EXTENDS #PRIM_OBJT)

Begin_Com Role(*picklist) Name(#Picklist)

Define_Com Class(#PRIM_PKIT) Name(#Item_1) Caption('USA') Default(True) Image(#VL_FLGUSA) Parent(#Picklist) Value('USA')

Define_Com Class(#PRIM_PKIT) Name(#Item_2) Caption('Japan') Image(#VL_FLGJPN) Parent(#Picklist) Value('JPN')

Define_Com Class(#PRIM_PKIT) Name(#Item) Caption('Great Britain') Image(#VL_FLGGB) Parent(#Picklist) Value('GBP')

Define_Com Class(#PRIM_PKIT) Name(#Item_3) Caption('Australia') Image(#VL_FLGAUS) Parent(#Picklist) Value('AUS')

End_Com

Begin_Com Role(*Visual #PRIM_EVPL) Name(#VisualPicklist) Appearance(Image) Defaultvisual(True) Height(95) Width(209)

End_Com

End_Com

Form Source

Function Options(*DIRECT)

Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(147) Clientwidth(492) Height(174) Left(369) Top(152)

Define_Com Class(#PRIM_GRID) Name(#GRID) Captionnoblanklines(True) Columnbuttonheight(17) Componentversion(1) Displayposition(1) Height(128) Left(40) Parent(#COM_OWNER) Showbuttonselection(True) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(8) Width(344)

Define_Com Class(#PRIM_GDCL) Name(#GDCL) Columnalign(Center) Displayappearance(Image) Displayposition(1) Editappearance(Image) Parent(#GRID) Readonly(False) Source(#NATION) Usepicklist(True) Width(30)

Evtroutine Handling(#COM_OWNER.CreateInstance) Options(*NOCLEARMESSAGES *NOCLEARERRORS)

Select Fields(#SECTION) From_File(PSLMST)

Add_Entry To_List(#GRID)

Endselect

Endroutine

End_Com

Appearance