Announcement

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

    Creating custom DataSource: syntax of "HTML bootstrap" file?

    I am reading the http://www.smartclient.com/smartgwt/SmartGWT_Quick_Start_Guide.pdf , and trying to follow the http://www.smartclient.com/smartgwtee/showcase/#simple_custom_ds - neither of them explains how to determine what the contents of the "HTML bootstrap" file should be.

    If I copy the one from the http://www.smartclient.com/smartgwtee/showcase/#simple_custom_ds it contains this, which has to be changed, but how do I determine what I should use:

    Code:
    <script type="text/javascript" language="javascript"
    src="com.smartgwt.sample.showcase.Showcase.nocache.js"></script>
    (the "com.smartgwt.sample.showcase.Showcase.nocache.js" part cannot be correct for me.)

    thanks
    Paul

    #2
    These are core GWT (rather than SmartGWT) questions and you generally want to look at Google's docs on GWT for these. But in a nutshell, when you create a new GWT project a bootstrap .html file is created for you, with the right <script> sources. There's very little in these files, and little point in copying one from another project.

    Comment


      #3
      Thanks for quick reply; I searched in the GWT docs, and found this: http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#key_application_files, and after a bit recognized the generated file (the problem was that I didn't know that that HTML file in "/war" was called the "bootstrap" file).

      Then I could add the necessary element to specify my DataSource:
      <script src="sc/DataSourceLoader?dataSource=myLittleCustomDataSource"></script>

      When I run my app, I get this warning (no clue what it means):

      [WARN] 404 - GET /sc/DataSourceLoader?dataSource= myLittleCustomDataSource (127.0.0.1) 1405 bytes
      Request headers
      Host: 127.0.0.1:54204
      User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.21.11 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10
      Accept: */*
      Accept-Language: en-us
      Accept-Encoding: gzip, deflate
      Cookie: groupBy=None
      Connection: keep-alive
      Referer: http://127.0.0.1:54204/MyLittleCustomWidget.html?gwt.codesvr=127.0.0.1:54202
      Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1405

      Evidently there is some severe problem, since DataSource.get("myLittleCustomDataSource") returns null.

      Any idea where I should be looking for this problem? Eventually I will be trying the http://www.smartclient.com/smartgwtee/showcase/#simple_custom_ds, but evidently there is some set-up that I do not yet have right even to start that ...

      thanks
      Paul

      Comment


        #4
        Yes that's quite a severe error - you haven't installed the product yet! :)

        The docs for correctly adding SmartGWT EE to an existing project are here. If you've already been through some of these, the specific error is that you haven't installed the servlets in web.xml.

        If you weren't aware of these docs before now, best to take a step back and start by reading the QuickStart Guide.

        Comment

        Working...
        X