Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Macro to change Button ID

Hello,

I am trying to dynamically add a button to my Qlikview page using

set newbutton = ActiveDocument.ActiveSheet.CreateButton

set prop = newbutton.GetProperties

prop.Text.v = "Remove"

newbutton.SetProperties prop

The button gets added correctly but the trouble I am having is trying to set the ID of this new object.

I am also create a new text object and using the API I found that it is very easy to set the ID of this type of object using

set mytext = ActiveDocument.ActiveSheet.CreateTextObject

prop = mytext.GetProperties

prop.Layout.Frame.ObjectId = "Document\NewID"

prop.Layout.Text.v = Tot

mytext.SetProperties prop

Is there a similar way of doing the above for a button?

Many thanks for your help!

Tags (3)
1 Solution

Accepted Solutions

Re: Macro to change Button ID

Technically: For button Frame object can be accessed directly from properties not from Layout.

Check with this

prop.Frame.ObjectId="Your Dynamic ID"

Hope it helps

3 Replies
christian77
Valued Contributor

Re: Macro to change Button ID

Well, do it with a text object and assign an action to it. The only differences between buttom and text object is that the button does a little go down effect when you click on it and that it shows engraved text where there is no action assign to it.

good luck

Re: Macro to change Button ID

Technically: For button Frame object can be accessed directly from properties not from Layout.

Check with this

prop.Frame.ObjectId="Your Dynamic ID"

Hope it helps

Not applicable

Re: Macro to change Button ID

Thank you this is just what I was after!

Community Browser