-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We have a combobox and it has some 100 comboitems.
When we select the drop-down button, it initially displays 19 items, for remaining we need to use vertical scroll-bar to navigate and view accordingly.
But, we need to limit the drop-down have only 10 items initially, instead of 19.
Any help is appreciated.
Thank you.
Code to Reproduce:
<zk> <window border="normal"> <combobox> <comboitem label="Item1" sclass="word-wrap" /> <comboitem label="Item2" sclass="word-wrap" /> <comboitem label="Item3" sclass="word-wrap" /> <comboitem label="Item4" sclass="word-wrap" /> <comboitem label="Item5" sclass="word-wrap" /> <comboitem label="Item6" sclass="word-wrap" /> <comboitem label="Item7" sclass="word-wrap" /> <comboitem label="Item8" sclass="word-wrap" /> <comboitem label="Item9" sclass="word-wrap" /> <comboitem label="Item10" sclass="word-wrap" /> <comboitem label="Item11" sclass="word-wrap" /> <comboitem label="Item12" sclass="word-wrap" /> <comboitem label="Item13" sclass="word-wrap" /> <comboitem label="Item14" sclass="word-wrap" /> <comboitem label="Item15" sclass="word-wrap" /> <comboitem label="Item16" sclass="word-wrap" /> <comboitem label="Item17" sclass="word-wrap" /> <comboitem label="Item18" sclass="word-wrap" /> <comboitem label="Item19" sclass="word-wrap" /> <comboitem label="Item20" sclass="word-wrap" /> <comboitem label="Item21" sclass="word-wrap" /> <comboitem label="Item22" sclass="word-wrap" /> <comboitem label="Item23" sclass="word-wrap" /> <comboitem label="Item24" sclass="word-wrap" /> <comboitem label="Item25" sclass="word-wrap" /> <comboitem label="Item26" sclass="word-wrap" /> <comboitem label="Item27" sclass="word-wrap" /> <comboitem label="Item28" sclass="word-wrap" /> </combobox> </window> </zk>
Hi baskaraninfo,
I'm not sure about this but take a look at this thread and this smalltalk from Jumper to get some idea on using ListModel.getSubModel(). Let me know if that doesn't solve your problem.
Thanks
- Ashish
Thank you Ashish for your reply.
Its different thing. If we use SimpleListModel, at any time, we will have only the limited rows displayed irrespective of its actual items. To change it, we need to extend and write our own custom class.
I don't want to limit the comboitems loading in Combobox. I just want to reduce the combobox popup items initially shown on drop-down list with vertical scroll bar as-need-basis.
I have achieved a work-around by setting height to combobox drop-down height.
Reference to this thread and there's a temp work around.
http://www.zkoss.org/forum/listComment/16099
And you could test it here : http://zkfiddle.org/sample/3cjn7lt/1-A-workaround-for-setting-combobox-s-height
And there's a feature request for it, if you need it , please left your comment there ,
we will check if we could add it in future version.
http://sourceforge.net/tracker/?func=detail&aid=3300329&group_id=152762&atid=785194
Asked: 2010-04-22 06:03:21 +0800
Seen: 503 times
Last updated: Jun 12 '11