Topic
5 replies Latest Post - ‏2013-01-10T20:33:36Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts
ACCEPTED ANSWER

Pinned topic Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

‏2013-01-07T20:22:26Z |
Hello,

I am using Worklight 5.0.5 and would like to use a dijit.form.Form widget within my app.

When I try adding a dijit.form.Form (This is done by dragging from the Palette view and dropping onto my design view.), build all and deploy the app, and then try to view the common browser version of it in a chromium browser, I get the following errors displayed in the console:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/apps/services/preview/tempApp/common/0/default/dijit/themes/dijit.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/apps/services/preview/tempApp/common/0/default/dijit/themes/claro/claro.css
wlclient init started worklight.js:1097
before: app init onSuccess worklight.js:1097
after: app init onSuccess worklight.js:1097
wlclient init success worklight.js:1097
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/apps/services/preview/tempApp/common/0/default/dijit/form/Form.js
Error
dojo.js:26
e.uid dojo.js:26

I am developing within eclipse indigo Version: 3.7.2 and Ubuntu 12.04 LTS. Attached is the html for the test project after adding the form. The only other changed I noticed is the addition of "dijit/form/Form" in the require of the dojoInit method within js/tempApp.js.

Any advice?

Note: In build-dojo.xml, Adding <include name="dijit/**"/> within the <patternset id="dojo.resources.loose-modules"> element does seemingly fix the problem. But from prior experiences this can cause more damage farther down the road and is not an ideal solution.

Thanks!
  • SystemAdmin
    SystemAdmin
    2327 Posts
    ACCEPTED ANSWER

    Re: Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

    ‏2013-01-08T19:29:52Z  in response to SystemAdmin
    Where did you find dijit.form.Form in the Palette? I don't see it, and I wouldn't expect to since its not a mobile widget.
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

      ‏2013-01-10T19:09:17Z  in response to SystemAdmin
      You can add more classes into the Palette by following these steps:
      Right click white space in Palette View
      Click Customize
      Uncheck the hide box for everything you want to add.
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

        ‏2013-01-10T19:31:15Z  in response to SystemAdmin
        OK, so I would expect you would have to modify dojo-build the way you did. Since form isn't a mobile widget, you are going to have to bring in a lot of things that aren't part of the normal build profile.
        • SystemAdmin
          SystemAdmin
          2327 Posts
          ACCEPTED ANSWER

          Re: Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

          ‏2013-01-10T20:03:05Z  in response to SystemAdmin
          Thank you for the response!

          Do you know of any documentation on the correct way to add new widgets to this build script?

          Thanks!
          Corbyn Salisbury
          • SystemAdmin
            SystemAdmin
            2327 Posts
            ACCEPTED ANSWER

            Re: Adding dijit.form.Form to Worklight App. causes numerous 404 Errors

            ‏2013-01-10T20:33:36Z  in response to SystemAdmin
            I'm not aware of anything beyond:

            http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/topic/com.ibm.worklight.help.doc/devref/c_anatomy_of_an_ibm_worklight_ap.html

            which uses an example of the charting widget.