Hi,

I have encountered a situation where I would like to add more than one
behavior to a component. One example is that of a tooltip where I need a
header contributor to load some javascript and an attibute to contain the
tooltip text.

In wicket you can do this by adding two behaviors to a component. To support
this more generically I have developed a CompositeBehavior that allows one
to combine several behaviors in one.

I have attached an example for a tooltip. The solution consists of the
following classes:

  - CompositeBehavior: The basic composite behavior class
  - LocalizedCompositeBehavior: The composite behavior class that
  supports lazy addition of behaviors. this is useful in case localization is
  used which requires the parent component to be known. At construction of the
  behavior this might not be known so this component allows subclasses to
  create localized behaviors by implementing the createLocalizedBehaviors()
  method. This methods is called as soon as the composite behavior is bound to
  a component.
  - TooltipBehavior: Behavior that adds tooltips. This behavior requires
  attribute modifiers as well as header contributions.

Would something like this be useful to add to the wicket core?

Cheers
 Erik

Attachment: behavior.jar
Description: application/jar

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to