Results 1 to 5 of 5
  1.    #1  
    So I have been trying to get this working for awhile and this is the last thing I need to get working for this patch to be fully operational. I am trying to use the ListSelector to pick a value in alarm-assistant.jsjsjs $then$ $use$ $that$ $value$ $in$ $alarm$.$js$ $in$ $the$ $same$ $project$. $Please$ $if$ $you$ $can$ $help$ $take$ $a$ $quick$ $look$ $and$ $let$ $me$ $know$.

    This I how I setup my ListSelector command in snooze-assistant.jsjsjs:

    var AlarmAssistant = Class.create({
     snoozetimes: [
                {label:$L('5 Min'), value:"00:05:00"},
                    {label:$L('10 Min'), value:"00:10:00"},
                    {label:$L('15 Min'), value:"00:15:00"},
                    {label:$L('20 Min'), value:"00:20:00"}
           setup: function() {
                    //Snooze Widget
                    this.snoozeselectorsModel={snoozeStatus: this.alarm.snoozetime};
                    this.controller.setupWidget('snoozelength', {label: $L('Snooze'), choices: this.snoozetimes, modelProperty:'snoozeStatus'}, this.snoozeselectorsModel);
                    this.controller.listen('snoozelength', Mojo.Event.propertyChange, this.snoozeChanged.bindAsEventListener(this));
    snoozeChanged: function(e){
    I believe I have that all set up correctly. everything in the UI works correctly and look right. but it does not seem like the values from the ListSelector are being set.

    here is my code from alarm.jsjsjs

    var Alarm = Class.create({
            initialize: function(id) {
                                            snoozetime = "00:10:00";
            saveSnooze: function(snoozetime){
                    this.snoozetime = snoozetime;
    Alarm.kAlarmSnoozeDuration = this.snoozetime;
    snoozetime does not take the variable from the ListSelector in the assistant file. What is wrong with my code? I dont know why the variable is not being stored or transfered over.

    Thanks for the help

    P.S. For a more complete look at my code check it out here
    Last edited by elpollodiablo1; 10/10/2009 at 01:19 AM. Reason: added link
  2.    #2  
    I am guessing we don't have many developers here. I know this cant be that difficult to figure out.
  3. #3  
    I think you have a conflict with the "this" keyword. It's bound to the function(snoozetime), and so the value is lost when that function ends.

    Hope that helps...
  4.    #4  
    Thanks I will look into this. once I figure this out my snooze alarm Patch will be alive!!!! If anyone else have any other suggestions, I would greatly appreciate them. I dont really know the whole javascript structure and how binding and "this" works. so more input is always helpful
  5.    #5  
    So I just found out that 2 days ago one of the developers at Palm decided to take this idea and implament it on his own. I will test it and try and make a patch for it. It actually seems like the code that is posted there is already in patch format. It is most likely that this will be in the next offical Palm Update.

    Check it out if you want to try it on your own.
    Palm Dev Clock Snooze Duration

Tags for this Thread

Posting Permissions