I was perusing Wicket's Javadocs and I came across a link to an old
thread 

http://www.nabble.com/Why-add%28IBehavior%29-is-final--td7248198.html#a7
248198

Linked from

http://wicketstuff.org/wicket13doc/org/apache/wicket/Component.html#add(
org.apache.wicket.behavior.IBehavior)

The gist is that the originator of the mailing list thread was trying to
encapsulate the behavior of a TextField within a Panel and needed to
have final removed from the method add(IBehavior). This was needed so
that the Panel could delegate the call to the TextField. In the end the
final restriction was removed.

I am currently trying to do something similar to the original author and
am wondering why the same concession isn't extended to add(IValidator)
in FormComponent? I am trying to create a component that encapsulates a
label/input pair in a form and my initial approach was to create a
subclass of FormComponentPanel. It would be nice if calls to
add(IValidator) on that object could be delegated to its input member.

As an aside, I can see two approaches to accomplishing what I want in
general. The first is the direction I have been pursuing. I am
leveraging Wicket's component model so that the markup for this
component is entirely contained in one HTML file for ease of reuse and
customizability. The fact that add(IValidator) is final has made that
option more complex. The other approach would be to have a helper or
builder that takes the Form object and adds the Components to it. The
downside of that approach is that there is no centralized markup file
representing the label/input pair.

What approaches have Wicket users taken to accomplish similar tasks?

Thanks,
Larry

______________

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_____________

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

Reply via email to