Announcement

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

    Determine SmartGWT Version from Browser

    I know I can call isc.version to determine the SmartClient version and this is also the version that is shown in the Developers Console. Is there another way to show the SmartGWT version without having to explicitly call Version.getVersion() in my Java code, but from the browser.

    #2
    Open the Developer Console?

    Executing the JavaScript expression "isc.version" in the Developer Console (or any other way, eg Firebug) also works.

    Comment


      #3
      Originally posted by Isomorphic View Post
      Open the Developer Console?

      Executing the JavaScript expression "isc.version" in the Developer Console (or any other way, eg Firebug) also works.
      I know, that's what I said. But that's not the SmartGWT version. That shows the SmartClient version.

      Comment


        #4
        It ends up obfuscated at runtime. But you could create a global JavaScript method that calls Version.getVersion() via JSNI.

        Comment


          #5
          Originally posted by Isomorphic View Post
          It ends up obfuscated at runtime. But you could create a global JavaScript method that calls Version.getVersion() via JSNI.
          That's what I was afraid of.. I was trying to accomplish it without having to change the deployed runtime.

          Comment


            #6
            You don't need to change the deployed runtime.

            See this from the GWT docs.

            Comment


              #7
              Originally posted by sjivan View Post
              You don't need to change the deployed runtime.

              See this from the GWT docs.
              Thanks for the information. I tried that, but Firefox says "Syntax error" when I do:

              Code:
              $entry(@com.smartgwt.client.Version::getVersion());
              I tried frames[0].$entry(@com.smartgwt.client.Version::getVersion());

              But that also returns syntax error.
              Last edited by bwilkins30; 3 Apr 2013, 10:36.

              Comment


                #8
                Originally posted by bwilkins30 View Post
                Thanks for the information. I tried that, but Firefox says "Syntax error" when I do:

                Code:
                $entry(@com.smartgwt.client.Version::getVersion());
                I tried frames[0].$entry(@com.smartgwt.client.Version::getVersion());

                But that also returns syntax error.
                That's because there is a syntax error. You're missing a set of parens. Refer to the JSNI syntax in the GWT docs.

                Code:
                    public static native void exportStaticMethod() /*-{
                        $wnd.getSgwtVersion =
                                $entry(@com.smartgwt.client.Version::getVersion()());
                    }-*/;

                Comment


                  #9
                  Originally posted by sjivan View Post
                  That's because there is a syntax error. You're missing a set of parens. Refer to the JSNI syntax in the GWT docs.

                  Code:
                      public static native void exportStaticMethod() /*-{
                          $wnd.getSgwtVersion =
                                  $entry(@com.smartgwt.client.Version::getVersion()());
                      }-*/;
                  Ok, but this also fails from Firefox web console. I don't want to create a public static native void method in my WAR, I want to just execute JavaScript from Firefox's web console. I didn't paste the Java portion into the web console, just the $entry.. part. I even tried pre-ceding it with frames[0].$entry(..) but that didn't work either.
                  Last edited by bwilkins30; 3 Apr 2013, 11:05.

                  Comment


                    #10
                    I'm sorry, you had the right syntax earlier.

                    Code:
                    public static native void exportStaticMethod() /*-{
                            $wnd.getSgwtVersion =
                                    $entry(@com.smartgwt.client.Version::getVersion());
                        }-*/;
                    The extra parens would cause the method to execute while we just want to assign it to the function. I added the above method in my entry point's onModuleLoad() and called "getSgwtVersion()" from the FF web console and it correctly returned the SmartGWT version.

                    Comment


                      #11
                      Originally posted by sjivan View Post
                      I'm sorry, you had the right syntax earlier.

                      Code:
                      public static native void exportStaticMethod() /*-{
                              $wnd.getSgwtVersion =
                                      $entry(@com.smartgwt.client.Version::getVersion());
                          }-*/;
                      The extra parens would cause the method to execute while we just want to assign it to the function. I added the above method in my entry point's onModuleLoad() and called "getSgwtVersion()" from the FF web console and it correctly returned the SmartGWT version.
                      Thats good to know. However, I think you are missing my problem a bit. See, I can't change the WAR. It is deployed and running. How can I do this without changing the WAR? onModuleLoad is in the Java code that currently I am unable to change.

                      Comment


                        #12
                        What is the point of all this?

                        Do you suspect you've deployed an application where you've somehow mixed up the SmartGWT and SmartClient versions?

                        Comment


                          #13
                          Originally posted by Isomorphic View Post
                          What is the point of all this?

                          Do you suspect you've deployed an application where you've somehow mixed up the SmartGWT and SmartClient versions?
                          No, it is for our QA folks who do not understand code to certify deployed versions.

                          I could grepjar the smartgwt.jar but they want to see it in the GUI if possible.

                          Comment

                          Working...
                          X