• CSJS click label doesn't work in Notes client

    By Alex L Rasmussen 1 decade ago

    The attached code contains a keypress event handler, which will click an element on the page, depending on the key pressed. The DOWN_ARROW clicks the label and the UP_ARROW clicks the button

    When executed in Firefox or IE, both events fire correctly, while the Notes client and Chrome can't seem to find the click method. Lotus Notes reports an error like:

    dojo.query("*[id$='label1']")[0].click is not a function

    Shouldn't this work across all clients?

    Thank you,

     

     

     




        
        

        
        
                         refreshMode="partial" refreshId="input1">
                
            

        



        
        
                         refreshMode="partial" refreshId="input1">
                
            

        
        
                 
           if(e.keyCode == dojo.keys.DOWN_ARROW)
           {
           
              dojo.query("*[id$='label1']")[0].click();
              e.preventDefault();
           };
           
           if(e.keyCode == dojo.keys.UP_ARROW)
           {
           
              dojo.query("*[id$='button1']")[0].click();
              e.preventDefault();
           };
           
           
           
           
     }) ;]]>

        

     

    • Re: CSJS click label doesn't work in Notes client

      By Lorcan McDonald 1 decade ago

      The error you're seeing indicates that the event was triggered successfully but that your dojo.query didn't find the element you were looking for (ie label1) and therefore returned an empty list. Try running the same query in the Javascript console in Chrome and see what is returned.

      • Tried that,but..

        By Alex L Rasmussen 1 decade ago

        I have already tried that.

        Entering: dojo.query("*[id$='label1']")[0]

        Yields: Label1

         

        Entering: dojo.query("*[id$='label1']")[0].click()

        Yields: TypeError: Object # has no method 'click'

         

        In IE and FF, the latter actually executes the click - so the dojo.query definitely grabs the correct element.