> I am making a ComboBox component that extends FormComponentPanel.  I did as
> you said, and I override getConvertedInput(), but the body of the method
> scans a List to find a matching item.  With only a few items, this isn't too
> bad, but I'm afraid of performance problems as the list size grows.  Also,
> that method is already called twice and I am planning on writing a Validator
> for it, which will cause it to be called at least three times per update
> cycle.  I was wondering if you could suggest a caching strategy for me to
> try?  I can store the converedInput on the Component, but what about
> cleaning up that cached value?  Will I need to worry about stale data being
> returned by getConvertedInput?  or will the Component's normal lifecycle
> protect me from that?

Good point. I didn't think about getConvertedInput being called
multiple times. I'm working on a refactoring now. Removing final from
getConvertedInput wasn't the smartest thing to do it turns out. I'm
thinking about making that method final again, and instead removing
final from convert (and rename that to convertInput) and add
setConvertedInput. You can then override convertInput and call
setConvertedInput with the new value, and be sure this method will
only be called once.

Eelco

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to