0

combobox loading

asked 2010-05-04 09:17:35 +0800

shamna gravatar image shamna
84 1

Hi

I have an array which is getting loaded into the database. But inthe box no item is visible. How is it that we can make the first item in the array to be selected in the combo??? plz help

delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2010-05-04 09:38:32 +0800

YamilBracho gravatar image YamilBracho
1722 2

Please, show the code you are using...

link publish delete flag offensive edit

answered 2010-05-04 09:42:21 +0800

houcine gravatar image houcine
108 1 1

combo.setSelectedIndex(0);

link publish delete flag offensive edit

answered 2010-05-04 13:24:30 +0800

shamna gravatar image shamna
84 1

Hi
sorry .
what i meant was that array is getting loaded into the combobox. I need to display the first element in the combo.

link publish delete flag offensive edit

answered 2010-05-04 22:28:15 +0800

shamna gravatar image shamna
84 1

hi

combo.setModel(new myListModel(obj.visits));

I m loading the array like the code given above. but i want the first item to be selected;

link publish delete flag offensive edit

answered 2010-05-05 08:37:18 +0800

YamilBracho gravatar image YamilBracho
1722 2

As houcine said before...

link publish delete flag offensive edit

answered 2010-05-05 09:00:25 +0800

rminfo gravatar image rminfo
21

have you tried:
combo.setSelectedIndex(0);

link publish delete flag offensive edit

answered 2010-05-05 09:01:53 +0800

shamna gravatar image shamna
84 1

yes i tried ...
its not working

link publish delete flag offensive edit

answered 2010-05-05 09:09:20 +0800

houcine gravatar image houcine
108 1 1

It's like this:

for (objet elem:list) {
Comboitem item = new Comboitem(elem);
combo.appendChild(item);
}
combo.setSelectedIndex(0);
}

link publish delete flag offensive edit

answered 2010-05-05 09:13:19 +0800

shamna gravatar image shamna
84 1

I have a button in by zul file. When I click that button, array in a class file is getting loaded to the combobox. But nothing is selected . How can i do that???
plz help ....urgent..

link publish delete flag offensive edit

answered 2010-05-05 09:29:18 +0800

shamna gravatar image shamna
84 1

what is this 'elem'???

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2010-05-04 09:17:35 +0800

Seen: 319 times

Last updated: May 05 '10

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