Results 1 to 14 of 14
  1.    #1  
    I'm trying to build a list selector widget & have spent a couple of days fighting it. All I've got to go against is the Rough Cuts and the samples. Anyway, I've got it down to the point where the window for the selector appears, but I have no idea how to setup the parms to the controller.setupwidget to get stuff to appear in. Everything I've tried fails. And on top of that, this thing is structuring it's inputs as objects and I'm struggling with the concepts behind objects. I just can't get my head wrapped around it well enough to feel I really understand the subject.

    Any help would be appreciated. Sample code would be great too as (IMO) the Palm samples are trying to do too many things at once. I can't see the forest for the trees.
  2.    #2  
    An update: I was reading the 'making useless apps is fun' thread (or some such name). Anyway, someone posted about the samples and the existence of more samples in the framework files of the SDK. Went there and found widget_listselector.jsjsjs $so$ $I$'$m$ $going$ $to$ $start$ $reading$ $that$ $stuff$.
  3. #3  
    This is what works for me.

    [CODE]

    this.model_lselSomeSelector.choices = arSomeArray;
    this.controller.setupWidget("lselSomeSelector", {}, this.model_lselSomeSelector);
    [CODE]

    the arSomeArray needs to contain value and label data.
  4. #4  
    Quote Originally Posted by Ken M View Post
    An update: I was reading the 'making useless apps is fun' thread (or some such name). Anyway, someone posted about the samples and the existence of more samples in the framework files of the SDK. Went there and found widget_listselector.jsjsjs $so$ $I$'$m$ $going$ $to$ $start$ $reading$ $that$ $stuff$.
    W00t!

    Yup. That's what I posted up. It really does help as it gives complete instructions as to how to use each widget.

    Try that out and see if you can figure it out.

    Good Luck!
  5.    #5  
    Good thing I went to bed right after my last post. Blubble's post would've kept me up all night. I'll try it here in a few minutes. Looks like I might be late to my regular job. Programming this device can be so frustrating at times, but so addictive at others. I'd forgotten how fun it is to learn new languages & platforms.

    Thanks Blubble.
  6.    #6  
    I'm still not getting this thing to work. Here's some more detail of what i have setup.

    In the scene (HTML) I have coded:
    <div class="palm-group unlabeled" x-mojo-tap-highlight="momentary">
    <div class="palm-list">
    <div class="palm-row">
    <div id="fromCurrencySelector" x-mojo-element="ListSelector"></div>
    </div>

    </div>
    </div>

    In the javascript assistant, the prototype setup assistant is this:
    MainPageAssistant.prototype.setup = function() {
    var currencies = []
    currencies[ 0 ] = "United States of America, Dollars";
    currencies[ 1 ] = "United Arab Emirates, Dirhams";
    currencies[ 2 ] = "Argentina, Pesos";
    currencies[ 3 ] = "Australia, Dollars";
    currencies[ 4 ] = "Bahrain, Dinars";
    currencies[ 5 ] = "Brunei Darussalam, Dollars";
    this.model_currencyList.choices = currencies[];
    this.controller.setupWidget("fromCurrencySelector",{},this.model_currencyList);
    };

    The result I get is a blank screen (all white). I suspect that the problem is my array. Blubble, you mentioned the array needs to contain value and label data. I'm thinking you are implying something like what is contained in one of the examples I found, "{label: "One", value: 1}". Unfortunately, I'm missing the connection here (again I suspect it's a lack of understanding of objects vs plain variables).
    Last edited by Ken M; 07/13/2009 at 07:44 AM. Reason: format clarity
  7. #7  
    You need to format your data.

    I pull my data from an object with data from a database query, so it works differently. I don't declare my variables in the same way.

    Try the following. This is the format suggested by the SDK docs. If it doesn't work, try removing the outermost { } from around the this.currencies declaration.

    this.currencies = { [{label:"United States of America", value:" Dollars"}, {label: "United Arab Emirates", value:" Dirhams"}] };

    this.model_currencyList.choices = this.currencies;
    Last edited by Blubble; 07/13/2009 at 09:34 AM.
  8. #8  
    also look at tip calculator for a simple example:

    this.controller.setupWidget('tipRateId', {
    label: 'Tip',
    modelProperty: 'tipRate',
    choices: [{label: '0%', value: 0},
    {label: '10%', value: 10},
    {label: '15%', value: 15},
    {label: '18%', value: 18},
    {label: '20%', value: 20},
    {label: '22%', value: 22},
    ]},
    this.model);
  9.    #9  
    I got the tip calculator code to run. Now that I know what it's trying to accomplish, I think I can modify it to use a separate input array. I'd rather do that because I have multiple places I'm going to use the currency list. The hardest part is getting it to run the first time. Thanks for the help guys (or gals).
  10. #10  
    Quote Originally Posted by Ken M View Post
    Thanks for the help guys (or gals).
    LOL. Everyone know's the golden rule: There are no girls on teh interwebz.
  11. #11  
    Of course there are
  12. #12  
    Ken,
    O
    Did you ever get the ListSelector widget to instantiate & show up on your page?

    I'm having the same issue.
  13. mateo2's Avatar
    Posts
    35 Posts
    Global Posts
    36 Global Posts
    #13  
    How do you make it look like a button? I am using the tip example, except it doesn't look like the buttons shown in, for example, the Calendar app.

    Why is this stuff not documented better than just the bare facts? Palm has really dropped the ball on this.
  14. #14  
    You have a sample on webOSdev, and in the SDK for each widget.

Tags for this Thread

Posting Permissions