AttributeModifier has the ability to add the attribute if not already
present f you use the following constructor:
public AttributeModifier(final String attribute, final boolean
addAttributeIfNotPresent, final IModel replaceModel)

personally i prefer the SimpleAttributeModifier which always adds /
replaces the attribute, but like the name suggests it is pretty simple
and requires the attribute value upfront. If your attribute value is
changing all the time you need a modifier that accepts a model, like
AttributeModifier.

Maurice

On Tue, Mar 18, 2008 at 10:49 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> you are talking about adding something to raw markup - eg markup that
>  is not attached to any component? you can use IMarkupFilter for that
>
>  -igor
>
>
>
>
>  On Tue, Mar 18, 2008 at 2:42 PM, hjuturu <[EMAIL PROTECTED]> wrote:
>  >
>  >  Hi All
>  >  In wicket we can use AttributeModifier or AttributeAppender to make 
> changes
>  >  to already existing attributes . But is there anyway we can add a new
>  >  attribute to markup using wicket API
>  >
>  >  e.g : if i have <textarea id="123">jhsakjhas</textarea>
>  >
>  >  i would like to add a class attribute
>  >  <textarea id="123" class="stylefortext">jhsakjhas</textarea>
>  >
>  >  This attribute has to be done dynamically and shouldnt exist upfront
>  >
>  >  Thanks
>  >  Haritha
>  >  --
>  >  View this message in context: 
> http://www.nabble.com/Add-attributes-to-markup-tp16131148p16131148.html
>  >  Sent from the Wicket - User mailing list archive at Nabble.com.
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  >  For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to