Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Hidden list box toggle

Hello,

I have a list box that will be locked and hidden.  I also have a button that I want to use to toggle the visibility of the list box.  I created a variable called "isVis" which is set to 1. 

I have the action on the button running a macro that has:

sub changeVis
     if isVis = 1 Then
          isVis = 2
     else
          isVis = 1
     end if
end sub

If anyone can tell me what is wrong with this that would be greatly appreciated!

Thank you,

Jeff

1 Solution

Accepted Solutions
Not applicable

Hidden list box toggle

The code below is similar to what you want and should lead you in the right direction. You can also show or hide a list box using the "Show - Conditional" on the Layout tab.

hth

Stephen

Sub ShowHide

set v = ActiveDocument.Variables("vReport")

if(v.GetContent.String)= "Crops" then

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "2", True

else

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "1", True

end if

end sub

2 Replies
Not applicable

Hidden list box toggle

The code below is similar to what you want and should lead you in the right direction. You can also show or hide a list box using the "Show - Conditional" on the Layout tab.

hth

Stephen

Sub ShowHide

set v = ActiveDocument.Variables("vReport")

if(v.GetContent.String)= "Crops" then

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "2", True

else

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "1", True

end if

end sub

Not applicable

Re: Hidden list box toggle

Stephen,

Thank you!  Adding the .SetContent and .GetContent  calls in worked! 

Regards,

Jeff

Community Browser