Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
rajtechnocraft
Contributor III
Contributor III

Help required to write a macro on Listbox

Hi Members,

Just wanted help to consolidate 5 applications into main application

I have 1 main application and 5 seperate applications.

In main application i have created a list box which contains the name of these 5 applications.

Listbox

App1

App2

App3

App4

App5

What i want is when a user selects any one of these applications from a list box he should be able to navigate to the desired application.

Iwant a script(Macro) on listbox selection to call an application.

I did this thru button and wrote macros .It works fine but the buttons are consuming space in my application.

So i used list box object but not sure how to write a macro on listbox to call these applications on selection.

Would be thankful to you experts if you can help me with this.

Raj.

1 Solution

Accepted Solutions
Not applicable

Hi Raj,

Plz find the attached zip folder containing a solution for you.

I have used the same files given by jykang to illustrate.

The functionality of using a macro on listbox has been implemented.

Just use the  "RadioButton_SelectionUsingUserClickAction.qvw" to see the solution.

Rgrds,

Abhinava

View solution in original post

16 Replies
jykang0638
Partner - Contributor III
Partner - Contributor III

Hi Raj,

You can use OnSelect event or OnChange event of the list box field at the Field Event Tiggers -  similar to where you were doing through a button.

You can find Field Event Trigers in Document Properties - Triggers tab.

Good luck!

rajtechnocraft
Contributor III
Contributor III
Author

Hi ,

Thanks for responding but how do i add all 5 applications in the add actions button.

I am stuck over here.

In buttons i could add mavcros seperately as i had individula button for each application..

Here i don't as i have a single list box which contains all 5 applications as data element.

And when the user selects any 1 application from list box he should be able to navigate to the desired application.

I know a variable has to be used which will link to List box and keep track of user selection but variable Listbox and user selection how to integrate i am not getting the macro.

jykang0638
Partner - Contributor III
Partner - Contributor III

Hi,

I will assume your field name of list box as AppName.

In the OnSelect event of Document Properties' Field Event Triggers, select AppName and then click Add Actions(s) button of OnSelect.

In the Actions window, select Add - External (Action Type) - Launch (Action) sequently.

In the Application text box, put the expression like the below.

=If(Count(distinct AppName) = 1, 'Your Application Path' & AppNmae & '.qvw')

I hope this will be help you.

rajtechnocraft
Contributor III
Contributor III
Author

Hi Abhinav

Attached is the folder.

Listbox Folder

jykang0638
Partner - Contributor III
Partner - Contributor III

I am really sorry I couldn't carefully check and test the behavior of trigger.

Some of actions such as Export, Launch, Open URL, Open QlikView Document in the External are not available as document and sheet trigger.

Therefore, you have to use a object's(button or text object) event with the list box.

I will attach a sample app but now I can't attach a file because of company security policy.

jykang0638
Partner - Contributor III
Partner - Contributor III

I am going to attach two sample apps achiving your goal.

Check the description on the each app.

I hope these will be help you.

Thanks.

Not applicable

Hi Raj,

Plz find the attached zip folder containing a solution for you.

I have used the same files given by jykang to illustrate.

The functionality of using a macro on listbox has been implemented.

Just use the  "RadioButton_SelectionUsingUserClickAction.qvw" to see the solution.

Rgrds,

Abhinava

rajtechnocraft
Contributor III
Contributor III
Author

Thanks alot for your efforts and time and sending the application

Highly appreciated

rajtechnocraft
Contributor III
Contributor III
Author

Thanks alot for your efforts and time and sending the application Highly appreciated