remove the sectionlayout using button

Certified Lead Developer

hi,
i using button component to remove the section layout,
i am using the following code

a!sectionLayout(
contents: {
a!textField(
label: "Risk 1",
labelPosition: "ABOVE",
placeholder: "<Insert a transaction Risk.>",
value: ri!input.Risk1,
saveInto: ri!input.Risk1,
align: "CENTER"
),

after this i using the remove() function,
"saveInto:{

a!save(ri!input.Risk1,remove(ri!input.Risk1,index(ri!input)))

}
i am unable to delete the section 
i looking for suggestion to modify the scripts and work done.

regards 
srinivas

  Discussion posts and replies are publicly visible

Parents
  • Hi srinivas,

    on which action you want to remove the Section , if you want to just hide the section based on the action on the button then button value take as true save that to rule input and in the section using show When condition hide that section sample code

    a!formLayout(
    contents:{
    a!sectionLayout(
    showWhen:not(ri!input=true()),
    contents: {
    a!textField(
    label: "Risk 1",
    labelPosition: "ABOVE",
    placeholder: "<Insert a transaction Risk.>",
    value: "",
    saveInto: ""


    )
    }

    )
    },
    buttons:a!buttonLayout(
    primaryButtons:a!buttonWidget(
    label:"Remove",
    value:true,
    saveInto:{
    ri!input
    }
    )
    )


    )
Reply
  • Hi srinivas,

    on which action you want to remove the Section , if you want to just hide the section based on the action on the button then button value take as true save that to rule input and in the section using show When condition hide that section sample code

    a!formLayout(
    contents:{
    a!sectionLayout(
    showWhen:not(ri!input=true()),
    contents: {
    a!textField(
    label: "Risk 1",
    labelPosition: "ABOVE",
    placeholder: "<Insert a transaction Risk.>",
    value: "",
    saveInto: ""


    )
    }

    )
    },
    buttons:a!buttonLayout(
    primaryButtons:a!buttonWidget(
    label:"Remove",
    value:true,
    saveInto:{
    ri!input
    }
    )
    )


    )
Children
No Data