PDA

View Full Version : Can I change all instances in a class?


AndrewD
03-30-2009, 05:34 AM
<tool id="very"/>
<tool id="foo"/>
<tool id="bar"/>

A mousedown on "very" selects it. How can I "deselect" "very" when "foo" is clicked? Is there a way in OL to say "AllInstancesInThisClassButThis.showUp()" ?

Barring that, does something like "tool.showUp()" exist to address all instances?

Cheers,

Andrew.

kmeixner
03-30-2009, 07:56 AM
Hi,

You could set up all of the instances to listen for a value, eg:

<canvas>

<attribute name="thevalue" />

<tool id="very" onclick="canvas.setAttribute('thevalue', 'veryclicked')" />
<tool id="foo" lastclicked='${canvas.thevalue}' />
<tool id="bar" lastclicked='${canvas.thevalue}' />

</canvas>

Note: you would have to extend the tool class to add the lastclicked attribute.

Kevin

ptw
04-01-2009, 06:17 AM
Do you know about [selectionmanager](http://www.openlaszlo.org/lps4.2/docs/reference/lz.selectionmanager.html)?