You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Chang <da...@yahoo.com> on 2010/06/16 07:37:57 UTC

How to remove css class from a component?

Hello,

I add a CSS class to component dynamcially the following way:

inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));

How can I remove this CSS class in java code?

Best!


      

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


Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Thanks for the explanation! All the best.


--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 2:10 AM
> On Wed, Jun 16, 2010 at 1:05 AM,
> David Chang <da...@yahoo.com>wrote:
> 
> > >>Use a model like it's intended?
> >
> > You mean I should use AbstractReadOnlyModel?
> >
> > >>protected void onBeforeRender() {
> >    super.onBeforeRender();
> >    inputComponent.add(new
> SimpleAttributeModifier("class", true, new
> > AbstractReadOnlyModel<String>() {
> >        public String getObject()
> {
> >            return
> inputComponent.getFeedbackMessage() != null
> > ? "errorField" : "";
> >        }
> >    });
> > }
> >
> > There is no such constructor
> forSimpleAttributeModifier.
> >
> > Thanks.
> >
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> wrote:
> >
> > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > Subject: Re: How to remove css class from a
> component?
> > > To: users@wicket.apache.org
> > > Date: Wednesday, June 16, 2010, 1:52 AM
> > > On Wed, Jun 16, 2010 at 12:48 AM,
> > > David Chang <da...@yahoo.com>wrote:
> > >
> > > > Jeremy, glad to hear from you!
> > > >
> > > > My situation is a little different. The CSS
> class is
> > > added in the following
> > > > way. Please see the following code.
> > > >
> > > >        protected void
> > > onBeforeRender() {
> > > >
> > > super.onBeforeRender();
> > > >
> > > if (inputComponent.getFeedbackMessage() != null)
> {
> > > >
> > >
> > >    inputComponent.add(new
> > > AttributeAppender("class",
> > > > new Model<String>("errorField"), "
> "));
> > > >
> > >    } else {
> > > >
> > >         // how to
> remove CSS class
> > > here??
> > > >
> > > }
> > > >        }
> > > >
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> > > wrote:
> > > >
> > > > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > > > Subject: Re: How to remove css class
> from a
> > > component?
> > > > > To: users@wicket.apache.org
> > > > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > > > Date: Wednesday, June 16, 2010, 1:40
> AM
> > > > > onComponentTag(...) {
> > > > > tag.remove("class");
> > > > > }
> > > > >
> > > > > On Wed, Jun 16, 2010 at 12:37 AM, David
> Chang
> > > <david_q_zhang@yahoo.com
> > > > >wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I add a CSS class to component
> dynamcially
> > > the
> > > > > following way:
> > > > > >
> > > > > > inputComponent.add(new
> > > AttributeAppender("class", new
> > > > > > Model<String>("errorField"),
> " "));
> > > > > >
> > > > > > How can I remove this CSS class in
> java
> > > code?
> > > > > >
> > > > > > Best!
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > > For additional commands, e-mail:
> users-help@wicket.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Jeremy Thomerson
> > > > > http://www.wickettraining.com
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > > Use a model like it's intended?
> > >
> > > protected void onBeforeRender() {
> > >     super.onBeforeRender();
> > >     inputComponent.add(new
> > > SimpleAttributeModifier("class", true, new
> > > AbstractReadOnlyModel<String>() {
> > >         public
> String getObject() {
> > >         
>    return
> > > inputComponent.getFeedbackMessage() != null
> > > ? "errorField" : "";
> > >         }
> > >     });
> > > }
> > >
> > > --
> > > Jeremy Thomerson
> > > http://www.wickettraining.com
> > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> I wrote the code in gmail, without the benefit of
> autocomplete or compile
> errors.  What I'm really getting at is that you should
> *always* add the
> attribute modifier, which takes a model for the value to
> set the attribute
> to.  The model (either Model or AbstractReadOnlyModel,
> although the latter
> is more appropriate for this) should then return the
> correct value based on
> the logic
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jun 16, 2010 at 1:05 AM, David Chang <da...@yahoo.com>wrote:

> >>Use a model like it's intended?
>
> You mean I should use AbstractReadOnlyModel?
>
> >>protected void onBeforeRender() {
>    super.onBeforeRender();
>    inputComponent.add(new SimpleAttributeModifier("class", true, new
> AbstractReadOnlyModel<String>() {
>        public String getObject() {
>            return inputComponent.getFeedbackMessage() != null
> ? "errorField" : "";
>        }
>    });
> }
>
> There is no such constructor forSimpleAttributeModifier.
>
> Thanks.
>
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:
>
> > From: Jeremy Thomerson <je...@wickettraining.com>
> > Subject: Re: How to remove css class from a component?
> > To: users@wicket.apache.org
> > Date: Wednesday, June 16, 2010, 1:52 AM
> > On Wed, Jun 16, 2010 at 12:48 AM,
> > David Chang <da...@yahoo.com>wrote:
> >
> > > Jeremy, glad to hear from you!
> > >
> > > My situation is a little different. The CSS class is
> > added in the following
> > > way. Please see the following code.
> > >
> > >        protected void
> > onBeforeRender() {
> > >
> > super.onBeforeRender();
> > >
> > if (inputComponent.getFeedbackMessage() != null) {
> > >
> >
> >    inputComponent.add(new
> > AttributeAppender("class",
> > > new Model<String>("errorField"), " "));
> > >
> >    } else {
> > >
> >         // how to remove CSS class
> > here??
> > >
> > }
> > >        }
> > >
> > >
> > > Thanks!
> > >
> > >
> > > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> > wrote:
> > >
> > > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > > Subject: Re: How to remove css class from a
> > component?
> > > > To: users@wicket.apache.org
> > > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > > Date: Wednesday, June 16, 2010, 1:40 AM
> > > > onComponentTag(...) {
> > > > tag.remove("class");
> > > > }
> > > >
> > > > On Wed, Jun 16, 2010 at 12:37 AM, David Chang
> > <david_q_zhang@yahoo.com
> > > >wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I add a CSS class to component dynamcially
> > the
> > > > following way:
> > > > >
> > > > > inputComponent.add(new
> > AttributeAppender("class", new
> > > > > Model<String>("errorField"), " "));
> > > > >
> > > > > How can I remove this CSS class in java
> > code?
> > > > >
> > > > > Best!
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Jeremy Thomerson
> > > > http://www.wickettraining.com
> > > >
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> > Use a model like it's intended?
> >
> > protected void onBeforeRender() {
> >     super.onBeforeRender();
> >     inputComponent.add(new
> > SimpleAttributeModifier("class", true, new
> > AbstractReadOnlyModel<String>() {
> >         public String getObject() {
> >             return
> > inputComponent.getFeedbackMessage() != null
> > ? "errorField" : "";
> >         }
> >     });
> > }
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
I wrote the code in gmail, without the benefit of autocomplete or compile
errors.  What I'm really getting at is that you should *always* add the
attribute modifier, which takes a model for the value to set the attribute
to.  The model (either Model or AbstractReadOnlyModel, although the latter
is more appropriate for this) should then return the correct value based on
the logic

-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
>>Use a model like it's intended?

You mean I should use AbstractReadOnlyModel?

>>protected void onBeforeRender() {
    super.onBeforeRender();
    inputComponent.add(new SimpleAttributeModifier("class", true, new
AbstractReadOnlyModel<String>() {
        public String getObject() {
            return inputComponent.getFeedbackMessage() != null
? "errorField" : "";
        }
    });
}

There is no such constructor forSimpleAttributeModifier.

Thanks.



--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 1:52 AM
> On Wed, Jun 16, 2010 at 12:48 AM,
> David Chang <da...@yahoo.com>wrote:
> 
> > Jeremy, glad to hear from you!
> >
> > My situation is a little different. The CSS class is
> added in the following
> > way. Please see the following code.
> >
> >        protected void
> onBeforeRender() {
> >               
> super.onBeforeRender();
> >               
> if (inputComponent.getFeedbackMessage() != null) {
> >               
>      
>    inputComponent.add(new
> AttributeAppender("class",
> > new Model<String>("errorField"), " "));
> >             
>    } else {
> >               
>         // how to remove CSS class
> here??
> >               
> }
> >        }
> >
> >
> > Thanks!
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> wrote:
> >
> > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > Subject: Re: How to remove css class from a
> component?
> > > To: users@wicket.apache.org
> > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > Date: Wednesday, June 16, 2010, 1:40 AM
> > > onComponentTag(...) {
> > > tag.remove("class");
> > > }
> > >
> > > On Wed, Jun 16, 2010 at 12:37 AM, David Chang
> <david_q_zhang@yahoo.com
> > >wrote:
> > >
> > > > Hello,
> > > >
> > > > I add a CSS class to component dynamcially
> the
> > > following way:
> > > >
> > > > inputComponent.add(new
> AttributeAppender("class", new
> > > > Model<String>("errorField"), " "));
> > > >
> > > > How can I remove this CSS class in java
> code?
> > > >
> > > > Best!
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Jeremy Thomerson
> > > http://www.wickettraining.com
> > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> Use a model like it's intended?
> 
> protected void onBeforeRender() {
>     super.onBeforeRender();
>     inputComponent.add(new
> SimpleAttributeModifier("class", true, new
> AbstractReadOnlyModel<String>() {
>         public String getObject() {
>             return
> inputComponent.getFeedbackMessage() != null
> ? "errorField" : "";
>         }
>     });
> }
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jun 16, 2010 at 12:48 AM, David Chang <da...@yahoo.com>wrote:

> Jeremy, glad to hear from you!
>
> My situation is a little different. The CSS class is added in the following
> way. Please see the following code.
>
>        protected void onBeforeRender() {
>                super.onBeforeRender();
>                if (inputComponent.getFeedbackMessage() != null) {
>                         inputComponent.add(new AttributeAppender("class",
> new Model<String>("errorField"), " "));
>                 } else {
>                        // how to remove CSS class here??
>                }
>        }
>
>
> Thanks!
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:
>
> > From: Jeremy Thomerson <je...@wickettraining.com>
> > Subject: Re: How to remove css class from a component?
> > To: users@wicket.apache.org
> > Cc: "John Krasnay" <jo...@krasnay.ca>
> > Date: Wednesday, June 16, 2010, 1:40 AM
> > onComponentTag(...) {
> > tag.remove("class");
> > }
> >
> > On Wed, Jun 16, 2010 at 12:37 AM, David Chang <david_q_zhang@yahoo.com
> >wrote:
> >
> > > Hello,
> > >
> > > I add a CSS class to component dynamcially the
> > following way:
> > >
> > > inputComponent.add(new AttributeAppender("class", new
> > > Model<String>("errorField"), " "));
> > >
> > > How can I remove this CSS class in java code?
> > >
> > > Best!
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Use a model like it's intended?

protected void onBeforeRender() {
    super.onBeforeRender();
    inputComponent.add(new SimpleAttributeModifier("class", true, new
AbstractReadOnlyModel<String>() {
        public String getObject() {
            return inputComponent.getFeedbackMessage() != null
? "errorField" : "";
        }
    });
}

-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Zoltan, thanks for your input. The isTemporary works for me!

Best.

--- On Wed, 6/16/10, Zoltan Luspai <zl...@gmail.com> wrote:

> From: Zoltan Luspai <zl...@gmail.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 1:59 AM
> Hi,
> 
> Two alternative solutions:
> 
> - If you want the CSS class be appened only in one response
> then set the 
> AttributeAppender as "temporary"
> ...new AttributeAppender(...) {
>      @Override
>      isTemporary() { return true} }
> }...
> - Or disable/enable AttributeAppender as needed by
> overriding 
> isEnabled() method of it:
> ...new AttributeAppender(...) {
>      @Override
>      isEnabled() { return
> inputComponent.getFeedbackMessage() != null }
> }...
> 
> 
> Cheers,
> Zoltan
> 
> 
> On 06/16/2010 07:48 AM, David Chang wrote:
> > Jeremy, glad to hear from you!
> >
> > My situation is a little different. The CSS class is
> added in the following way. Please see the following code.
> >
> >     protected void onBeforeRender() {
> >        
> super.onBeforeRender();
> >         if
> (inputComponent.getFeedbackMessage() != null) {
> >        
>     inputComponent.add(new
> AttributeAppender("class", new
> Model<String>("errorField"), " "));
> >         } else {
> >        
>     // how to remove CSS class
> here??       
>     
> >         }
> >     }
> >
> >
> > Thanks!
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson<je...@wickettraining.com> 
> wrote:
> >
> >    
> >> From: Jeremy Thomerson<je...@wickettraining.com>
> >> Subject: Re: How to remove css class from a
> component?
> >> To: users@wicket.apache.org
> >> Cc: "John Krasnay"<jo...@krasnay.ca>
> >> Date: Wednesday, June 16, 2010, 1:40 AM
> >> onComponentTag(...) {
> >> tag.remove("class");
> >> }
> >>
> >> On Wed, Jun 16, 2010 at 12:37 AM, David
> Chang<da...@yahoo.com>wrote:
> >>
> >>      
> >>> Hello,
> >>>
> >>> I add a CSS class to component dynamcially
> the
> >>>        
> >> following way:
> >>      
> >>> inputComponent.add(new
> AttributeAppender("class", new
> >>> Model<String>("errorField"), " "));
> >>>
> >>> How can I remove this CSS class in java code?
> >>>
> >>> Best!
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>        
> >>
> ---------------------------------------------------------------------
> >>      
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>>        
> >>
> >> -- 
> >> Jeremy Thomerson
> >> http://www.wickettraining.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
> 
> 


      

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


Re: How to remove css class from a component?

Posted by Zoltan Luspai <zl...@gmail.com>.
Hi,

Two alternative solutions:

- If you want the CSS class be appened only in one response then set the 
AttributeAppender as "temporary"
...new AttributeAppender(...) {
     @Override
     isTemporary() { return true} }
}...
- Or disable/enable AttributeAppender as needed by overriding 
isEnabled() method of it:
...new AttributeAppender(...) {
     @Override
     isEnabled() { return inputComponent.getFeedbackMessage() != null }
}...


Cheers,
Zoltan


On 06/16/2010 07:48 AM, David Chang wrote:
> Jeremy, glad to hear from you!
>
> My situation is a little different. The CSS class is added in the following way. Please see the following code.
>
> 	protected void onBeforeRender() {
> 		super.onBeforeRender();
> 		if (inputComponent.getFeedbackMessage() != null) {
> 			inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));
> 		} else {
> 			// how to remove CSS class here??			
> 		}
> 	}
>
>
> Thanks!
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson<je...@wickettraining.com>  wrote:
>
>    
>> From: Jeremy Thomerson<je...@wickettraining.com>
>> Subject: Re: How to remove css class from a component?
>> To: users@wicket.apache.org
>> Cc: "John Krasnay"<jo...@krasnay.ca>
>> Date: Wednesday, June 16, 2010, 1:40 AM
>> onComponentTag(...) {
>> tag.remove("class");
>> }
>>
>> On Wed, Jun 16, 2010 at 12:37 AM, David Chang<da...@yahoo.com>wrote:
>>
>>      
>>> Hello,
>>>
>>> I add a CSS class to component dynamcially the
>>>        
>> following way:
>>      
>>> inputComponent.add(new AttributeAppender("class", new
>>> Model<String>("errorField"), " "));
>>>
>>> How can I remove this CSS class in java code?
>>>
>>> Best!
>>>
>>>
>>>
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>>      
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>        
>>
>> -- 
>> Jeremy Thomerson
>> http://www.wickettraining.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: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Jeremy, glad to hear from you!

My situation is a little different. The CSS class is added in the following way. Please see the following code.

	protected void onBeforeRender() {
		super.onBeforeRender();
		if (inputComponent.getFeedbackMessage() != null) {
			inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));
		} else {
			// how to remove CSS class here??			
		}
	}


Thanks!


--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Cc: "John Krasnay" <jo...@krasnay.ca>
> Date: Wednesday, June 16, 2010, 1:40 AM
> onComponentTag(...) {
> tag.remove("class");
> }
> 
> On Wed, Jun 16, 2010 at 12:37 AM, David Chang <da...@yahoo.com>wrote:
> 
> > Hello,
> >
> > I add a CSS class to component dynamcially the
> following way:
> >
> > inputComponent.add(new AttributeAppender("class", new
> > Model<String>("errorField"), " "));
> >
> > How can I remove this CSS class in java code?
> >
> > Best!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
onComponentTag(...) {
tag.remove("class");
}

On Wed, Jun 16, 2010 at 12:37 AM, David Chang <da...@yahoo.com>wrote:

> Hello,
>
> I add a CSS class to component dynamcially the following way:
>
> inputComponent.add(new AttributeAppender("class", new
> Model<String>("errorField"), " "));
>
> How can I remove this CSS class in java code?
>
> Best!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com