Want to Repeat an section on click of button .

Section might contain the fields like dropdown, flieupload ,.. those should also get repeated 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Here's a basic example, you should be able to swap in your type! values and configure your components

    a!localVariables(
      local!someVar,
      {
        a!forEach(
          items: local!someVar,
          expression: a!sectionLayout(
            label: "Section: " & fv!index,
            divider: "ABOVE",
            contents: {
              a!textField(
                label: "Name",
                value: fv!item.name,
                saveInto: fv!item.name
              ),
              a!dateField(
                label: "DoB",
                value: fv!item.dob,
                saveInto: fv!item.dob
              )
            }
          )
        ),
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              icon: "plus",
              label: "Add Row",
              value: a!map(name: null, dob: null),
              saveInto: a!save(
                target: local!someVar,
                value: append(local!someVar, save!value)
              )
            )
          }
        )
      }
    )

Reply
  • +1
    Certified Lead Developer

    Here's a basic example, you should be able to swap in your type! values and configure your components

    a!localVariables(
      local!someVar,
      {
        a!forEach(
          items: local!someVar,
          expression: a!sectionLayout(
            label: "Section: " & fv!index,
            divider: "ABOVE",
            contents: {
              a!textField(
                label: "Name",
                value: fv!item.name,
                saveInto: fv!item.name
              ),
              a!dateField(
                label: "DoB",
                value: fv!item.dob,
                saveInto: fv!item.dob
              )
            }
          )
        ),
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              icon: "plus",
              label: "Add Row",
              value: a!map(name: null, dob: null),
              saveInto: a!save(
                target: local!someVar,
                value: append(local!someVar, save!value)
              )
            )
          }
        )
      }
    )

Children
No Data