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
There are numerous ways to configure in accordance with these requirements within a single interface.Have you followed any basic trainings yet in the Appian Academy?
yes , i have few basic knowledge , I tired doing it using showwhen but getting errors .can you please help
Perhaps the simplest way is to create the "popup" as you call it as a separate component within it's own Interface object, then call it from the larger interface with a showWhen variable passed to it, or inside an if() function like if(local!commenting, rule!APP_commentInterface([parameters]), {}).
You'll probably need to explain the errors that are happening when you try showWhen for us to help you further from there.
You can achieve this using local variables by saving a value in local variable when user click on buttons and based on saved value in local variable you can apply it in showwhen in interfaces.
If you're getting errors, it'd be helpful to post screenshots of the actual errors too, and describe what user action(s) lead to the error(s) in question, etc. Additionally it might be helpful for you to share your code (or at least relevant snippets) - and if you do, please be sure to use a Code Box.
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" ) } ) )
Thank you ,It worked