Why not put these to into wicketstuff minies?

aditsu wrote:
nate roe wrote:
I've written a stateless auto-complete TextField by adapting Wicket's own
JavaScript and using a servlet for the back end.  I don't like the servlet
and I would like to instead use Wicket to serve the auto-complete
suggestions list, but I'm not sure how.


Well, I've just implemented a StatelessAutoCompleteTextField that works in
wicket directly :)
I used a similar technique to my StatlessAjaxLink described at
http://www.nabble.com/Stateless-AJAX-links-td20031309.html
Specifically, I copied AutoCompleteTextField and made some modifications:
- replaced the AutoCompleteBehavior with a StatelessAutoCompleteBehavior and
stored it in a field
- implemented ILinkListener and called the autocomplete behavior's respond
method from onLinkClicked
StatelessAutoCompleteBehavior extends AutoCompleteBehavior with the
following changes:
- getStatelessHint returns true
- getCallbackUrl returns a url constructed using ILinkListener.INTERFACE
- onBind calls getComponent().setOutputMarkupId(true) (just like
AbstractDefaultAjaxBehavior)

For the record, I'm using wicket 1.4-m3

Adrian

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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

Reply via email to