Wicket, how to lazily load DropDown options when clicked?

I have many DropDownChoice components with many elements in the form, and when loading the form I would like to display only the saved selected options. When a user clicks on DropDownChoice, I would like to ajax-upload a complete list of items on the fly.

Can this be done?

+5
source share
3 answers

Add OnChangeAjaxBehaviorto the dropdown component. Override the method onUpdateand add another component to the target. The selected value of the dropdown component is inside its model.

: Okey, , , . AjaxFormComponentUpdatingBehavior "onclick" . onUpdate . , , .

+2

, AjaxEditableLabel AjaxEditableChoiceLabel Wicket Extensions, , DropDownChoice Ajax. , .

0

, , <select> .

Better check out http://ivaynberg.github.com/select2/ or http://livedocs.dojotoolkit.org/dijit/form/FilteringSelect or any other JS-based component that can load parameters on demand via Ajax.

0
source

All Articles