Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide and Shows objects together

hello,

I have a graph that works with two input, I would like to show the two input fields only when the graph is open and hide them when the graph is closed. What expression can I use in the Condition to show input fields ?

Many thanks

13 Replies
Not applicable
Author

I spent a little more time on this this morning and I am convinced that it is not usable.

When minimizing an object, the OnActivate macro triggers before the object is actually minimized. Therefore, it seems impossible to have anything happen when an object is minimized. I think some OnMinimize and OnMaximize functions are needed in future versions. You can test this out by adding an OnActivate sub containing a message box to an object. When you try to minimize the object, the box will pop up while the object is still maximized. In this case, it seems impossible to even minimize the object.

The IsMaximized flag doesn't seem to do anything. I set up an if...then that set a variable when IsMinimized, IsMaximized or neither. I never got the IsMaximized to fire. It was either IsMinimized or the default.

The method I would use instead is to disable the minimize/maximize buttons on the object and use a button to hide/show the objects instead. This eliminates the need to use the OnActivate and IsMinimized items. If you want to get really tricky, you can use transparent buttons to make it seem like the Minimize/Maximize functionality is working. I have attached a sample. There is a transparent button over the minimized object and a transparent button over the minimize button on the maximized object. All of the objects have a Conditional Show. To Hide/Show, we just change the variable.

johnw
Champion III
Champion III

I agree that this doesn't seem possible without an external trigger like a button. Once you click on the object and the macro runs, you can minimize and maximize and many times as you want, and it won't execute the macro again.

In your example, you need to put the buttons in the top layer. Otherwise, if you click on the chart, it will move in front of the button, and everything will stop working.

Not applicable
Author

Thanks John! The layer is an easy property to forget about.

In a real application, I would probably get rid of the transparent buttons and use one button that could hide or show based on the current state (also using a dynamic label). It is quite a bit easier to develop and maintain while requiring about the same effort from the end users.

Not applicable
Author

Thanks a lot,

I will use button as you suggest, thanks.