Results 1 to 6 of 6
  1. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #1  
    Does anyone really know how to use the showalertdialog widget?

    I have to use the code:

    Code:
    unction Call
    
        this.controller.showAlertDialog({
        onChoose: function(value) {this.outputDisplay.innerHTML = $L("Alert result = ") + value;},
        title: $L("Filet Mignon"),
        message: $L("How would you like your steak done?"),
        choices:[
             {label:$L('Rare'), value:"rare", type:'affirmative'},  
             {label:$L("Medium"), value:"med"},
             {label:$L("Overcooked"), value:"well", type:'negative'},    
             {label:$L("Nevermind"), value:"cancel", type:'dismiss'}    
        ]
        });
    But where do I give it my 'handler' function that interprets the 'value'? Thanks in advance!!!!!!
  2. #2  
    You already have it.

    Code:
    onChoose: function(value) { /* handle value here */ }
  3. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #3  
    oh ok...so I should be able to call other functions from there. THanks
  4. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #4  
    hmm, I still must be screwing something up...this is my code

    Code:
    MainAssistant.prototype.evaluateDelete = function(event){
    	Mojo.Log.info("<======Entered deleteRow FUnction");
    	Mojo.Log.info("<======Wants to delete item with date of", event.item.Date); //Date is used for the query because date is unique, downto the second
    	
    	this.controller.showAlertDialog({
        onChoose: function(value) {if (value=="delete"){self.deleteRow();} else {self.refreshTable();}},
        title: $L("Delete Entry"),
        message: $L("Are you sure you want to delete this entry?"),
        choices:[
             {label:$L("Delete Entry"), value:"delete", type:'negative'},    
             {label:$L("Nevermind"), value:"cancel", type:'dismiss'}    
        ]
        });
    	Mojo.Log.info("<=======response,", response);
    }
    And it pretty much does nothing in response :-(
    Last edited by adma84; 08/17/2009 at 06:38 PM.
  5. #5  
    self.?
  6. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #6  
    oh silly objective C (iPhone) why do you continue to torment me? Thanks SO much. That worked

Posting Permissions