onecrayon.Database & Select in webOS with enyo 2.2

edited May 2013 in Packaging Apps
So, I've forged ahead with enyo 2.2 and have an app about ready to deploy in android. It's a testament to the ease of use of enyo that I've gotten anywhere near this far and I'm very excited.

I've already deployed the app in enyo 1 on webOS and it works pretty well. When I was exploring Enyo 2 last year, I had made some headway with enyo 2 and had the onecrayon.Database kind working fine but I ran into problems with the Select function in the webOS emulator and decided to drop back to get the app released on webOS.

But now, using enyo 2.2 and phonegap 2.4, I'm humming along on an android version that is working really well. In fact, it took less than a week to update my enyo 1.0 app to enyo 2.2 and add some nifty features like tabpanels.

Anyway, I can't figure out how to get the database to load in webOS. If I install my enyo 1 app on the emulator first (or even install an enyo 2.0 build) and then install a 2.2 version built with the same appname and database name, the 2.2 version will see and use the database.

As I said, I'm having no problem using the oncrayon.Database kind in the Android build.

I could use enyo 2.0 for the webOS version but I still have a "picker" problem: I don't seem to have any luck at all getting any kind: "Select" to take any input using any enyo 2.0 builds. It works fine in Chrome and in android. With 2.2, I can just use the onyx.Picker or onyx.DatePicker, but then I'm back to the problem with the db.

It's just any simple Select function such as:
{kind: "Select", style: "height: 35px;", value: "", <br />name: "newSuffix", components: [<br />{content: "", value: ""}, <br />{content: "Jr.", value: "Jr."}, {content: "Sr.", value: "Sr."}, {content: "II", value: "II"}, <br />{content: "III", value: "III"}, {content: "IV", value: "IV"}, <br />  ]},<br /> 
or, alternatively,
{kind: "Select", style: "height: 35px;", value: "0", <br /> name: "newSuffix", components: [<br />{content: "none", value: "0"},<br /> {content: "Jr.", value: 1}, {content: "2", value: 2}, {content: "II", value: 3}, <br />{content: "III", value: 4}, {content: "IV", value: 5}, <br />  ]},<br /> 
I've tried using phonegap versions 2.3 through 2.6 for webOS, and tried just building w/o phonegap but no luck - I don't know what I'm doing wrong . . .

Any help, pointer or directions to important resources for - either/or - would be very helpful!

Comments

  • edited May 2013
    The reason a Select kind doesn't work in webOS is that the Select kind will create an HTML <select> element, which webOS doesn't support in apps. Your best bet, I think, would be to set your kind declaration to use an onyx.Picker on webOS but an enyo.Select on others:
    {<br />    kind: typeof enyo.platform.webOS != 'undefined' /* if webOS */ ? onyx.Picker : enyo.Select,<br />(...)<br />}
  • edited May 2013
    Thank you, Arthur. I'm not sure how to get a date picker that works, though. I've tried patching in the new onyx.DatePicker but no luck yet. . .
  • I can't figure out how to get the database to load in webOS
    Are you using v2.1 of the database class? There are a few updates to that one that are necessary for working with Enyo 2. Version number is in the comment at the top of the file.
  • edited May 2013
    I am using onecrayon.Database v2.1. It doesn't seem to load a new database with enyo 2.2 on webOS - it works great in Android. (Many thanks for this, BTW!) As noted, if the database already exists, it will read it fine. I dropped back to 2.0.0-beta.4 and it will load and read.

    I realized that the other problems that I had with using the earlier version of enyo was that I was loading some unnecessary *.js scripts in the index.html file - Now, for instance, the new DatePicker kind seems to work just fine now. So I've replaced the kind: Select with kind: Picker where needed and so I seem to be back in business.

    Could there be some change in enyo 2.2 that breaks the *.json handling in webOS that keeps it from loading the schema and data from url?

    Or I could be doing something else wrong. . .
  • There were some Ajax code changes in 2.2... try updating just that code to the current master version and see if it helps.
  • That's where it is - somewhere. Replacing the new xhr.js with the older one makes it work in webOS . . .
Sign In or Register to comment.