getRadioGroupValue
getRadioGroupValue
Reads the currently selected value from a radio group.
Parameters
groupId(string): The identifier of the radio group
Returns: any — the currently selected value
Radio widget setup
The returned value is the value property of the currently selected Radio widget. Configure the Radio widgets placed on the Form as follows.
| Property | Description |
|---|---|
| groupId | The identifier of the group to read. It must match the argument passed to getRadioGroupValue. |
| value | The unique identifier of each radio button. This is what gets returned for the selected radio. |
note
The groupValue property is managed automatically at runtime, so you don't need to set it yourself.
Example setup
| Widget | groupId property | value property |
|---|---|---|
| Radio 1 | orderType | market |
| Radio 2 | orderType | limit |
| Radio 3 | orderType | stop |
With Radio 2 selected, "limit" is returned.
Example
var orderType = $form.getRadioGroupValue("orderType");
$log.i("선택된 주문 유형:", orderType);
if (orderType === "limit") {
// 지정가 주문 처리
$log.i("지정가 주문");
}
Related
$form.setRadioGroupValue(groupId, groupValue)— sets the selected value