Submitted by Anonymous (not verified) on Fri, 04/29/2016 - 15:31
Forums

Hi,

How can we use radio buttons in IceCap?

Niels Liisberg

Fri, 04/29/2016 - 15:39

Hi,

Let's say you need to convert a 5250 input field from the codes A,B, and C relating to customer size where A=Large, B=Medium and C=Smal customer. And you would like to use radio buttons. 

In IceCap there is an xtype that does the trick for you - namely the "RADIOGROUP" xtype. It looks like the "Customer group" input field in the example here:

Screenshot Customer-info

Now - to override the normal behaivour of at input field you have to set the type for the field with the "vtSetMetaData" api. This is done in the "break-out" program. An example can be found in library ICECAP file QSAMPLE member EX12.

The above example is made with this few lines of RPGLE code:

RPGLE code

The trick here is that the "valueMap" converts the key (the 5250 data) to the "value" before is displayed and back again to the 5250 stream who you press OK ( Enter); The value also works a the radio-button label. 

Note: the "valueMap" is an array of objects for RADIOGROUP where it is a simple array for COMBOBOX – Otherwise these two components have very similar behaviours. 

This feature is available in IceCap released be after the 6 may 2016. However, a fix for previous releases are available where needed.

Best regards,

Niels Liisberg