Announcement

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

    Blank Page

    Dear Sir/Madam,

    I am planning to build a new app on smartgwt framework, but it has been 2-3 days struggling with setting up a working environment and running a "hello world" project.
    Everything is running fine, but the output is a blank page on both explorer and chrome.

    I am using GWT 2.7.0, SmartGwt 6, jre 1.8 and working on Eclipse Neon 4.6.1

    On the xml file, I tried to inherit "com.smartgwt.SmartGwt" as well as SmartGwtNoScrip and SmartGwtNoScriptNoTheme. all resulting in an empty page.

    Also, please note that I have the same issue in super dev mode as welll.

    I have tried the option to have html with container that is loaded in my entry point java class, and the option of having an emtpy html body that only gets filled with canvas.draw.

    Note that I am getting no error at all.

    What am I missing in all the setup?

    Appreciate your kind and prompt support.

    Regards,

    Shady

    #2
    Hi shady.hanna,

    did you try to import the BuiltInDS project (with eclipse project file) from the Enterprise Edition Evaluation download?
    This is the most easy way to start IMHO. You can then strip unneeded code and or rename your project.

    Best regards
    Blama

    Comment


      #3
      Hi shady.hanna. Besides what Blama suggested (which I think also is the right way to start), here is a useful link to help you compiling and running your code.

      Comment


        #4
        Thank you carlossierra for the link, but I have a different working environment and I am not using Maven.

        Let me provide more details on my issue: I have started with the built-in web project of eclipse. When I run it using GWT alone, it works.

        However, when I added the smartgwt jar files, and inherited SmartGwt in my xml file, I was able to compile and run with no issues. However, the output is always a blank white page.

        This is the content of the onModuleLoad() method is shown below, and the body of my HTML file is empty.

        Code:
        VLayout main =  new VLayout();
         main.setWidth100();
         main.setHeight100();
         main.addMember(new Label("Test Label"));
         main.addMember(new Button("Test Button"));
        main.draw();
        I have also tried to use RootPanel.get("mainContainer").add(main) with a matching mainContainer in my HTML file with no success neither.

        This is the content of my xml file:

        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <!--
          When updating your version of GWT, you should also update this DTD reference,
          so that your app can take advantage of the latest GWT module capabilities.
        -->
        <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
          "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
        <module rename-to='shadznew'>
          <!-- Inherit the core Web Toolkit stuff.                        -->
          <inherits name='com.google.gwt.user.User'/>
            <inherits name="com.google.gwt.core.Core" />
            <inherits name="com.google.gwt.user.History" />
        
          <!-- Other module inherits                                      -->
          <inherits name="com.smartgwt.SmartGwtNoScriptNoTheme"/>
          
        
          <!-- Specify the app entry point class.                         -->
          <entry-point class='shadznew.client.ShadzNew'/>
        
          <!-- Specify the paths for translatable code                    -->
          <!--  source path='client'/> -->
          <!-- <source path='shared'/> -->
        
          <!-- allow Super Dev Mode -->
          <!--  add-linker name="xsiframe"/>-->
        </module>
        Again, your help will be much appreciated.

        Thanks.

        Shady

        Comment


          #5
          Hi shady.hanna,

          please show your html file as well (the one loading the ...nocache.js)

          Best regards
          Blama

          Comment


            #6
            Also, please show a screenshot of the network tab of your browser's F12 tools for a reload of your application and watch for errors in the Browser's Javascript console.

            Comment


              #7
              Hi Blama ,

              I have tried 2 versions of HTML as I explained before, once with empty body and one with "mainContainer" (and used RootPanel in the java client code).

              HTML with empty body:

              Code:
              <!doctype html>
              
              <html>
                <head>
                  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
              
                  <!--                                                               -->
                  <!-- Consider inlining CSS to reduce the number of requested files -->
                  <!--                                                               -->
                  <link type="text/css" rel="stylesheet" href="ShadzNew.css">
              
                  <!--                                           -->
                  <!-- Any title is fine                         -->
                  <!--                                           -->
                  <title>NavLink CC Pay</title>
                  
                  <!--                                           -->
                  <script type="text/javascript" language="javascript" src="shadznew/shadznew.nocache.js"></script>
                </head>
              
                <!--                                           -->
                <!-- The body can have arbitrary html, or      -->
                <!-- you can leave the body empty if you want  -->
                <!-- to create a completely dynamic UI.        -->
                <!--                                           -->
                <body>
              
                  <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
                 
                </body>
              </html>

              HTML with mainContainer:

              Code:
              <!doctype html>
              
              <html>
                <head>
                  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
              
                  <!--                                                               -->
                  <!-- Consider inlining CSS to reduce the number of requested files -->
                  <!--                                                               -->
                  <link type="text/css" rel="stylesheet" href="ShadzNew.css">
              
                  <!--                                           -->
                  <!-- Any title is fine                         -->
                  <!--                                           -->
                  <title>NavLink CC Pay</title>
                  
                  <!--                                           -->
                  <!-- This script loads your compiled module.   -->
                  <!-- If you add any GWT meta tags, they must   -->
                  <!-- be added before this line.                -->
                  <!--                                           -->
                  <script type="text/javascript" language="javascript" src="shadznew/shadznew.nocache.js"></script>
                </head>
              
                <!--                                           -->
                <!--                                           -->
                <body>
              
                   <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
                  <noscript>
                    <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
                      Your web browser must have JavaScript enabled
                      in order for this application to display correctly.
                    </div>
                  </noscript>
              
                  <h1>Welcome to NavLink Credit Card Payment</h1>
              
                  <table align="center">
                    <tr>
                      <td colspan="2" style="font-weight:bold;">Please login:</td>        
                    </tr>
                    <tr>
                      <td id="mainContainer"></td>
                    </tr>
                  </table>
                 
                </body>
              </html>
              Many Thanks.

              Shady

              Comment


                #8
                Hi shady.hanna,

                please have a look at the BuiltInDS.html file.
                You are missing:
                • isomorphicDir
                • load_skin.js (if using SmartGwtNoScriptNoTheme)
                • All SmartClient JS files (if using SmartGwtNoScriptNoTheme)
                This will for sure result in JS Errors and perhaps in HTTP 404s.

                Best regards
                Blama

                Comment


                  #9
                  Hi @Blama,

                  Thanks for your help. It is working now!

                  Comment


                    #10
                    Hi All,

                    I am trying to connect my smartgwt application to MsSql server 2012 using jtds driver.

                    I have downloaded jtds-1.3.1.jar and added it to my application build path.

                    I am trying to initiate the connection as follows:

                    Code:
                          try
                            {
                                Class.forName(DB_CONNECTION_DRIVER);
                            }
                            catch (ClassNotFoundException e)
                            {
                                errorFlag = true;
                                catchEvent = e.toString();
                            }
                            catch (java.lang.Exception __e)
                            {
                                errorFlag = true;
                                catchEvent = __e.toString();
                            }
                    where DB_CONNECTION_DRIVER = ""net.sourceforge.jtds.jdbc.Driver"

                    However, this is always generating java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

                    Appreciate your help.

                    Shady

                    Comment


                      #11
                      Hi shady.hanna,

                      are you using SmartGWT with a server component (Pro, Power, EE, EE Eval) or without (LGPL)?
                      In the former case, DB connect configuration is done in the server.properties file.
                      In the latter case, it is just a Java Servlet accessing MSSQL and your question will most likely be answered faster in Stack Overflow.

                      Besides of this suggestion, I can't help either.

                      Best regards
                      Blama

                      Comment


                        #12
                        Just saw you have created a new post as well. This is the better idea.

                        Best regards
                        Blama

                        Comment

                        Working...
                        X