Radio Button not saving the value for page

A Score Level 1

a!localVariables(
  local!isChanged:a!refreshVariable(
    value: ri!isChangesMade,
    refreshOnReferencedVarChange: false),
  
  a!formLayout(
    
    contents:{
      a!buttonLayout(
        accessibilityText: "Select a Type of Service",
        secondaryButtons:{

                  
                },
                
              )
            }
          )
        }
      ),
     
      a!radioButtonField(
        label:"Do you want to make changes to any services?",
        choiceLabels:{"No","Yes"},
        choiceValues:{false,true},
        value:local!isChanged,
        saveInto:local!isChanged,
        
        
      ),
      if(
        local!isChanged,
        rule!SS_ui_serviceGrid(
 ),
        {}
      ),

      
    },
    
  )
)
The Interface has different services listed at the top of the form. If I select one service, select 'Yes' for radio buttons, and make changes to the grid and go to other services. when I come back to the previous service, the changes are not getting saved. I tried using the refresh variable but it is not working. Any suggestions to resolve this issue.

  Discussion posts and replies are publicly visible

Parents
  • I am facing a similar issue. have u been able to resolve??

  • here is code part.


    a!localVariables(
      local!var1: {
        'type!{urn:com:appian:types:TST}TST_CDT'(
          field1: null(),
          field2: null(),
          field3: null(),
          field4: ri!inputId
        ),
        'type!{urn:com:appian:types:TST}TST_CDT'(
          field1: null(),
          field2: null(),
          field3: null(),
          field4: ri!inputId
        ),
        'type!{urn:com:appian:types:TST}TST_CDT'(
          field1: null(),
          field2: null(),
          field3: null(),
          field4: ri!inputId
        ),
        'type!{urn:com:appian:types:TST}TST_CDT'(
          field1: null(),
          field2: null(),
          field3: null(),
          field4: ri!inputId
        ),
        'type!{urn:com:appian:types:TST}TST_CDT'(
          field1: null(),
          field2: null(),
          field3: null(),
          field4: ri!inputId
        )
      },
      local!var1Count: count(local!var1),
      a!formLayout(
        label: "Input",
        contents: {
          a!gridLayout(
            totalCount: local!var1Count,
            headerCells: {
              a!gridLayoutHeaderCell(label: "Col1"),
              a!gridLayoutHeaderCell(label: "Col2"),
              a!gridLayoutHeaderCell(
                label: "Col3",
                align: "RIGHT"
              ),
              /* For the "Remove" column */
              a!gridLayoutHeaderCell(label: "")
            },
            columnConfigs: {
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 2),
              a!gridLayoutColumnConfig(width: "ICON")
            },
            rows: a!forEach(
              items: local!var1,
              expression: a!gridRowLayout(
                id: fv!index,
                contents: {
                  a!textField(
                    label: "Col1",
                    placeholder: dollar(0.00, 2),
                    value: if(
                      isnull(
                        fv!item.field1
                      ),
                      null(),
                      dollar(
                        fv!item.field1,
                        2
                      )
                    ),
                    saveInto: {
                      a!save(
                        fv!item.field1,
                        cleanwith(save!value, ".0123456789")
                      ),
                      a!save(
                        fv!item.field1,
                        cleanwith(save!value, ".0123456789")
                      )
                    },
                    required: true
                  ),
                  a!textField(
                    label: "col2",
                    placeholder: text(0, "0.00") & "%",
                    value: if(
                      isnull(
                        fv!item.field2
                      ),
                      null(),
                      fv!item.field2 & "%"
                    ),
                    saveInto: {
                      fv!item.field2
                     },
                    required: true
                  ),
                  a!textField(
                    label: "Col3",
                    placeholder: text(0, "0.00") & "%",
                    value: if(
                      isnull(
                        fv!item.field2
                      ),
                      null(),
                      fv!item.field2 & "%"
                    ),
                    saveInto: {
                      fv!item.field2
                    },
                    required: true
                  ),
    
                  /* For the Removal Column*/
                  a!richTextDisplayField(
                    value: a!richTextIcon(
                      icon: "close",
                      altText: "delete " & fv!index,
                      caption: "Remove " & fv!item.field2 & " " & fv!item.field3,
                      link: a!dynamicLink(
                        value: fv!index,
                        saveInto: {
                          a!save(
                            local!var1,
                            remove(local!var1, save!value)
                          )
                        }
                      ),
                      linkStyle: "STANDALONE",
                      color: "NEGATIVE"
                    )
                  )
                }
              )
            ),
            addRowlink: a!dynamicLink(
              label: "Add row",
              value: {
                'type!{urn:com:appian:types:TST}TST_CDT'()
              },
              saveInto: {
                a!save(
                  local!var1,
                  append(local!var1, save!value)
                )
              }
            ),
            rowHeader: 1
          ),
          a!radioButtonField(
            label: "Options",
            choiceLabels: {
              "Option 1",
              "Option 2"
            },
            choiceValues: { 1, 2 },
            value: if(
              ri!isOption1 = true,
              1,
              if(ri!isOption2 = true, 2, null)
            ),
            saveInto: {
              a!save(
                ri!isOption1,
                if(save!value = 1, true, false)
              ),
              a!save(
                ri!isOption2,
                if(save!value = 2, true, false)
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: a!buttonWidget(
            label: "Submit",
            saveInto: {
              a!save(ri!isSubmit, true()),
              a!forEach(
                local!var1,
                a!save(
                  fv!item.isOption1,
                  ri!isOption1
                )
              ),
              a!forEach(
                local!var1,
                a!save(
                  fv!item.isOption2,
                  ri!isOption2
                )
              ),
              a!save(
                ri!var1Data,
                local!var1
              )
            },
            submit: true,
            style: "PRIMARY"
          ),
          secondaryButtons: a!buttonWidget(
            label: "CANCEL",
            saveInto: ri!isSubmit,
            submit: true,
            style: "SECONDARY",
            validate: false
          )
        )
      )
    )

  • 0
    Certified Lead Developer
    in reply to Sai Manam

    Thanks for the code snippet, though i'm unclear what your issue is -- Can you please describe BOTH:

    • what you were intending for this to do
    • what it is ACTUALLY doing - i.e. what its behavior is failing to accomplish?
Reply Children
No Data