Skip to main content

string array, through Web Server, to ComboBox

4 replies [Last post]
rfm8
Offline
Joined: 2009-03-12
Points: 0

Hello all
I'm trying to create a drop-down list. I should get the contents to this list from a Web Service that sends me int[].
I have lot of problems:

first, when I'm trying to consume the web service in NetBeans, I get a lot of errors with the ArrayOfInt class that has created automatically after adding the web service to the MIDlet. It looks like a problem with NetBeans...

if I'm trying to add the web service with the wireless tool, it works fine.

then, I don't understand exactly how I should insert the contents to the ComboBox?

Please Help Me... This is a very important project that should be ready soon.
Many Many Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jaywayjohan
Offline
Joined: 2008-06-18
Points: 0

Have you tried my suggestion?

Regards
Johan

rfm8
Offline
Joined: 2009-03-12
Points: 0

Hi,
Thanks for your reply.

My biggest problem is that I don't know exactly how to import the array to the list, and make the list to be drop-down list.

Do you have some code example?

Thanks!

jaywayjohan
Offline
Joined: 2008-06-18
Points: 0

Hi,

it should look something like this:

[code]
form = new Form("DropDown");
String[] dropDownItems = { "Item 1", "Item 2" };
ChoiceGroup dropDown = new ChoiceGroup("My Drop Down", Choice.POPUP, dropDownItems, null);
form.append(dropDown);
[/code]

Regards
Johan

jaywayjohan
Offline
Joined: 2008-06-18
Points: 0

Hi,

I suppose that by ComboBox you mean javax.microedition.lcdui.List. In such case you could simply create a new String array that has the same size as the int array and copy the content. A simple solution that works.

Sorry but you need to tell a little bit more about the other problems in order to answer.

Regards
Johan