-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I want to render list of data in combobox for which auto drop is set to true. The data I will fetch from database and prepare a collection list of an java bean. In that java bean I have two variables value, label. I will set values to these two variables while fetching from database itself. Now I want to render this collection in a combobox.
Can anyone suggest how to achieve this ?
thanks, Mangapathi
See these two link it will help you to resolve the issue... zk-combobox-with-selectoption
Hi joshi, thanks for your response. I have a class which extends GenericForwardComposer<component>. In this class I had written a common method to fill the combobox without using renderer(just appeneding items). I am using this class as parent class for all my controller classes. I will invoke this method from respective controller to fill the comboboxes. Now I want to apply the atuodrop option. For doing this I had modified my code as below
public void fillComboBox(Combobox combobox, List<ValueLabel> list) {
combobox.setModel(new SimpleListModel(list) {
protected boolean inSubModel(Object key, Object value) {
String idx = key.toString();
ValueLabel myItem = (ValueLabel)value;
return idx.length() > 0 && myItem.getLabel().startsWith(idx);
}
});
combobox.setItemRenderer(new ComboitemRenderer () {
public void render(Comboitem item, Object data, int count) throws Exception {
ValueLabel valueLabel = (ValueLabel)data;
item.setLabel(valueLabel.getLabel());
item.setValue(valueLabel.getValue());
}
});
}
But the above code is not working.
Hi Joshi, I am not getting any issue, the execution was entering into inSubModel method but not going into the render method. Why it was skipping at that line I didnot understand. Is there any thing wrong in my above code.
Hi Joshi, I had checked and printed the values in log, values are getting printed. but after inSubModel method execution was not entering into render method.I put a debug point in render method also.
Mangapathi ( 2013-06-07 13:30:38 +0800 )editHi Joshi, thanks for your suggestions, I got resolved the issue. Code cleanup is the problem.
Mangapathi ( 2013-06-14 07:13:04 +0800 )editAsked: 2013-06-07 09:04:31 +0800
Seen: 20 times
Last updated: Jun 07 '13
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
MVVM tab box - delay @load until tab pane displayed?
mvvm, load or save with after or before for seach command
how to fire an event when a variable value loaded through VM
is there any event trigger from zk component on binding ?
ZK team plans to dispose of Composer EventQueues no longer in scope? [closed]