summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-02-12 00:26:16 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-02-12 00:26:16 +0100
commitb3c782faadcbd47a723b5cd0b08559e5964f37cf (patch)
tree2c9c99230878460f7bb02d24801e39cc29019a3f
parent031d20c405b922808f4bdf2997f964880b33ab66 (diff)
Fixed TAutoComplete
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js9
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket769TestCase.php2
3 files changed, 9 insertions, 10 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js
index 180ceecf..da5f4b56 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js
@@ -3,8 +3,7 @@ jQuery.noConflict();
/**
* TAutoComplete control.
*/
-Prado.WebUI.TAutoComplete = Class.create(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype);
-Prado.WebUI.TAutoComplete = Class.create(Prado.WebUI.TAutoComplete,
+Prado.WebUI.TAutoComplete = jQuery.klass(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype,
{
initialize : function(options)
{
@@ -23,13 +22,13 @@ Prado.WebUI.TAutoComplete = Class.create(Prado.WebUI.TAutoComplete,
Prado.Registry[options.ID] = this;
},
- doCallback : function(event, options)
+ doCallback : function(options, event)
{
if(!this.active)
{
var request = new Prado.CallbackRequest(this.options.EventTarget, options);
request.dispatch();
- Event.stop(event);
+ event.preventDefault();
}
},
@@ -40,7 +39,7 @@ Prado.WebUI.TAutoComplete = Class.create(Prado.WebUI.TAutoComplete,
this.index = element.autocompleteIndex;
this.selectEntry();
this.hide();
- Event.fire(this.element, "change");
+ jQuery(this.element).trigger('change');
},
getUpdatedChoices : function()
diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
index 2033d6ff..94cae5f2 100755
--- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
@@ -10,13 +10,13 @@ class AutoCompleteTestCase extends PradoGenericSeleniumTest
$this->assertText("label1", "Label 1");
$this->type("textbox3", 'a');
- $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->runScript('Prado.Registry[\'textbox3\'].onKeyPress({})');
$this->pause(500);
$this->verifyTextPresent('Andorra');
$this->assertText("label1", "suggestion for a");
$this->type("textbox3", 'au');
- $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->runScript('Prado.Registry[\'textbox3\'].onKeyPress({})');
$this->pause(500);
$this->verifyTextPresent('Australia');
$this->assertText("label1", "suggestion for au");
@@ -26,14 +26,14 @@ class AutoCompleteTestCase extends PradoGenericSeleniumTest
$this->assertText("label1", "Label 1: Austria");
$this->type("textbox2", "cu");
- $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+ $this->runScript('Prado.Registry[\'textbox2\'].onKeyPress({})');
$this->pause(500);
$this->click('css=#textbox2_result ul li');
$this->pause(500);
$this->assertText("label1", "Label 1: Cuba");
$this->type("textbox2", "Cuba,me");
- $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+ $this->runScript('Prado.Registry[\'textbox2\'].onKeyPress({})');
$this->pause(500);
$this->click('css=#textbox2_result ul li');
$this->pause(500);
diff --git a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
index 74ca48da..38a6212b 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
@@ -19,7 +19,7 @@ class Ticket769TestCase extends PradoGenericSeleniumTest
$this->click($base.'ctl2');
$this->pause(800);
- $this->verifyTextPresent($base.'B', 'This is B');
+ $this->assertEquals($this->getText($base.'B'), 'This is B');
$this->click($base.'ctl3');
$this->pause(800);