Search Results

Search found 2 results on 1 pages for 'stuff22'.

Page 1/1 | 1 

  • CloseHandler<Window> and Window.ClosingHandler() working differently in IE

    - by stuff22
    It seems that CloseHandler and Window.ClosingHandler() are not working or are not triggering the events in the same way under IE as opposed to Firefox. Window.addWindowClosingHandler(new Window.ClosingHandler() { @Override public void onWindowClosing(ClosingEvent event) { event.setMessage(message); } Window.addCloseHandler(new CloseHandler<Window>() { @Override public void onClose(CloseEvent<Window> event) { //Window.alert("debug1"); if(recordId!=null){ DatabaseQueryServiceAsync dbQueryService = DatabaseQueryService.Util.getInstance(); dbQueryService.releaseRecordLock(recordId, new AsyncCallback<String>() { @Override public void onFailure(Throwable arg0) { } @Override public void onSuccess(String arg0) { } }); } } }); }); For example, the ClosingHandler under IE displays the message when I swap a panel within within my widget. This does not occur in Firefox. The CloseHandler doesn't seem to trigger at all when the window closes in IE, but does so in firefox. The interesting thing to point out there, is that when I put a Window.alert("debug1") message in the addCloseHandler() method it DOES run the callback below, but as soon as I remove it, the callback doesn't happen. In firefox it works and runs the callback in both situations. So, I'm basically pulling my hair out not really understanding what's going on. Any help would be greatly appreciated. Thanks.

    Read the article

  • Can I mix declarative and programmatic layout in GWT 2.0?

    - by stuff22
    I'm trying to redo an existing panel that I made before GWT 2.0 was released. The panel has a few text fields and a scrollable panel below in a VerticalPanel. What I'd like to do is to make the scrollable panel with UIBinder and then add that to a VerticalPanel Below is an example I created to illustrate this: public class ScrollTablePanel extends ResizeComposite{ interface Binder extends UiBinder<Widget, ScrollTablePanel > { } private static Binder uiBinder = GWT.create(Binder.class); @UiField FlexTable table1; @UiField FlexTable table2; public Test2() { initWidget(uiBinder.createAndBindUi(this)); table1.setText(0, 0, "testing 1"); table1.setText(0, 1, "testing 2"); table1.setText(0, 2, "testing 3"); table2.setText(0, 0, "testing 1"); table2.setText(0, 1, "testing 2"); table2.setText(0, 2, "testing 3"); table2.setText(1, 0, "testing 4"); table2.setText(1, 1, "testing 5"); table2.setText(1, 2, "testing 6"); } } then the xml: <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:mail='urn:import:com.test.scrollpaneltest'> <g:DockLayoutPanel unit='EM'> <g:north size="2"> <g:FlexTable ui:field="table1"></g:FlexTable> </g:north> <g:center> <g:ScrollPanel> <g:FlexTable ui:field="table2"></g:FlexTable> </g:ScrollPanel> </g:center> </g:DockLayoutPanel> </ui:UiBinder> Then do something like this in the EntryPoint: public void onModuleLoad() { VerticalPanel vp = new VerticalPanel(); vp.add(new ScrollTablePanel()); vp.add(new Label("dummy label text")); vp.setWidth("100%"); RootLayoutPanel.get().add(vp); } But when I add the ScrollTablePanel to the VerticalPanel, only the first FlexTable (test1) is visible on the page, not the whole ScrollTablePanel. Is there a way to make this work where it is possible to mix declarative and programmatic layout in GWT 2.0?

    Read the article

1