Hello World! for my GWT project I am using the library gwt-dnd for the
functionality of drag & drop. I have two lists box, in the left a list
of widget with data collected from the database. From db, I exstact
the object Person, that contains attributes:id, nome, cognome,email,
and I add these to the list:
public void onSuccess(List<Person> result) {
Iterator<Person> iter = result.iterator();
int i = 1;
while(iter.hasNext()){
i++;
Person item = iter.next();
dualListBox.addLeft(item.getId() + ") " +
item.getNome() +" " +
item.getCognome() +" (" + item.getEmail() + ")" ) ;
}
In the right list, I can drag the widget from the left. On this list I
do a query to save the data in database.
I want to add each Person in a Team, adding the "id" of the person and
the "id" of the Team in a table Person-Team. The id_Team is written
correctly in the table Person-Team, but the data of Person are not
captured well, then not properly sort of conversion from a widget
object.
I do like this:
ArrayList<Widget> widgetRight = dualListBox.getWidgetRight();
Iterator<Widget> iterWidget = widgetRight.iterator();
int indexSpace1, indexSpace2, indexParentesi1,indexParentesi2;
String dati;
while(iterWidget.hasNext()){
Widget item = iterWidget.next();
dati = item.toString();
indexSpace1 = dati.indexOf( " " );
indexSpace2 = dati.indexOf(" ",
indexSpace1+1);
programmerTO.setNome(dati.substring(indexSpace1+1,
indexSpace2 ));
indexParentesi1 = dati.indexOf("(",
indexSpace2+1);
programmerTO.setCognome(dati.substring(indexSpace2,
indexParentesi1-1));
indexParentesi2 = dati.indexOf(")",
indexParentesi1+1);
programmerTO.setEmail(dati.substring(indexParentesi1+1,
indexParentesi2));
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---