a!radioButton() how do I disable only one of the choiceLabels options upon conditions met?

Certified Senior Developer

Hi team, I been pondering and I would like to disable only the "direct approve" option upon conditions met. Is that possible?

a!localVariables(
local!choiceLabels: {
approve,
reject,
direct approve,
direct reject
},
a!radioButtonField(
                  label: "This application is recommended for",
                  labelPosition: "ABOVE",
                  choiceLabels: local!choiceLabels,
                  choiceValues: local!choiceValues,
                  value: ri!recommendedFor,
                  saveInto: {},
                  disabled: since it allowed only true()/false()?
                  )
                 
                

  Discussion posts and replies are publicly visible

Parents
  • Additionally, what I generally do here is to manage the selection options in a local refresh variable and continue to use a single radio button or dropdown, such as:

    a!localVariables(
      local!canApproveDirect: true,
      local!options: {"Approve","Reject","Direct Approve","Direct Reject"},
      local!choices: a!refreshVariable(
        value: if(
          local!canApproveDirect,
          local!options,
          index(local!options,{1,2})
        )
      ),
      local!selection,
      {
        a!radioButtonField(
          label: "Direct Approvals",
          choiceLabels: {"Yes","No"},
          choiceValues: {true,false},
          value: local!canApproveDirect,
          saveInto: {
            local!canApproveDirect,
            a!save(local!selection,null)
          }
        ),
        a!radioButtonField(
          label: "This application is recommended for",
          labelPosition: "ABOVE",
          choiceLabels: local!choices,
          choiceValues: local!choices,
          value: local!selection,
          saveInto: local!selection
        )
      }
    )

Reply
  • Additionally, what I generally do here is to manage the selection options in a local refresh variable and continue to use a single radio button or dropdown, such as:

    a!localVariables(
      local!canApproveDirect: true,
      local!options: {"Approve","Reject","Direct Approve","Direct Reject"},
      local!choices: a!refreshVariable(
        value: if(
          local!canApproveDirect,
          local!options,
          index(local!options,{1,2})
        )
      ),
      local!selection,
      {
        a!radioButtonField(
          label: "Direct Approvals",
          choiceLabels: {"Yes","No"},
          choiceValues: {true,false},
          value: local!canApproveDirect,
          saveInto: {
            local!canApproveDirect,
            a!save(local!selection,null)
          }
        ),
        a!radioButtonField(
          label: "This application is recommended for",
          labelPosition: "ABOVE",
          choiceLabels: local!choices,
          choiceValues: local!choices,
          value: local!selection,
          saveInto: local!selection
        )
      }
    )

Children
No Data