problème avec GWT-EXT

3 views
Skip to first unread message

hichem

unread,
May 5, 2008, 9:01:34 PM5/5/08
to Google TN
bonjour, je suis entrain d'utiliser le GWT-EXT avec une manipulation
client/serveur

j'ai mis en évidence mes panel et je voudrai les remplir à partir du
serveur


- j'ai créée les deux interface ParsingXMLInterAsync et
ParsingXMLInter
- j'ai crée la classe ParsingXMLInterImpl pour implémenter la fonction
getAllChildren dans le serveur
- j'ai créée mon panel dans la fonction onModuleLoad ( )
- et j'ai fini par créer la fonction qui fait appel a getAllChildren,
cette fonction est la suivante:

public void remoteGreeting( final Panel panel) { //je passe le Panel
en paramètre
ParsingXMLInterAsync greetingService = (ParsingXMLInterAsync)
GWT.create(ParsingXMLInter.class);
ServiceDefTarget endpoint = (ServiceDefTarget) greetingService;
String moduleRelativeURL = GWT.getModuleBaseURL()+"getAllChildren";
endpoint.setServiceEntryPoint(moduleRelativeURL);
AsyncCallback callback = new AsyncCallback (){
public void onFailure(Throwable caught) {
System.out.println(caught.getMessage());
}
public void onSuccess(Object result) {
// la fonction getAllChildren
retourne un ArrayList
ArrayList listCateg =((ArrayList) result);
for(int i=0;i<listCateg.size();i++){
CheckBox ch = new CheckBox(listCateg.get(i).toString());
ch.setName(listCateg.get(i).toString());
listCheck.add(ch);
//remplissage du panel
panel.add(ch);
}

}
};
greetingService.getAllChildren("categories", callback);
}

cette fonction na pas réussi a remplir le panel
mais si j'utilise un RootPanel ça marche à merveille
si quelqu'un pourrai m'aider un peu, je suis a bout de nerf.

Ahmed.K

unread,
May 6, 2008, 12:22:17 PM5/6/08
to Google TN
salut mon sauveur, c'est a mon tour de te sauver

en faite il te manque juste une ligne apres le remplissage du panel
cette ligne représente une reload du panel


public void remoteGreeting( final Panel panel) { //je passe le Panel
en param�tre
ParsingXMLInterAsync greetingService = (ParsingXMLInterAsync)
GWT.create(ParsingXMLInter.class);
ServiceDefTarget endpoint = (ServiceDefTarget) greetingService;
String moduleRelativeURL = GWT.getModuleBaseURL()+"getAllChildren";
endpoint.setServiceEntryPoint(moduleRelativeURL);
AsyncCallback callback = new AsyncCallback (){
public void onFailure(Throwable caught) {
System.out.println(caught.getMessage());
}
public void onSuccess(Object result) {
// la fonction getAllChildren
retourne un ArrayList
ArrayList listCateg =((ArrayList) result);
for(int i=0;i<listCateg.size();i++){
CheckBox ch = new CheckBox(listCateg.get(i).toString());
ch.setName(listCateg.get(i).toString());
listCheck.add(ch);
//remplissage du panel
panel.add(ch);
// il temanque juste cette
ligne
Viewport viewport = new
Viewport(panel);
}

}
};
greetingService.getAllChildren("categories", callback);
}

et voila ,j'espére que ca marchera

hichem

unread,
May 6, 2008, 2:59:18 PM5/6/08
to Google TN
salut Ahmed

tu me sauve la vie
j'ai ajouté la ligne Viewport et ca marché
thaaaaaaaanks
Reply all
Reply to author
Forward
0 new messages