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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar