(CCing laszlo-dev)
This is our stopgap solution to make CSS a bit more dynamic for the new
components - so yes, it is intentional. Clearly the docs need updating.
Can you file an improvement for this at http://jira.openlaszlo.org/ ?
It should be fairly performant - it will reapply all styles, but it's
careful to only call setAttribute() for values that have changed. I'm
sure there's room for improvement, but it's working well enough for our
purposes so far. Let us know how it works for you!
Regards,
Max Carlson
OpenLaszlo.org
On 8/17/10 11:02 AM, Danielle Wheeler wrote:
Hi Max,
I have an OpenLaszlo CSS question for you. Say I have the following:
<canvas>
<stylesheet>
text[styleClass="gray"] {
color: #666666;
}
text[styleClass="red"] {
color: #ff0000;
}
</stylesheet>
<text fgcolor="$style{'color'}" text="This is styled text">
<attribute name="styleClass" type="string" value="gray"/>
</text>
</canvas>
If I change the 'styleClass' attribute to 'red' at runtime, the styles update
accordingly. Is this intended? I would like to use this behavior for Webtop,
but I can't find it documented anywhere. I'm also curious how performant it is,
since it appears to reapply all styles in the node's hierarchy, even ones it's
not using.
Thanks,
Danielle