You're not using a valid array constructor...To do so would look
something like this:
SuggestBox[] countries = new SuggestBox[]{new
SuggestBox(countryOracle)};
However that just creates an array w/ a single SuggestBox in it.
Since you indicate the
user will potentially want to add an unknown number of countries you
need a data structure that
will support doing so...array obviously does not. So, use a List:
List<SuggestBox> userCountries = new ArrayList<SuggestBox>();
userCountries.add(new SuggestBox(countryOracle));
On Nov 10, 3:15 pm, "seven.reeds" <[email protected]> wrote:
> Hi,
>
> I am trying to play with SuggestBox in a small test. I am not a Java
> wizard though. In my test i have an oracle that holds all the
> countries in the world. The form I am building will ask for a country
> as a SuggestBox. Now, If I want the person filling out the form to
> enter all of the countries they have visited then it seems to me I
> need to define the suggestBox something like:
>
> SuggestBox[] countries = new SuggestBox[](countryOracle);
>
> I am told that I need to add an expression in the "new SuggestBox[]"
> but i can not know the number of elements in advance.
>
> How do I do this? Is there a better way?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.