-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.5.5
-
None
-
windows 8, jdk 7, tomcat 7
While clicking on the 'Edit' button randomly for more than 4 or 5 times, the
list returned to combobox started to appear incorrectly.
The behavior like it would cache the selected item of previous binding for label.
When I print to the selected item of current binding, it display correctly.
Please refer to the attached MVVM example for details.
My current work around is to overwrite the onInitRender method of org.zkoss.zul.Combobox with below logic :
public void onInitRender(Event data) {
//Bug #2010389
removeAttribute("zul.Combobox.ON_INITRENDER"); //clear syncModel flag
final Renderer renderer = new Renderer();
final List<Object> subModel =
_model instanceof ListSubModel ? new ArrayList<Object>(): null;
final ListModel subset = syncModel(data.getData() != null ?
data.getData() : getRawText());
try {
int pgsz = subset.getSize(), ofs = 0, j = 0;
for (Comboitem item = getItems().size() <= ofs ? null: getItems().get(ofs), nxt;
j < pgsz && item != null; ++j, item = nxt)
if (subModel != null)
_subModel = subModel.toArray(new Object[subModel.size()]);
} catch (Throwable ex)
finally
{ renderer.doFinally(); } //added by cheong at 16/04/2014 to solve the caching problem
if (subModel.size() == 1)
//end added by cheong at 16/04/2014 to solve the caching problem
Events.postEvent("onInitRenderLater", this, null);// notify databinding load-when.
Events.postEvent(ZulEvents.ON_AFTER_RENDER, this, null);// notify the combobox when items have been rendered.
}