Why not keep the fixed settings in a style class and just update the style attribute with the current value (utilizing an AttributeModifier)?

.Needle {
 z-index: 1;
 width: 2px;
 ...
}

<span wicket:id="needle" class="Needle" style="left: 20%;"/>

Seven Corners schrieb:
I have a control with a needle that moves.  The needle's value is continually
changing, so on a timer I ask the server its value and set its position with
the "left" CSS attribute, as in:

.Needle
{
  z-index: 1;
width: 2px; ...
  left: 20%;
}

I do have a bean that returns a percentage string for the value, and I have
verified I hit that getter when the update occurs.

It looks like I need to create an AttributeModifier for this object's style
attribute, and spit out ALL the style attributes in the model, not just the
value for the "left" style attribute.  I don't want to do that, because it
hard-codes irrelevant styles attributes and I might want to change them in
the future.

I could use an AttributeAppender, but wouldn't that just add a "left" to the
end of the "style" attribute, so that over time (the timer goes off every
minute), the "style" attribute would become a really long string?  Don't
want to do that either.

Is there some way just to tweak a single CSS attribute?

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to