PDA

View Full Version : Selection approach with actions and toolbar



Chau
15 Dec 2009, 4:34 AM
Hi!

We are trying to use actions as items in a toolbar - works fine so far :). But we want to be able to programmatically select an item in the toolbar. An example would be a group of actions, which can be toggled and we want to select which one is toggled and fire the corresponding action.

Looking at the API, we haven't been able to determine how to approach this problem. Can anyone tells us how we should go on?

Regards, Casper

Chau
16 Dec 2009, 1:26 AM
Hmm... no answers :-/. If You think my question is wrongly phrased, please say so if it will help us get on the right track. I will gladly try to extend my post. :)

/Casper

CrazyEnigma
16 Dec 2009, 9:18 AM
This is a matter of a design decision.

The function per se does not have to be tied to an item (like a globally referenced method, not what I would do), so you can programmaticly call it if you know where the function resides, similarly, this same function can be called from the item.

Alternatively, you can call the function if the function resides in the item, by traversing the object tree or setting an id and getting the object by id, and then firing the method.