Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a list box that i want to show/hide by a button. How do you do that
Ok, let me break it down here - i added explanation to the steps from my post above with the hope that it clarifies your doubt
Step 1: click Ctrl+Alt+V to bring up variables list, add a new variable called vHide and assign 0 to the value. - Here we are simply initiating a variable to be used as a flag based on which we will set the visibility of a list box.
Step 2: Create a button, in Properties go to Actions tab and add an "External" Action Type and select "Set Variable" and hit ok. In the Actions tab of properties, variable is vHide and Value should be =if(vHide=0,1,0). - Here we are toggling the flag using a single button. So if the vHide value is 0, then clicking the button will set it to 1 and if it is equal to 1 (when you click this button, the value changes to 1), then clicking the button again will set it to 0.
Step 3: In the list box properties, go to Layout tab and below Apply Theme button, select Conditional Show and type in vHide. - Typing in vHide as a condition basically is equal to saying if(vHide = 1, true, false). so in other words, we are saying that show the list box if vHide is equal to 1 else hide it.
The textbox in my most recent post is just to verify the value of vHide since you stated that the list box is not showing at all which basically means that the condition is not being met to display it. i hope this helps.
1) define a variable in the script (LET var = 0;)
2) add a button, in properties, actions -> add -> external -> set variable write in the upper box var and in the lower box write: =if(var=1,0,1)
3) at this point in the condizional display of the list box write var = 1
Let me know
use variables....so something like below:
click Ctrl+Alt+V to bring up variables list, add a new variable called vHide and assign 0 to the value.
Create a button, in Properties go to Actions tab and add an "External" Action Type and select "Set Variable" and hit ok. In the Actions tab of properties, variable is vHide and Value should be =if(vHide=0,1,0)
In the list box properties, go to Layout tab and below Apply Theme button, select Conditional Show and type in vHide.
You should be all set.
PFA
Massimo,
I cant open the qvw file. Can you post the script here
the variables and parameters need to be set in a few different places and is not one script that you set in your edit script window. follow the steps in my post above...that is pretty much what needs done.
Jsaradhi, I followed your instructions and now the issue is the list box is hidden at all times. Can we add another button that will show it? so there will be 2 buttons: one to show and another to hide.
you do not need two buttons. the list box is hidden because the condition was not met. so create a text box to display the value of vHide and set the value in the variables dialog box accordingly. do you want to post your qvw here? i can help take a look at it and let you know exactly what needs to be modified.
I am now beginning to understand the concept. if(vHide=0,1,0) Here, it means when the value assigned to variable vhide equals 0, the list box will show. if it is assigned some other value than 0, the list box will not show. Correct? Now how does adding a text box complete the process.? Can you please explain here
Ok, let me break it down here - i added explanation to the steps from my post above with the hope that it clarifies your doubt
Step 1: click Ctrl+Alt+V to bring up variables list, add a new variable called vHide and assign 0 to the value. - Here we are simply initiating a variable to be used as a flag based on which we will set the visibility of a list box.
Step 2: Create a button, in Properties go to Actions tab and add an "External" Action Type and select "Set Variable" and hit ok. In the Actions tab of properties, variable is vHide and Value should be =if(vHide=0,1,0). - Here we are toggling the flag using a single button. So if the vHide value is 0, then clicking the button will set it to 1 and if it is equal to 1 (when you click this button, the value changes to 1), then clicking the button again will set it to 0.
Step 3: In the list box properties, go to Layout tab and below Apply Theme button, select Conditional Show and type in vHide. - Typing in vHide as a condition basically is equal to saying if(vHide = 1, true, false). so in other words, we are saying that show the list box if vHide is equal to 1 else hide it.
The textbox in my most recent post is just to verify the value of vHide since you stated that the list box is not showing at all which basically means that the condition is not being met to display it. i hope this helps.