Re: Dynamically changing CSS style attribute

2009-02-24 Thread Thomas Mäder
Damn! I'm alway surprised about the turnaround times on this mailing list!
One nice thing about Wicket is that there are few privileged parties.
Usuallly you have a default implementation for some interface, but the
default implementation doesn't enjoy any special privileges. Eat your own
dogfood!

Thomas


On Tue, Feb 24, 2009 at 9:09 PM, Seven Corners  wrote:

>
> Ooh, that's a good idea, although I just got the JavaScript working to do
> exactly the same thing with an appendJavascript() call.
>
>
> svenmeier wrote:
> >
> > 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;
> >   ...
> > }
> >
> >
> >
> > 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
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22189563.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Wicket & Eclipse Consulting
www.devotek-it.ch
thomasmaeder.blogspot.com


Re: Dynamically changing CSS style attribute

2009-02-24 Thread Seven Corners

Ooh, that's a good idea, although I just got the JavaScript working to do
exactly the same thing with an appendJavascript() call.


svenmeier wrote:
> 
> 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;
>   ...
> }
> 
> 
> 
> 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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22189563.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Dynamically changing CSS style attribute

2009-02-24 Thread Thomas Mäder
If I have understood Mr. Heptagon right the needle position depends on
server side state. What I would do is look at the source of
AttributeModifier and do something similar, but just take the existing style
attribute and replace the "left" value (using an regex or such). If
something usable results, you could share the joy (CssStyleModifier.java?)

Thomas

On Tue, Feb 24, 2009 at 8:21 PM, Martijn Reuvers
wrote:

> Hello,
>
> As Martin says use javascript, if you really want it easy use jQuery,
> you can do something like $('#myElem').css( ... ); and do the
> calculation in javascript. Check the docs on the exact syntax
> (docs.jquery.com),
>
> Martijn
>
> On Tue, Feb 24, 2009 at 8:00 PM, Martin Makundi
>  wrote:
> > You could use javaScript
> > http://docstore.mik.ua/orelly/webprog/jscript/ch18_03.htm
> >
> > **
> > Martin
> >
> > 2009/2/24 Seven Corners :
> >>
> >> 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.
> >> --
> >> View this message in context:
> http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22187801.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Wicket & Eclipse Consulting
www.devotek-it.ch
thomasmaeder.blogspot.com


Re: Dynamically changing CSS style attribute

2009-02-24 Thread Sven Meier
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;
 ...
}



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



Re: Dynamically changing CSS style attribute

2009-02-24 Thread Seven Corners

Thanks for responding, but that link is closed to me, and I get this error
message:

"Sorry, but access to this page is closed now.  If you search study
materials or ebooks for cisco certification - request it in our Cisco Career
Certifications forum"

I'm fiddling right now with the JavaScript.  It looks like I'll have to
parse and tweak the style string and then set that attribute.

-- 
View this message in context: 
http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22188808.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Dynamically changing CSS style attribute

2009-02-24 Thread Martijn Reuvers
Hello,

As Martin says use javascript, if you really want it easy use jQuery,
you can do something like $('#myElem').css( ... ); and do the
calculation in javascript. Check the docs on the exact syntax
(docs.jquery.com),

Martijn

On Tue, Feb 24, 2009 at 8:00 PM, Martin Makundi
 wrote:
> You could use javaScript
> http://docstore.mik.ua/orelly/webprog/jscript/ch18_03.htm
>
> **
> Martin
>
> 2009/2/24 Seven Corners :
>>
>> 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.
>> --
>> View this message in context: 
>> http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22187801.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Dynamically changing CSS style attribute

2009-02-24 Thread Martin Makundi
You could use javaScript
http://docstore.mik.ua/orelly/webprog/jscript/ch18_03.htm

**
Martin

2009/2/24 Seven Corners :
>
> 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.
> --
> View this message in context: 
> http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22187801.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Dynamically changing CSS style attribute

2009-02-24 Thread Seven Corners

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.
-- 
View this message in context: 
http://www.nabble.com/Dynamically-changing-CSS-style-attribute-tp22187801p22187801.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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