[ 1 post ]

Jan Morten Sørensen

  • Username: Freelancedeveloper
  • Joined: Tue Oct 04, 2011 4:00 pm
  • Posts: 3
  • Offline
  • Profile

Autocomplete: How to programmatically select from the list?

Post Posted: Fri Jul 06, 2012 8:01 am
+0-
Hi everyone.

I am trying to programmatically select a suggestion in the autocomplete list of suggestion but it only yields undefined.

Some testkode:

Code:
       
        objAutoComplete = winConta.autoCompleteKunde();
        var oAc = objAutoComplete.oAC;
       
        oAc.sendQuery('a'); //this opens the result
       
        evt = mouseEvent('click', 268, 263, 268, 263);
        dispatchEvent(winConta.$('.yui-ac-bd:first ul li:eq(1)')[0], evt); //trying to select using jQuery


winConta is the window where the Autocomplete instance is and autoCompleteKunde() is the method that instantiates the Autocomplete.

What I am trying to do is to make a testtool that mimics the users behaviour so that I can test all the application parameters automatically but this autocomplete selection thing is driving me nuts.

Is there any explanation to how the autocomplete actually works behind the scene?

When I run this code I get undefined and the itemSelectHandler reports that it haven't received a resultobject.
  [ 1 post ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum