SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

Page variable binded to boolean doesn't work

Josephrezende
Explorer
0 Kudos

Any page variable binded as boolean works, if i have two containers and bind them to a boolean state, one false and the other true, and bind a button to change the variable on click it does no work

3 REPLIES 3

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

It's not clear to me what you mean:

  • "two containers and bind them to a boolean state" - do you mean you bind the Visible property to the boolean variable?
  • "one false and the other true" - you have 2 variables? Or you use a formula with a NOT operation?
  • "two containers" - one inside the other, parallel? one after each other?

Is the scenario you have 2 containers you want to bind its Visible property to a variable and then click to show one, then the other? 




--------------
See all my blogs and connect with me on Twitter / LinkedIn

Josephrezende
Explorer
0 Kudos

Hello Dan,

Sorry for the confused report, I'll send print to help illustrate what i want to say:

I have a variable called pageVars.booleanVar with the initial value = true

Screenshot_24.png

 My canvas has a photo, 2 containers (one with a spinner and the other with the credentials input) and a button:

Screenshot_27.png

I binded the variable to the spinner container visibility and the inverse value to the login container visibility so when show one don't show the other

Screenshot_22.png

Screenshot_23.png

 After I binded a flowfunction to invert the variable when tap on the button and a toast with "Done" after:

Screenshot_25.png

but when tapping the button nothing works, even setting the function to set the variable to false, still don't work:

Screenshot_26.png

And the toast doesn't pop up, but if i use an appVars it works.

I tried to share a screen record i did but i don't have permission to do that...

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

I was able to do exactly what you wanted with the page variable. I even created the third-party authentication, which I assume you used, and created it with those components/page. Not sure what is happening for you. 

When you say nothing happens, do you see the spinner and the login screen at the beginning? Can you show with Alert the value of the boolean (you'll have to use a formula and IF function)?




--------------
See all my blogs and connect with me on Twitter / LinkedIn