Radio button in Grid

Certified Senior Developer

Hi Everyone,

Is there any way to include radio button instead of check box in read only grid for selection?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to shubhamy0005

    Hi guys , 

    After debugging this for quite some time, I found a weird issue.

    Shubham, you are trying to provide choiceValues which are higher than the upper limit of integer type (i.e. 2147483647), your data.ciskey is having list of very large values which are not supported for display value parameter of radioButtonField, documentation says that it can take Any type values but it seems like this is not the case.

    Let me explain more clearly with an example (I removed the grid selection for debugging).

    When I provide choiceValues which are in limit, it works just perfect

    But when I change the value for any of the id above int limit, it just do not knows how to handle that and says, All selected values must be present in the choiceValues array, but value was current item value and choice values was next item value.

    If any one of you knows someone this should be addressed to from Appian team, then please mention them.

    Now, the alternative for this particular use case is either you change the items on which you are iterating, like below code or change the data index to provide choiceValues which are supported, usually for choiceValues identifiers like 1,2,3 should be used.

    a!localVariables(
      local!data: {
        { id: "2147483648", name: "HarshitBumb.com" },
        { id: "2147483649", name: "AppianSpace.com" },
        { id: "2147483641", name: "chat.openai.com" }
      },
      local!selectedRow,
      {
        a!gridLayout(
          label: "Editable Grid",
          labelPosition: "ABOVE",
          headerCells: {
            a!gridLayoutHeaderCell(label: ""),
            a!gridLayoutHeaderCell(label: "Resources")
          },
          columnConfigs: {},
          rows: a!forEach(
            items: enumerate(length(local!data)) + 1,
            expression: a!gridRowLayout(
              id: fv!item,
              contents: {
                a!radioButtonField(
                  choiceLabels: "",
                  choiceValues: fv!item,
                  value: if(
                    tointeger(local!selectedRow) <> tointeger(fv!item),
                    null,
                    local!selectedRow
                  ),
                  saveInto: local!selectedRow
                ),
                a!richTextDisplayField(value: local!data.name[fv!index])
              }
            )
          ),
          selectionValue: local!selectedRow,
          selectionStyle: "ROW_HIGHLIGHT",
          selectable: true,
          validations: {},
          shadeAlternateRows: true
        )
      }
    )