Collapsible sections

Certified Lead Developer

Hi

Here is my scenario,

I am having section layouts in a interface both were collapsible initially,

When I select the one section it has to expand as usual, Same manner when I select the second section it should expand and other section should go back to collapsible state,

I looking for suggestions to done my task

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi, Please check the attached code sample. Just showed the idea using button with style as link. Use another flag/button to to shrink (-) the sections.

    load(
      local!test: "first",
      a!formLayout(
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!sectionLayout(
                    contents: {
                      a!buttonLayout(
                        a!buttonWidget(
                          label: "(+)",
                          style: "LINK",
                          value: "first",
                          saveInto: local!test
                        )
                      )
                    }
                  ),
                  a!sectionLayout(
                    label: "Section1",
                    showWhen: local!test = "first",
                    contents: {
                      a!textField(
                        label: "test1",
                        labelPosition: "ABOVE",
                        saveInto: {},
                        refreshAfter: "UNFOCUS",
                        validations: {}
                      )
                    }
                  ),
                  a!sectionLayout(
                    contents: {
                      a!buttonLayout(
                        a!buttonWidget(
                          label: "(+)",
                          style: "LINK",
                          value: "second",
                          saveInto: local!test
                        )
                      )
                    }
                  ),
                  a!sectionLayout(
                    label: "Section2",
                    showWhen: local!test = "second",
                    contents: {
                      a!textField(
                        label: "test2",
                        labelPosition: "ABOVE",
                        saveInto: {},
                        refreshAfter: "UNFOCUS",
                        validations: {}
                      )
                    }
                  )
                }
              ),
              
            }
          )
        }
      )
    )

  • Hi,
    We have inbuilt parameter called isCollapsible.enable that field is true.




    a!formLayout(
    contents: {
    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {
    a!sectionLayout(
    label: "abc",
    contents: {
    a!textField(),
    },
    isCollapsible: true()
    )
    }
    ),

    }
    )
    }
    )


    Hope this will help.
    Thanks,
    Sudha.P
Reply Children
No Data