I want to be able to put checkboxes in the dropdown along with other text from compnent's model and user should be able to make selections by checking one or multiple check boxes.
Can some one give me a pointer?
Thanks a lot.
I want to be able to put checkboxes in the dropdown along with other text from compnent's model and user should be able to make selections by checking one or multiple check boxes.
Can some one give me a pointer?
Thanks a lot.
This can't be done with standard html select component.
With wicket you could implement a repeating view of checkboxes and add some style and javascript to the surrounding div to initially show only one element (define height and scrollability) and show more of the list when you click on the list.
Do you really need to use a dropdown? If your requirement is to have a list of selectable items which can be hidden, then you could do this in a couple of ways:-
Create a Wicket fragment containing checkboxes, text fields etc. The fragment can be made visible or invisible using an Ajax link or Javascript.
If you need to reuse your component between pages, then instead of using a fragment, consider putting the items in a panel. The panel can be made visible or invisible, as above.
If you are using jQuery (or wiQuery) you should take a look at already existing plugins. As already stated, this task can't be solved by Wicket alone.
For example, see http://wiki.jqueryui.com/w/page/12138056/Selectmenu or http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/index.html. Please note that I haven't used any of these myself.
However, to be honest, I think you ought to rethink your plan anyway. Just reading your description of the UI (selectable checkboxes and texts in a drop-down) makes me shudder quite a bit ;-)