Skip to main content
pravendrak0001
June 4, 2022
Solved

Radio button with Boolean not working

  • June 4, 2022
  • 4 replies
  • 0 views

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!!

    Best answer by gopalk2865

    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
    June 4, 2022

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

    pravendrak0001
    June 4, 2022
    choiceValues: {true, false},

    apart from this.

    gopalk2865
    Participating Frequently
    June 4, 2022

    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: {}

    )