interface within interface


 when I click on reject it should pop up the below screen (comments) and hide the above form with buttons (cancel/approve/reject)









and when I click on cancel for this 2nd interface , I need to get 1st interface again with  3 buttons hiding the comment form(above form)


Can someone help me with the code please

  Discussion posts and replies are publicly visible

Parents
  • Try using this code, I believe this will suites your use case with showWhen property, 

    PS: you can use if else for the same scenario, just stack the sectionLayouts (Interface1, Interface2) and check or any one condition for pressed button.

    a!localVariables(
      /*pressed button variable, default value have to be there for showing 1st interface*/
      local!pressedButton: "cancel",
      a!sectionLayout(
        contents: {
          /*Interface 1*/
          a!sectionLayout(
            contents: {
              a!boxLayout(
                label: "Some form",
                contents: {
                  a!textField(label: "Comments", readOnly: true),
                  a!textField(label: "Start Date", readOnly: true),
                  a!textField(label: "End Date", readOnly: true),
                  a!textField(label: "Emial", readOnly: true),
                  
                }
              ),
              a!buttonLayout(
                primaryButtons: {
                  a!buttonWidget(label: "approve"),
                  a!buttonWidget(
                    label: "reject",
                    value: "reject",
                    saveInto: local!pressedButton
                  )
                },
                secondaryButtons: { a!buttonWidget(label: "cancel") }
              )
            },
            showWhen: local!pressedButton = "cancel"
          ),
          /*Interface 2*/
          a!sectionLayout(
            contents: {
              a!boxLayout(
                label: "Some form",
                contents: {
                  a!paragraphField(label: "Comments", readOnly: true)
                }
              ),
              a!buttonLayout(
                primaryButtons: {
                  a!buttonWidget(
                    label: "cancel",
                    value: "cancel",
                    saveInto: local!pressedButton
                  ),
                  a!buttonWidget(label: "submit")
                }
              )
            },
            showWhen: local!pressedButton = "reject"
          )
        }
      )
    )
      

Reply Children
No Data