Need example of how to work with TDBRadioMenu control
Publicado: Sab Oct 04, 2008 12:19 am
My Radio Menu object has three values: "COUNTY", "STATE", and "NEITHER",
which I understand would correspond to an oDBRadioMenu:nIndex value of 1, 2,
or 3.
To try to get the control to display the database value, in the onCreate
event of the control, I have:
do case
case ::oDBRadioMenuRecipient:Value == "COUNTY"
::oDBRadioMenuRecipient:nIndex := 1
case ::oDBRadioMenuRecipient:Value == "STATE"
::oDBRadioMenuRecipient:nIndex := 2
case ::oDBRadioMenuRecipient:Value == "NEITHER"
::oDBRadioMenuRecipient:nIndex := 3
endcase
To try to get the control to return the correct string value, in the
onChange event of the control, I have:
do case
case ::oDBRadioMenuRecipient:nIndex == 1
::oDBRadioMenuRecipient:Value := "COUNTY"
case ::oDBRadioMenuRecipient:nIndex == 2
::oDBRadioMenuRecipient:Value := "STATE"
case ::oDBRadioMenuRecipient:nIndex == 3
::oDBRadioMenuRecipient:Value := "NEITHER"
endcase
This doesn't seem to work properly in that the form doesn't display the
corresponding radio button as selected when I show that record and still
returns the nIndex value to the oDataSet field, rather than the string
value. I guess I need an example of how to use the RadioMenu control
properly.
TIA,
Gary S. Rogers
which I understand would correspond to an oDBRadioMenu:nIndex value of 1, 2,
or 3.
To try to get the control to display the database value, in the onCreate
event of the control, I have:
do case
case ::oDBRadioMenuRecipient:Value == "COUNTY"
::oDBRadioMenuRecipient:nIndex := 1
case ::oDBRadioMenuRecipient:Value == "STATE"
::oDBRadioMenuRecipient:nIndex := 2
case ::oDBRadioMenuRecipient:Value == "NEITHER"
::oDBRadioMenuRecipient:nIndex := 3
endcase
To try to get the control to return the correct string value, in the
onChange event of the control, I have:
do case
case ::oDBRadioMenuRecipient:nIndex == 1
::oDBRadioMenuRecipient:Value := "COUNTY"
case ::oDBRadioMenuRecipient:nIndex == 2
::oDBRadioMenuRecipient:Value := "STATE"
case ::oDBRadioMenuRecipient:nIndex == 3
::oDBRadioMenuRecipient:Value := "NEITHER"
endcase
This doesn't seem to work properly in that the form doesn't display the
corresponding radio button as selected when I show that record and still
returns the nIndex value to the oDataSet field, rather than the string
value. I guess I need an example of how to use the RadioMenu control
properly.
TIA,
Gary S. Rogers