I want to enable or disable the button when index of container object change.
e.g. container object contains bar and pie charts , when pie chart is selected ,
button to change group bar chart into stack bar chart should be disable and vice versa.
i can enable or disable this button by checking currently active index of container obeject,
by using SingleObjectActiveIndex property. but i'm not getting where should i fire this trigger(macro).
Is there any event which can track when Index Of Container Object changes..
Please sugegst some ideas, how should i achieve the same?
Solved! Go to Solution.
I fired the trigger, with your macro code, on the trigger page of the sheet, there you can trigger a even on activating an object (CT01). This works fine!
But would be nice if Qlikview can make triggers on the object, tabs etc.
You can use container properties to find the object id of the object it contains.
Go to API Guide(C:\Program files\Qlikview\Documentation) in your computer and visit Automation Example sheet.
class = IcontainerProperties and Member is Containedobject.
When you click on this you will find the example too.
Hope this will help you.
Kaushik, thank you for concern.
I think, I've nt explained my probem properly.
I'm able to get contained objects of Container,
below is my macro code and it is working properly:
Set ContainerObj= ActiveDocument.GetSheetObject("CT01") '
'get index of currently active tab/object of container
'get the button object which is use to switch bar chart between group->stack and vice-versa
set button =ActiveDocument.GetSheetObject("BU01")
set prop = button.GetProperties
if activeIndex=0 then 'if Container displays Bar chart
prop.EnableCondition.v = "1"
else 'if container displays Pie chart
prop.EnableCondition.v = "0"
this code do the work, but i'm not getting from where should i fire(trigger) trigger this macro.
I hope , this time i'm clear..
First thing place this code in between this two lines
All you have to do is create a button.
Go to properties of button -> Action Tab -> Click on Add Action -> Select External -> Select Macros -> Assign the macro name.
This will sove your problem.
I forget to include Sub and End Sub in above mentioned code.
but i've used it in my code.
I don't want to trigger this code on any button, when user changes object in the container object only then it should be fired.
please refer attached screen shot.
gone throug your example , but this is not the one i really wanted.
also i didn't find any container object in it.
please refer the attached app.
hope u are aware of Container Object in QV10.
Let me tell you what i undertood from your explaination.
You want to hide group button when you click on pie chat and you want it to be back when you click on barchart.
According to this i have sent you an example where i tried to do the same without container object.
The reason of not using container was you cant have any action on the objects placed in container.
Your understanding is totally correct Kaushik.
I know that Objects placed in Container do not have any action..
but accroding to my requirement, I have to Use Container object.
So need some workaround for this.
Anyone, any idea?
I am also interested in this behavior,
How to set trigger on tab selection of a container.
Abhijit, I could not reuse your macro code, as it fails with the following error message:
Object doesn't support this property or method: 'ContProp.SingleObjectActiveIndex'
I could not find this property as well from the API Guide.