Details: Could not find symbol 'onSelect'.___menu in WatchFace___.

Hello, I need help with this menu.

This works for me by default and correctly:

addItem(new Item(:Apnoe, "Apnoe", Rez.Strings.Apnoe, null, Application.Properties.getValue("Apnoe")));

When i try to add this line to the menu i get an error in the simulator:

Details: Could not find symbol 'onSelect'.


Buzz = new Ui.MenuItem(Rez.Strings.Buzz, null, :Buzz, null);
self.addItem(Buzz);

Here I connect the onSelect function:

class SettingsMenuInputDelegate extends WatchUi.Menu2InputDelegate{

var mode;

function initialize(mode) {

self.mode = mode;
Menu2InputDelegate.initialize();
}

function onSelect(item){
item.onSelect(mode);

 }
}

I'm asking for help, what should I modify so that the menu I'm adding works for me?

Thank you

  • Hello, I just found out that I received a reply from you.

    I certainly understand that it is difficult to help when you do not have the entire source code available, if you would be willing, I could send it to you via e-mail via your applications as a question to the developers.

    Or I would need you to at least correct the error.

    When I create a function

    class SettingsMenuInputDelegate extends WatchUi.Menu2InputDelegate{

    and I put the code in it, see below so i get sim error:

    Details: Could not find symbol 'onSelect'

    I am attaching the function and thanks for your help.

    class SettingsMenu extends WatchUi.Menu2{
    	function initialize() {
            Menu2.initialize({:title=> "Test"});
    
    
            ApnoeItem = new WatchUi.MenuItem(Rez.Strings.Apnoe, null, :Apnoe, null);
            self.addItem(ApnoeItem);
           
          
        }
    
        function onShow() {
           refreshSubLabels();
           
       }
    
        function refreshSubLabels() {
           
            ApnoeItem.setSubLabel(Prefs.getEApnoe().toString());
            
           
        }
    
       
    
      
        hidden var ApnoeItem;
      
        
        
    }

    class SettingsMenuInputDelegate extends WatchUi.Menu2InputDelegate{
    
        var mode;
    	
    	 function initialize(mode) {
    
        self.mode = mode;
            Menu2InputDelegate.initialize();
        }
        
        function onSelect(item){
    		item.onSelect(mode);
            
            var itemId = item.getId();
            
           
           
            if (item.getId() == :Apnoe) {
                WatchUi.pushView(new Picker(Rez.Strings.Apnoe),
                 new PickerDelegate(), WatchUi.SLIDE_IMMEDIATE);
    
            }  
              }
                }

  • yes, use contact developer...

  • Thank you, I wrote you an email...

  • but you have forgot to attach your email :-)

  • Not sure why you are doing item.onSelect(mode); on line 12.

    item is a MenuItem.  Comment out that line.