I hear you... read the docs... "addAttributeIfNotPresent" :)

It seems odd that the AttributeModifier is under the org.apache.wicket package, 
but the SimpleAttributeModifier is under the org.apache.wicket.behavior 
package? They both extend AbstractBehavior.

I would have to agree with you... it does seem too broad. One of the aspects of 
Wicket that makes it enjoyable to program in is that they have kept its usage 
very simple!



-----Original Message-----
From: Al Maw [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 07, 2007 8:10 PM
To: users@wicket.apache.org
Subject: Re: Rendering a fieldset class attribute


William Hoover wrote:
> Is it better to use AbstractBehavior and override onComponentTag? 
> 
> I assume that the AttributeModifier is only for cases when the attribute 
> already exists in the markup, correct?

Well, given the javadoc I told you to read for the second parameter 
there, no. ;-)

It doesn't make much difference which you use.

AbstractBehavior is more direct and concise.

AttributeModifier is named such that people will find it.

I tend to use the former for what you're doing, and the latter if I 
already have a model kicking around.

There's also a SimpleAttributeModifier if you have a simple String, and 
an AttributeAppender if you wish to mess with what's currently there.

IMO, the API here is far too broad - we should just give people 
AbstractBehavior and tell them to get on with it, but hey ho.

Regards,

Al

---------------------------------------------------------------------
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