Choose of radio-set

make

Member
Hi there,
i try to change a little program wich is not written by me.
In this Procedure a Radio-Set is created.
Now my question : How can i make a choose of trigger for one of this radio buttons.

* Radio-buttons*/
create radio-set whRS
assign row = (6.7)
column = (13.14)
height-chars = 0.77
width-chars = 2.0
frame = frame {&FRAME-NAME}:handle
horizontal = false
bgcolor = 8
auto-resize = true
.
i = 0.
whRS:PRIVATE-DATA = "".
for each rbdok where rbdok.typ = sh_cStTyp no-lock:
i = i + 1.
lDummy = whRS:add-last(rbdok.titel, i).
whRS:PRIVATE-DATA = whRS:PRIVATE-DATA + (if whRS:PRIVATE-DATA <> "" then "," else "") + string(rowid(rbdok)).
end. /* for each rbdok where ... */
-----------------------------------------------------------------------------------
in one case the screen-value of one Radio-button is "sales", comes from rbdok

Here is my first try to make a choose of trigger, but it doesent work.


ON CHOOSE OF whRS
DO:
if whRS:screen-value ="Sales" then do:
message " Sales is chosen" view-as alert-box.
end.
END.



Thanks for your help.
make
 
Works,but....

there will be more than six radio buttons created in this radio set.
For example : Sales1,Sales2....Sales6.
The Value-Chaged Event should only do something, when The radio Button with the Screen-Value : Sales6 has the focus.

This doesnt work.

ON "VALUE-CHANGED":U OF whRS
If whrs:screen-value:"Sales6" then do:
...
end.
end.

Make

P.S. Thanks for help
 
How have you defined the radio-set. As well as defining the label that appears on the screen, you also define another value for the label, depending on the data type. This is what is actually used as screen-value, rather than the labels that display.

Do this to find out what your screen values actually are:
<pre>
ON "VALUE-CHANGED":U OF whRS
do:
message self:screen-value
view-as alert-box.
end.
</pre>
once you have the screen value that corresponds to "Sales 6", use this in the trigger to only act when Sales 6 is chosen.

Hope this makes sense, here's an example to (hopefully) clarify
<pre>
DEFINE VARIABLE RADIO-SET-1 AS INTEGER
VIEW-AS RADIO-SET VERTICAL
RADIO-BUTTONS
"Item 1", 1,
"Item 2", 2,
"Item 3", 3
SIZE 12 BY 3 NO-UNDO.
</pre>
In this example, the labels that display on the screen are Item 1,Item 2, Item 3 and the corresponding screen-values are 1,2,3.

Its a bit wierd, but it can be useful
 
Back
Top