Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

merry2018
Contributor II

Which Action start a Button

Hello everybody,

I'm looking for a way, which I can with an action press a button, so that I pressing the first button and the second is activated as well. I want not to press the secound as well, it sould be done with a Action directly after the first one.


I searched for action type selection but found nothing to select a button, or what type do I have to search for it?

Thank you for your idea:

Simulating a button press can be done only with a macro.

rem ** press button BU01 **

ActiveDocument.GetSheetObject("BU01").Press

and marcowedel it is because I have to check which Button is aktive, and that should be pressed.

Now I have it, with the following it working:

sub PressButtonUmsatz

      set wert = ActiveDocument.GetVariable("vWert_Menge") 

      if wert.GetContent.String = "Menge" then

            ActiveDocument.GetSheetObject("BU25").Press

      else

           ActiveDocument.GetSheetObject("BU03").Press

      end if

end Sub

Tags (3)
Labels (1)
1 Solution

Accepted Solutions

Re: Which Action start a Button

The simplest method (and also one that doesn't get you into trouble when running a macro document on a server) is to define two buttons with the same action list from the original button1 but different additional action lists from the possible active buttons, and display only one of them at a time depending on the value of variable vWert_Menge. You can use a Properties->Layout->Conditional Show expression to do this.

IMHO you shouldn't make it too complex.

4 Replies
splitcore
New Contributor III

Re: Which Action start a Button

Hi there!

Is there a reason you can't just add additional actions on the 1st button so it performs the actions of the 2nd button as well?

Regardless if you still wish to press the 2nd button with the 1st. The action to select on button 1 is Action Type: "External" and Action: "Run Macro". As per the above macro code just specify "PressButtonUmsatz" as the Macro name to execute with the button. The macro code should also be present in your qvw's "Edit Module" section.

Regards

merry2018
Contributor II

Re: Which Action start a Button

The reason is that after the 1st button I have to check wich 2nd button have to be e, so maybe the BU25 or BU03, therefore I can't do the Actions from the 2nd one to the 1st one.

Re: Which Action start a Button

The simplest method (and also one that doesn't get you into trouble when running a macro document on a server) is to define two buttons with the same action list from the original button1 but different additional action lists from the possible active buttons, and display only one of them at a time depending on the value of variable vWert_Menge. You can use a Properties->Layout->Conditional Show expression to do this.

IMHO you shouldn't make it too complex.

Highlighted
merry2018
Contributor II

Re: Which Action start a Button

Thank you for that idea!

Yes this I know already, because that Methode I use already for the second buttons.
In this dokument allready macros running, so that sould be not a Problem if there are one more.