0

Solved: Combobox selectItem

asked 2014-08-01 10:44:36 +0800

mock gravatar image mock
34 2

updated 2014-08-27 13:34:08 +0800

Hi,

I select a comboitem programmatically that works fine, but when I open the combobox the wrong item is selected. The crazy thing is when I print the selected index on the open event the index doesn't match with the focused comboitem shown in the combobox but with the comboitem I selected programmatically

I use zk 7.0.1

delete flag offensive retag edit

Comments

hi @mock, Can you provide the zul/controller on how you did it?

chillworld ( 2014-08-01 12:12:35 +0800 )edit

Is it possible that the problem is if i use an Id thats 45 characters long und the first 36 that there are some troubles

mock ( 2014-08-06 08:41:26 +0800 )edit

normally not, is it possible to make a small fiddle of it? Like this I personally have to less info to help you. (Don't see how you select programmaticly, I see your private method but not where it is called,...)

chillworld ( 2014-08-06 08:57:54 +0800 )edit

The problem in this case is that some comboitems have the same label.

mock ( 2014-08-27 11:31:12 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-04 07:24:49 +0800

mock gravatar image mock
34 2

updated 2014-08-04 08:23:38 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

hi,

zul:

<combobox id="cmbbxC" sclass="showcontact" readonly="true" 
    width="200px" placeholder="Edit..." />

controller:

public void onSelect$cmbbxC() {
    changed = true;
    System.out.println("SELCTED "+ cmbbxC.getSelectedIndex()); // correct index printed but wrong itme focused
}

private void fillParticipantCombobox(Combobox cmbbx, String cid, String name, String number) {
    Comboitem citem = new Comboitem(name);
    if (cid == null) {
        citem.setStyle("background-color:#d15b47; color:white;text-align:center;");
    }
    citem.setDescription(number);
    citem.setParent(cmbbx);
    citem.setId(cid + "-" + number.replace(" ", "") + "#*#" + UUID.randomUUID());
}
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-08-01 10:44:36 +0800

Seen: 20 times

Last updated: Aug 27 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More