Re: List Box Issue with GWT 1.7

2009-09-07 Thread Robnauticus-

Hey Erik,

I must have missed the method.  Sorry I will try that one out.

Thanks!  Should be what I am looking for.

Thanks!
Rob



On Sep 7, 12:11 am, Erik  wrote:
> Maybe you should use :
>
> setItemSelected(int index, boolean selected)
>
>           Sets whether an individual list item is selected.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: List Box Issue with GWT 1.7

2009-09-07 Thread Robnauticus-

Thanks again Erik,

It is working!

Rob

On Sep 7, 12:11 am, Erik  wrote:
> Maybe you should use :
>
> setItemSelected(int index, boolean selected)
>
>           Sets whether an individual list item is selected.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: List Box Issue with GWT 1.7

2009-09-07 Thread Erik

Maybe you should use :

setItemSelected(int index, boolean selected)

  Sets whether an individual list item is selected.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



List Box Issue with GWT 1.7

2009-09-04 Thread Robnauticus-

Hello everybody!

Just a quick question about the best way to perform something.

I have an extended Listbox that I am populating from a
java.util.List.  My Listbox takes 2 List parameters, the complete list
and the list of selections .

I am looping through my lists one inside the other and telling the
listbox to setSelectedIndex(i) but the problem is that it will not
allow me to select multiple ones programmatically.  At the end of the
loop, only the last item is selected.

As of GWT 1.6 it seems they removed a method to allow multi-selections
to occur for some reason.

Excerpt from javadoc:
[quote]
void com.google.gwt.user.client.ui.ListBox.setSelectedIndex(int index)
Sets the currently selected index. After calling this method, only the
specified item in the list will remain selected. For a ListBox with
multiple selection enabled, see setItemSelected(int, boolean) to
select multiple items at a time.
[/quote]

That mentioned method does not exist anymore.  Now for the listbox to
be a mulit-select you must use the constructor.

[code]
private void prefillSelections() {
for (int i = 0; i < this.getItemCount(); i++) { // Loop - 
Listbox
items
for (int j = 0; j < this.selectedContents.size(); j++) 
{ // Loop-

// Selections
if 
(this.listContents.get(i).getListBoxEntryName().contains(

this.selectedContents.get(j).getListBoxEntryName())) {
// check on entry name from Data_BaseObj
this.setSelectedIndex(i);
}
}
}
}
[/code]

Any help for best practices or a suggestion?

Thanks for reading and help!
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---