0

Combobox item lost [closed]

asked 2017-07-21 20:42:29 +0800

Ildelian gravatar image Ildelian
3 2

I put a item in a ComboBox on the doAfterCompose:

Comboitem item = new Comboitem();
item.setValue(user);
item.setLabel(user.getName);
this.usuario.appendChild(item);
this.usuario.setSelectedIndex(0);
this.usuario.setSelectedItem(item);

This works well and i can see the item charged and selected in the window, but when i execute one action of the window and go inside any controller method's, the Combobox "usuario" exists, but has no SelectedItem and no items:

usuario.getSelectedItem()
     null

 usuario.getItems()
     (org.zkoss.zk.ui.AbstractComponent$Children) []

The Combox is defined in the zul:

<combobox width="245px" id="usuario"
                                buttonVisible="false" autodrop="true" />
delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cor3000
close date 2017-11-29 18:45:52

Comments

can you please provide a reproducing example on http://zkfiddle.org/ also please state your exact version e.g. 6.x.y

cor3000 ( 2017-07-26 07:27:45 +0800 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-11-29 17:47:55 +0800

Ildelian gravatar image Ildelian
3 2

updated 2017-11-29 17:48:23 +0800

I have solved it. In another code, the Combobox Model was overwritten. I change it and the problem disappear.

link publish delete flag offensive edit

Comments

thanks for the update, much appreciated!

cor3000 ( 2017-11-29 18:45:13 +0800 )edit

Question tools

Follow
2 followers

RSS

Stats

Asked: 2017-07-21 20:42:29 +0800

Seen: 17 times

Last updated: Nov 29