Results 1 to 5 of 5
  1.    #1  
    Hey eveyone, this is super basic I know, but I have spent hours on it now.

    Can anyone tell me why this event handler won't fire on tap? I have gotten it to work with a button, but not a list tap. Help please.


    StageAssistant.prototype.setup = function() {

    this.controller.listen(this.controller.get('functionList'),Mojo.Event.listTap, this.listClickHandler.bind(this));

    }



    StageAssistant.prototype.listClickHandler = function(event){
    Mojo.Controller.stageController.pushScene("mynextscene");
    }



    <div x-mojo-element="List" id="functionList" class="palm-list">
    <div class="row textfield" x-mojo-tap-highlight='momentary'>
    <div class="title">List Item</div>
    </div>
    </div>
  2. #2  
    I believe you're not setting up your list correctly. You have to call setupWidget with arguments containing the list contents. You can't put the list contents in the scene html file.

    For more info see Palm Mojo Framework - Mojo.Widget

    Also, you should check out the UIWidgets Sample. I was just as confused until I looked at how they implemented a list.

    Hope that helps.
  3.    #3  
    Thanks for your answer on that. So one more follow up... I have found the code your talking about in the samples..

    this.controller.setupWidget("listId",
    this.attributes = {
    itemTemplate: 'listscene/static-list-entry',
    listTemplate: 'listscene/static-list-container',
    //addItemLabel: $L('Add ...'),
    swipeToDelete: false,
    reorderable: false,
    emptyTemplate:'list/emptylist'
    },
    this.model = {
    listTitle: $L('List Title'),
    items : [
    {data:$L("Item 1")},
    //{data:$L("Item 2"), year:$L("1975")},
    //{data:$L("Item 3"), year:$L("1972")},
    //{data:$L("Item 4"), year:$L("2003")},
    //{data:$L("Item 5"), year:$L("1996")},
    //{data:$L("Item 6"), year:$L("1969")},
    ]

    });

    What does the $L represent here? And what needs to be added to the view to make these items get included? Thoughts?
  4. #4  
    I'm not sure what the $L function refers to...I looked it up, but couldn't find it in any documentation. I suspect it might be a PrototypeJS function, but it's not in their documentation either - see Prototype JavaScript framework: Utility Methods.

    Good news is you don't need to worry about it. I've created several lists without using $L on each item, and it works without a problem.

    You most likely don't need the listTemplate property so you can comment that out also. However, you'll need to setup an itemTemplate. To do this, create an html file in your views / scene-name folder (and you can name it whatever you want, but make sure you update the itemTemplate property in the attributes). You can view their example itemTemplate file, which I also found helpful. In this file you can reference the properties of the list items using #{-property name} syntax. Don't forget the dash... it caused 30 minutes of pain.

    The last thing you need to do is create a container in your main scene html file. You just need to add this line where you want your list to appear:

    Code:
    <div x-mojo-element="List" id="listId"></div>
    Replace listId with whatever ID you want, but make sure you carry that over to the first variable of the setupWidget call.

    Hope this isn't too confusing....but it's kind of hard to explain.
  5. #5  
    Quote Originally Posted by delb View Post
    What does the $L represent here? And what needs to be added to the view to make these items get included? Thoughts?
    $L is for Localization, so you can type in english "This is a my List Item #1" and it will be translated to which ever languages have been setup within the localization file, but honestly only Palm so far that i've even seen uses it for now... It is suppose to have some more documentation but palm is working on it for the SDK or so they say

    Hope that helps

    oh and you would need to type english then say a french translation in the localization it wont automaticly format it to another language, you have to know how to say it in each languagem, you want setup!

Posting Permissions