-
20 May 2009 4:39 AM #1
Can't show a window on "onSuccess" method
Can't show a window on "onSuccess" method
Is there any way to show a window or any other component on a "onSuccess" method?
I'm trying the following code and the window never show up!
Any ideas?Code:proxy.getServiceValue("br.com.dyad.infrastructure.service.LookupService", params, new AsyncCallback(){ public void onFailure(Throwable arg0) { Window.alert(arg0.getMessage()); } public void onSuccess(HashMap arg0) { Window wnd = new Window(); desktop.add(wnd); wnd.show(); } }
Thanks.
-
22 May 2009 4:38 AM #2
I'm not sure if this is what you want, but I had a similar issue with showing components created as a result of an RPC call. The key was to call layout() after adding.
Hope this helpsCode:public void onSuccess(ComponentData result) { Component c = createComponent(ComponentData); add(c); layout(); // Calling layout() on the parent LayoutContainer of the newly added Component }
-
22 May 2009 4:59 AM #3
Thanks for the tip, i already tried the layout method and still doens't show, i just figure out that i had some issues with my rpc call and the error never showed up on the console.
-
25 May 2009 4:42 AM #4
Hey!
at first it doesn't make sense to add the window to a desktop.
Second, maybe try to set some attributes before you show the window:
And are you sure that your call is even fired, breakpoint inside your success-method!Code:wnd.setLayout( new FitLayout() ); wnd.setModal( true ); wnd.setHeight(800); wnd.setWidth( 800 ); wnd.setBorders( true );


Reply With Quote