Results 1 to 8 of 8
  1.    #1  
    ive been looking everywhere i must be going crazy. I like using ares but there is absolutely no documentation on anything. Every simple thing you try to do you have to end up guessing. And over half of the things that work when you are writing from scratch will not work in ares. So on to my question. I have an app that is using buttons, you click the button it calls the function. Im wanting to switch to a list because i think that would look a little better. So i have the list made out in the scroller everything is working good on the cosmetic side. How do i register the click from the value to the function. Why couldnt it be easy like list1value1tap or something. Im hoping i dont have to rewrite all my code. I would love to be able to change button1tap to something simple and have it work really nice. Any suggestions???
    i1000+ -> i90 -> i530 -> i730 -> i530 -> i730 -> i560 -> i930 -> i215 -> i860 -> i930 -> i860 -> i870 -> i880 -> i870 -> i850 -> i870 -> i830 -> i9 -> Pre
  2. #2  
    You need to register the listTap event. It will pass the item information to your handler. If you already have everything setup, then you can just create a simple handler that reads that info and calls the appropriate function.
    See Mojo.Widget.List - Palm Developer Center for more information.
    danNielson.com - Slalom - twitter - facebook
    A posted thanks dies with the thread. Clicking the button lasts until the admins get bored with this site and throw it in the recycling bin.
  3. #3  
    if you set up the list in ares then click on the view so that you make sure you are on your list in the designer---in the items(JSON) -click on the notepad -put your list items there in
    JSON format :
    [
    {
    item: 1,
    label: "list item 1",
    value: "scene1"
    },
    {
    item: 2,
    label: "list item 2",
    value: "scene2"
    }
    ]

    notice there is no "," on the last one.

    then make your assistant file look like this:

    function MainAssistant(argFromPusher) {}

    MainAssistant.prototype = {
    setup: function() {
    Ares.setupSceneAssistant(this);



    // Let's cache the current list of items and keep them around for filtering
    this.allItems = this.$.list1.getItems();
    },

    // handler implementing a FilterField's onfilter event.
    filterField1Filter: function(inSender, event) {
    this.controller.get("scroller1").mojo.scrollTo(0,0);
    // get the filtered items
    var filteredItems = this.fetchFilteredItems(event.filterString);
    // set the list to display the filtered items
    this.$.list1.setItems(filteredItems);
    },

    // really really simple filtering
    fetchFilteredItems: function(inFilter) {
    var items = [];
    for (var i = 0, l; l = this.allItems[i]; i++) {
    if (l.label.toLowerCase().indexOf(inFilter) === 0) {
    items.push(l);
    }
    }
    return items;
    },
    list1Listtap: function(inSender, event) {
    this.controller.stageController.pushScene(event.item.value);
    },

    cleanup: function() {
    Ares.cleanupSceneAssistant(this);
    }


    };

    notice the list tap function -this comes from the event tab in ares

    you can also set up your list differently with the templates and creating your list in your jsjsjs $file$ -$but$ $this$ $is$ $how$ $i$ $did$ $it$.

    good luck -i am a beginner too -and have had so much trouble finding the information
  4.    #4  
    I'll try that but I'll have to change it a little bit bevause instead of pushing scenes I need to have it open a streaming audio. I had my buttons call the palm streaming audio player. Currently they push a new stage which I want it to push to a scene instead so I have a little work to do but should provide a better ui and better ratings overall
    i1000+ -> i90 -> i530 -> i730 -> i530 -> i730 -> i560 -> i930 -> i215 -> i860 -> i930 -> i860 -> i870 -> i880 -> i870 -> i850 -> i870 -> i830 -> i9 -> Pre
  5. #5  
    Not to hijack the thread but no need to create a new one on the same subject.

    I been trying to figure out how to push a list item to open up a link for the web.

    in 'value' do I just add the url?
  6.    #6  
    Quote Originally Posted by jon0604 View Post
    if you set up the list in ares then click on the view so that you make sure you are on your list in the designer---in the items(JSON) -click on the notepad -put your list items there in
    JSON format :
    [
    {
    item: 1,
    label: "list item 1",
    value: "scene1"
    },
    {
    item: 2,
    label: "list item 2",
    value: "scene2"
    }
    ]

    notice there is no "," on the last one.
    I have my JSON set up already but the defaults for value were set at 1, 2, 3, etc. Also i dont want them to push scenes rather open streaming audio links

    I have set up the list1tap but dont know what parameters i would use. I tried
    Code:
    	list1Listtap: function(inSender, event) {
    		this.controller.serviceRequest("palm://com.palm.applicationManager", {
    			method: "open",
    			parameters: {
    				target: "value"
    but with the log viewer on it tells me that i have no handler for value. Also the value that i declared in my JSON is the streaming audio link.

    I know this is probably all wrong but trial and error keeps the mind turning.
    Last edited by franky_402; 05/31/2010 at 02:56 PM.
    i1000+ -> i90 -> i530 -> i730 -> i530 -> i730 -> i560 -> i930 -> i215 -> i860 -> i930 -> i860 -> i870 -> i880 -> i870 -> i850 -> i870 -> i830 -> i9 -> Pre
  7.    #7  
    bump TTT
    i1000+ -> i90 -> i530 -> i730 -> i530 -> i730 -> i560 -> i930 -> i215 -> i860 -> i930 -> i860 -> i870 -> i880 -> i870 -> i850 -> i870 -> i830 -> i9 -> Pre
  8. rayhollister
    rayhollister's Avatar
    #8  
    Beautiful. Thanks for the code. I was trying to launch a scene and the Mojo version just didn't work on Ares.

    As far as launching an external website, I cheated. I did the code as follows:

    itemHtml

    <div class="palm-row" style="padding:10px;">
    <a href="#{url}">#{-label}</a>
    </div>

    JSON

    [
    {
    item: 1,
    label: "Name of the 1st Website",
    url: "http://www.1stwebsite.com",
    },
    {
    item: 2,
    label: "Name of the 2nd Website",
    url: "http://www.2ndwebsite.com",
    }
    ]
    It doesn't make the whole list div a hyperlink, but it does make the text a hyperlink. It worked in a pinch.

Posting Permissions