Topic
15 replies Latest Post - ‏2012-10-12T04:59:00Z by zelda.so
SystemAdmin
SystemAdmin
2327 Posts
ACCEPTED ANSWER

Pinned topic Sencha + Worklight

‏2012-09-21T07:02:51Z |
Hi,
Has any one done app using Sencha touch and worklight.
I recently started using sencha with worklight , designed an app but when i execute the app, it displays a white blank screen.
If someone has a running app please share so that i can how to use mvc framework with worklight.

Thanks,
Manjusha.
  • SystemAdmin
    SystemAdmin
    2327 Posts
    ACCEPTED ANSWER

    Re: Sencha + Worklight

    ‏2012-09-21T11:27:40Z  in response to SystemAdmin
    Yes, herea sample Worklight application built with Sencha Touch:

    IBM Worklight Starter application with Sencha (ZIP, 231KB)
    https://www.ibm.com/developerworks/mobile/worklight/getting-started/

    Could also be helpful/relevant:
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14867203
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Sencha + Worklight

      ‏2012-09-21T11:49:13Z  in response to SystemAdmin
      Thanks,
      I tried both the apps but when i execute them on my android device they give me a blank white screen.
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: Sencha + Worklight

        ‏2012-09-21T12:23:45Z  in response to SystemAdmin
        Can you try a couple of things?

        • Get the Android 2.2 SDK if you don't have it: (others work too, I just happen to have that one installed and tested it with that one)
        Relevant Picture: http://cl.ly/image/242S432u0A1l
        and make a new Android Virtual Device with it.

        • Android Virtual Device Manager > Select your AVD for 2.2 > Start… > [x] Wipe user data > Launch
        Relevant Picture: http://cl.ly/image/242S432u0A1l
        Note that this will remove your applications and other data you put inside your emulator.

        • Switch to another eclipse workspace (File > Switch Workspace > Other... > Pick an empty folder)

        • Import WorklightStarter_Sencha: Import > General > Existing Projects into Workspace

        • apps/worklighStarter_Sencha > Build All and Deploy

        • adapters/worklightStarterAdapter > Deploy Worklight Adapter (VERY important step!)

        • worklightStarter_SenchaWorklightStarter_SenchaAndroid > Run it inside your AVD with 2.2, you should see:
        http://cl.ly/image/3E2o0i47220G
        • SystemAdmin
          SystemAdmin
          2327 Posts
          ACCEPTED ANSWER

          Re: Sencha + Worklight

          ‏2012-09-21T12:26:53Z  in response to SystemAdmin
          Update: The first step should reference this picture: http://cl.ly/image/1z2m222S3f0A
          (not http://cl.ly/image/242S432u0A1l)
        • SystemAdmin
          SystemAdmin
          2327 Posts
          ACCEPTED ANSWER

          Re: Sencha + Worklight

          ‏2012-09-21T12:48:49Z  in response to SystemAdmin
          I tried the way you said and i got this error,

          TypeError: Result of expression 'options' undefined is not an object. at file:///data/data/com.worklightStarter_Sencha/files/www/default/wlclient/js/wlclient.js:1134

          file:///data/data/com.worklightStarter_Sencha/files/www/default/wlclient/js/wlclient.js: Line 1134 : TypeError: Result of expression 'options' undefined is not an object.
          • SystemAdmin
            SystemAdmin
            2327 Posts
            ACCEPTED ANSWER

            Re: Sencha + Worklight

            ‏2012-09-21T13:12:00Z  in response to SystemAdmin
            What version of Eclipse, Java JDK and Worklight are you using? Did you try testing it in a browser (firefox? chrome? safari?)? Did you try to test it in the iOS simulator? Did you try in another Android emulator or device? Did you get the same error on the different platforms?
            • SystemAdmin
              SystemAdmin
              2327 Posts
              ACCEPTED ANSWER

              Re: Sencha + Worklight

              ‏2012-09-21T13:22:01Z  in response to SystemAdmin
              Eclipse : 3.7.2
              IBM Worklight Version : 5.0.30.v20120808_2026
              Yes I tested it on firefox and chrome. On 2.2 , 2.3 and 3 android versions.
              but didnt try with iOS stimulator
              • SystemAdmin
                SystemAdmin
                2327 Posts
                ACCEPTED ANSWER

                Re: Sencha + Worklight

                ‏2012-09-21T15:59:23Z  in response to SystemAdmin
                I used the same version of Eclipse, Worklight and Android (2.2) you listed.

                Do you get info. back from the adapter?

                adapters/worklightStarterAdapter > Invoke Worklight Procedure > getEndgadgetFeeds > no paramaters > Run
              • SystemAdmin
                SystemAdmin
                2327 Posts
                ACCEPTED ANSWER

                Re: Sencha + Worklight

                ‏2012-09-21T18:20:34Z  in response to SystemAdmin
                1) Are you running on emulator or actual device?

                One possibility - If you are using actual device, I don't think the sample has enabled the offline mode. That means that the app will be trying to look for a server to call. And that might stop your app from working.

                2) Does a NON sencha app work? Are you able to run anything WL? E.g if you create a blank WL project, are you able to run that in the android device?
                • SystemAdmin
                  SystemAdmin
                  2327 Posts
                  ACCEPTED ANSWER

                  Re: Sencha + Worklight

                  ‏2012-09-24T06:18:25Z  in response to SystemAdmin
                  hi.
                  yes i tried it on both android device and emulator.
                  On both it gives blank screen.

                  Actually i want to use pure mvc pattern.i am creating model view and controller folders in app folder under common folder.
                  It seems for mvc acrhitecture files should stored in www folder of main android app, but it stores them in default folder under www folder.
                  Am i right, if yes then how can i get them in degault folder or how can i specify the path for app folder.
                  If not then how should i create that mvc folders and make them work.

                  I even tried the sample ST app with mvc pattern :
                  https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14851214&#14851214

                  It runs fine in browser but gives blank screen on device and emulator.
                  • SystemAdmin
                    SystemAdmin
                    2327 Posts
                    ACCEPTED ANSWER

                    Re: Sencha + Worklight

                    ‏2012-09-24T09:50:27Z  in response to SystemAdmin
                    hi,
                    For the project given on ibm's site i get error on webconsole as:
                    Uncaught TypeError: Property 'dir' of object #<HTMLAppletElement> is not a function

                    And it doesnt run even on browser.
                    Can u suggest me if can how can i change Ext.Loader's path or any workarroung to make it work.
                    • SystemAdmin
                      SystemAdmin
                      2327 Posts
                      ACCEPTED ANSWER

                      Re: Sencha + Worklight

                      ‏2012-09-25T13:28:33Z  in response to SystemAdmin
                      This error is usually caused when the Cordova Applet fails to run properly, usually due to security permissions.

                      If you are on a Mac, you need to adjust the permissions to allow applets to run (and be aware that after about 30 days the permissions reset themselves). I found these instructions to be the clearest:

                      http://support.zipform.com/zf6/KBA-01629.asp

                      Thanks,
                      Nell
                      • SystemAdmin
                        SystemAdmin
                        2327 Posts
                        ACCEPTED ANSWER

                        Re: Sencha + Worklight

                        ‏2012-09-26T04:16:28Z  in response to SystemAdmin
                        Thanks NellG.
                        But i am using Ubuntu and chrome.
                        Can u suggest me what might be wrong in chrome.
                        Thanks,
                        Manjusha.
                        • SystemAdmin
                          SystemAdmin
                          2327 Posts
                          ACCEPTED ANSWER

                          Re: Sencha + Worklight

                          ‏2012-09-27T19:13:46Z  in response to SystemAdmin
                          It is still likely to be a Java error where the applet is not initializing correctly -- can you try to verify that applets are working correctly?
  • zelda.so
    zelda.so
    4 Posts
    ACCEPTED ANSWER

    Re: Sencha + Worklight

    ‏2012-10-12T04:59:00Z  in response to SystemAdmin
    maybe you try to remove all the comments within app.json - i got the same blank screen as you said but after i removed all the comments in app.json (eclipse marked them as invalid) it loaded successfully.