Skip to main content
pravendrak0001
New Participant
Jun 4, 2022 5:48 AM UTC
Solved

Radio button with Boolean not working

Hi,

I am using below code for radio button setup, however after selecting any value from radio button , i click anywhere (click outside of radio button area) on screen it deselect automatically.

a!radioButtonField(
label: "Type of Maintenance",
labelPosition: "ABOVE",
choiceLabels: {"Scheduled", "Unscheduled"},
choiceValues: {true, false},
saveInto: ri!maintenance.maintenancescheduled,
required: true,
choiceLayout: "COMPACT",
choiceStyle: "STANDARD",
validations: {}
)

Thanks in advance!!

    gopalk2865
    Participating Frequently
    Jun 4, 2022 9:18 AM UTC

    Use below code,

    a!radioButtonField(

    label: "Type of Maintenance",

    labelPosition: "ABOVE",

    choiceLabels: {"Scheduled", "Unscheduled"},

    choiceValues: {true, false},

    value:ri!maintenance.maintenancescheduled,

    saveInto: ri!maintenance.maintenancescheduled,

    required: true,

    choiceLayout: "COMPACT",

    choiceStyle: "STANDARD",

    validations: {}

    )

    4 replies

    gopalk2865
    Participating Frequently
    Jun 4, 2022 7:06 AM UTC

    Hi , you have not configured value parameter of the radio button. Set the value parameter then it will work.

    pravendrak0001
    New Participant
    Jun 4, 2022 7:34 AM UTC
    choiceValues: {true, false},

    apart from this.

    gopalk2865
    Participating Frequently
    Jun 4, 2022 9:18 AM UTC

    Use below code,

    a!radioButtonField(

    label: "Type of Maintenance",

    labelPosition: "ABOVE",

    choiceLabels: {"Scheduled", "Unscheduled"},

    choiceValues: {true, false},

    value:ri!maintenance.maintenancescheduled,

    saveInto: ri!maintenance.maintenancescheduled,

    required: true,

    choiceLayout: "COMPACT",

    choiceStyle: "STANDARD",

    validations: {}

    )