Announcement

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

    Canvas.getByID() returns null

    Hello all,

    I'm using SmartGWT 2.4 and I'm trying to follow the "How do I use screens created in Visual Builder with Smart GWT?" steps from http://forums.smartclient.com/showthread.php?t=8159 thread, but even if I tried in different ways, the Canvas.getById() returns null.

    Can you please suggest a different approach, or is there a setup that I have to make so that the canvas will contain the data from the xml file generated by VB?

    Thank you in advance,
    Driftdone

    #2
    It's a working approach, no need for a different one. Instead, post details of exactly what you're doing and what's going wrong.

    Comment


      #3
      I followed the exact steps, and, on the onLoad method from the default project example, Which I overwrited, I tried to get any Canvas, but all my tries returned null

      Comment


        #4
        Your talking about a known working method and reporting it doesn't work for you. There's nothing we can tell you until you post more details.

        Comment


          #5
          First of all, after downloading the GWT sdk and plugin for eclipse, I downloaded the smartgwtee-2.4\samples projects, and from here, I used the built-in-ds project to test the features of smartGWT, I overwritten the onModuleLoad() method from BuildInDS.java, i added the <script = ""> line in the body of the BuiltInDS.html, pointing to a jsp file that contains the code generated by VB.
          Secondly, I tried using Canvas.getByID() in the onModuleLoad() like this:
          Code:
           public void onModuleLoad() {
                 Canvas.getById("Tab1");
              }
          where Tab1 is a known ID from the generated page, but it returns null.

          Am I doing something wrong or can you perhaps help me with a working project sample using this feature of smartGWT?

          Thank you,
          Driftdone

          Comment


            #6
            Make sure you're script tag includes the saved VB screen after your application code (no cache.JS file), not before.

            Any further problems, make sure the URL to the .jsp is correct and you see data being returned if you use Firebug to inspect the response.

            Comment


              #7
              The script tag is after my application code.

              I cannot see data returned, using Google Chrome Developer Tools, I only see the exact code written in the html file.

              Can you please help me with a working project sample using this technology/features?

              Thank you in advance,
              Angel

              Comment


                #8
                As previously indicated, use Firebug.

                Comment

                Working...
                X