1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    19
    Vote Rating
    0
    TOMMYZHANG is on a distinguished road

      0  

    Default how to add a widget in a AsyncCallback Method to a extral widget

    how to add a widget in a AsyncCallback Method to a extral widget


    public class Gwt_test2 implements EntryPoint {
    public void onModuleLoad() {

    final ContentPanel aC =new ContentPanel();
    GreetingServiceAsync.Util.getInstance().getTransLastDay(new AsyncCallback<dataUtil>(){
    @Override
    public void onFailure(Throwable caught) {

    com.google.gwt.user.client.Window.alert("dfdf");
    }
    @Override
    public void onSuccess(dataUtil result) {

    aC.add(new Button("dsfsdf"));
    }});

    RootPanel.get().add(aC);

    }
    }

    this is my code example.i want to add a button in the onseccess() method to cp(a contentpanel which difined in onModuleLoad()method ),but it didnot work .the widget button had not appeared in contentpanel cp.
    so how can i do if i want be add a widget to cp?
    thanks!


    tommy

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Location
    India, Chennai
    Posts
    30
    Vote Rating
    0
    suresh.sivanantham is on a distinguished road

      0  

    Default try dis....

    try dis....


    Code:
    public class Gwt_test2 implements EntryPoint {
    public void onModuleLoad() {
     
     final ContentPanel aC =new ContentPanel();
      GreetingServiceAsync.Util.getInstance().getTransLastDay(new AsyncCallback<dataUtil>(){
      @Override
      public void onFailure(Throwable caught) {
        
       com.google.gwt.user.client.Window.alert("dfdf");
      }
      @Override
      public void onSuccess(dataUtil result) {
        
       aC.add(new Button("dsfsdf"));
       aC.layout();
      }});
      
      RootPanel.get().add(aC);
      
     }
    }
    call layout() after u add any components to contentPanel.... or setLayoutOnChange(true) for content panel.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Location
    Hyderabad,INDIA
    Posts
    8
    Vote Rating
    0
    aechannaveen is on a distinguished road

      0  

    Default


    yeah it solved mine too..thanks a lot

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi