Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    loading indicator at the startup of ShowCase

    Hi
    Since application loading like smartgwt showcase takes some time, I'd like to use the Loading Indicator like that one for the first page of Smartgwt, I looked into the Showcase.html and Showcase.java.
    I see the loading image in the Showcase.html is like this
    Code:
    <div id="loadingWrapper">
    <div id="loading">
        <div class="loadingIndicator">
            <!--<img src="images/pieces/48/cube_green.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>SmartGWT<br/>-->
            <img src="images/loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>SmartGWT<br/>
            <span id="loadingMsg">Loading styles and images...</span></div>
    </div>
    </div>
    I only see the following code fragment in Showcase.java.
    Code:
    RootPanel.get("loadingMsg").getElement().setInnerHTML("");
    This code only remove the loading message.

    How can I remove the loadingWrapper element all together.

    thanks
    -jason

    #2
    this has to do with html and DOM, but the answer to your question in GWT would be:

    Code:
    RootPanel.getBodyElement().removeChild(RootPanel.get("loadingWrapper").getElement());
    This is also what I am using and I think this should be done also in the Showcase as it's a "cleaner" solution.
    Last edited by mihai007; 30 Apr 2009, 00:43.

    Comment


      #3
      I have this kind of error when I reload the page in host mode
      Code:
       Uncaught exception escaped
      java.lang.AssertionError: A widget in the detach list was found not attached to the document. The is likely caused by wrapping an existing element and removing it from the document without calling RootPanel.detachNow().
      	at com.google.gwt.user.client.ui.RootPanel.detachWidgets(RootPanel.java:200)
      	at com.google.gwt.user.client.ui.RootPanel$1.onWindowClosed(RootPanel.java:221)
      	at com.google.gwt.user.client.Window.fireClosedImpl(Window.java:465)
      	at com.google.gwt.user.client.Window.fireClosedAndCatch(Window.java:456)
      	at com.google.gwt.user.client.Window.onClosed(Window.java:430)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      	at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
      	at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
      	at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
      	at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
      	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
      	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
      	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
      	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
      	at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
      	at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
      	at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
      Otherwise, it works perfect.

      thanks
      -jason

      Comment


        #4
        I think it has to do with the way you are building your application as the solution I gave in the earlier post doesn't give me any warnings/errors.

        Comment


          #5
          I've updated the Showcase class to do this.

          Thanks,
          Sanjiv

          Comment


            #6
            My approach to this is to hide the loading message after all the scripts are loaded in the html file by adding this line to the end of the body tag. My preference is to hide it in the same calling location.

            <script type="text/javascript">document.getElementById('loadingWrapper').innerHTML = '';</script>

            Comment

            Working...
            X