Toggle not working

i created a toggle for a panel to close some elements if clicked again. case 1 and 2 behave the way i would expect and i set txt on a box to “1”. case 3 triggers because now the text on the widget matches the case. i tried setting everything to IF and else if. curious why the 3rd case would fire?

sample.rp (610.7 KB)

Hi! Can you point me to the code you are talking about? E.g., which widget is it in. I don’t see anything labeled Case 3 anywhere.

(You can also just post a screenshot of your condtions.)

Hi joseph
in the original file i had to delete a couple of things that had names - i realize i uploaded a second attempt - below is the original file with with the 3 cases. its on the dynamic panel “dropdown”. i also added a wait “1000” so its clearer whats happening. thanks for taking a look.

sample.rp (611.6 KB)

Hi!

Every IF is always evaluated (to test if it’s true or false) regardless of what condition preceded it. An Else is evaluated only if the previous condition evaluated as false.

Case 3 is executing because the text on the box is 1. Is the issue that you are not expecting for the value to be 1 by the time Case 3 is evaluated?

so i tried the IF at first thinking that the conditions were evaluated only based on the initial click. so if i click, and the value vClick is 0, then only the conditions where vClick is true, at that moment of click would be executed (since vClick is change to 1 after the initial click, it wouldn’t execute until the second click when true).

is also tried the ELSE IF with the same logic. same results basically.

your information is helpful knowing it runs down the list of conditions and will execute based on the changing parameters

any suggestions appreciated