You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by drf <da...@gmail.com> on 2011/04/06 08:26:44 UTC

AttibuteModifier question

Just as one can use 

component.add(new AttributeModifier("class", new Model("")));

to modify the css class for a component, is there a way to either 
1. get the existing class value, 
2. or alternativly to append a class to the existing css classes set for
that component, rather than replacing the existing ones.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttibuteModifier-question-tp3429987p3429987.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: AttibuteModifier question

Posted by vineet semwal <vi...@gmail.com>.
for 1) you can get that in oncomponenttag
for 2) use attribute appender

On Wed, Apr 6, 2011 at 11:56 AM, drf <da...@gmail.com> wrote:
> Just as one can use
>
> component.add(new AttributeModifier("class", new Model("")));
>
> to modify the css class for a component, is there a way to either
> 1. get the existing class value,
> 2. or alternativly to append a class to the existing css classes set for
> that component, rather than replacing the existing ones.
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttibuteModifier-question-tp3429987p3429987.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: AttributeModifier question

Posted by drf <da...@gmail.com>.
Looks like I've found the answer - AttributeAppendor


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-question-tp3429987p3429998.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: AttibuteModifier question

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
use AttributeAppender?

Ernesto

On Wed, Apr 6, 2011 at 8:26 AM, drf <da...@gmail.com> wrote:
> Just as one can use
>
> component.add(new AttributeModifier("class", new Model("")));
>
> to modify the css class for a component, is there a way to either
> 1. get the existing class value,
> 2. or alternativly to append a class to the existing css classes set for
> that component, rather than replacing the existing ones.
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttibuteModifier-question-tp3429987p3429987.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: AttibuteModifier question

Posted by Robert Dahlström <ro...@ongame.com>.
If you're outside of the onComponentTag you can do:
String cssClass = component.getMarkupAttributes().getString("class");

Regards
Robert

On 04/06/2011 08:36 AM, Wilhelmsen Tor Iver wrote:
>> 1. get the existing class value,
>
> Only when parsing the markup in onComponentTag().
>
> - Tor Iver
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: AttibuteModifier question

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> 1. get the existing class value, 

Only when parsing the markup in onComponentTag().

- Tor Iver

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