Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can i add a functionality that my object will appear and hide on click of same command button like ON/OFF.
Thanks
Manish
Hi Manish,
You can create a variable, say vShowObject. Then create a button (or text object) and assign an action that says Set variable =if(vShowObject =1,0,1). Then use the Show Condition on the Layout tab of your object you want to show or hide and set it to vShowObject = 1. Play around with it. You can use the same logic to change the 'On' and 'Off' displayed.
--john
Hi Manish,
You can create a variable, say vShowObject. Then create a button (or text object) and assign an action that says Set variable =if(vShowObject =1,0,1). Then use the Show Condition on the Layout tab of your object you want to show or hide and set it to vShowObject = 1. Play around with it. You can use the same logic to change the 'On' and 'Off' displayed.
--john
see attachment
Hi John,
It will either ON or OFF to move from ON to OFF i need to change the value of variable manually.
What i want is on first click on command button my object will appear on second click it show disappear and again on click it appears like that.
attachment missing
I can see my attachment
it seems to due to some network issue it is not delivered properly,could you please attach it again.
ok
Hi Manish, what I attached does exactly as you wish; 1 click shows the object and the text on the button says "Hide". The next click hides the object and the text on the button says "Show". Each click of the button repeats the process. I can't think of a more simple and elegant solution than this.
Do exactly as I outlined.
1. Create variable vShowObject (or whatever name you desire)
2. Create button.
3. Set Button text: =if(vShowObject=1,'Hide','Show'). This alters the button text between Show and Hide.
4. Set button action: Set Variable, and set Variable field to vShowObject, then Value field to =If(vShowObject=1,0,1). This sets the variable from 0 to 1, and from 1 to 0, depending on its current state.
5. Create the object you want to show and hide.
6. Go to Layout tab of the desired object and Show Conditional and set it to vShowObject=1. This will then show the object when vShowObject equals 1. It hides it when it is not equal to 1.
Regards,
John
Hi Manish,
Please close this thread by selecting an answer as Correct or Helpful. Thanks!