Skip to main content
October 14, 2024
Question

RE: Checkbox

  • October 14, 2024
  • 13 replies
  • 0 views

Hi Everyone,

I am trying to achieve multi selection checkbox but its not working as expected

 a!checkboxField(
              label: "",
              choiceLabels: cons!CR_TXT_CHOICE_LABELS_YES_NO[1],
              choiceValues: cons!CR_APP_INT_CHOICE_VALUES[1],
              value: if(
                contains(
                  cons!CR_APP_INT_CHOICE_VALUES[1],
                  tointeger(local!selectionFlag_int)
                ),
                tointeger(local!selectionFlag_int),
                null()
              ),
              saveInto: local!selectionFlag_int,
              align: "LEFT"
            ),
Currently, If I select one checkbox it is selecting all checkbox ,But I want to select multi checkbox ,How would I achieve this, can anyone correct this code .

Thanks in Advance.

    13 replies

    somasundaram.d
    October 14, 2024

    It seems like, In the choice labels and choice values you are indexing the first value of the constant. Pass the constant without any indexing and remove the if condition logic in the value parameter and pass local!selectionFlag directly.

    a!localVariables(
      local!selectionFlag_int,
      a!checkboxField(
        label: "",
        choiceLabels: {"Yes","No","Maybe"},
        choiceValues: {1,2,3},
        value: local!selectionFlag_int,
        saveInto: local!selectionFlag_int,
        align: "LEFT"
      ),
    )

    October 14, 2024

    ChoiceLabel:"Yes",
    ChoiceValue: 1

    No I do not want Any Choice Label here and there should be one Choice value.

    somasundaram.d
    October 14, 2024

    Can you elaborate your requirement? 

    prasantap0900
    October 21, 2024

    a!localVariables(
      local!save,
      a!checkboxField(
        choiceLabels: {1,2,3},
        choiceValues: {"a","b","c"},
        value: local!save,
        saveInto: local!save,
        
      )
    )