forked from ariatemplates/ariatemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat ariatemplates#964 Changes for Error tooltip on keydown
- Loading branch information
smadapathi
committed
Feb 12, 2014
1 parent
19936ea
commit 70ba84a
Showing
12 changed files
with
189 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
test/aria/widgets/form/autocomplete/errorhandling/AutoComplete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2013 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
Aria.classDefinition({ | ||
$classpath : "test.aria.widgets.form.autocomplete.errorhandling.AutoComplete", | ||
$extends : "aria.jsunit.TemplateTestCase", | ||
$prototype : { | ||
/** | ||
* This method is always the first entry point to a template test Start the test by focusing the first field. | ||
* Initially give the field focus. | ||
*/ | ||
runTemplateTest : function () { | ||
this.synEvent.click(this.getInputField("acDest"), { | ||
fn : this.onAcFocused, | ||
scope : this | ||
}); | ||
}, | ||
|
||
/** | ||
* Field should have focus, next trigger an exact match. | ||
*/ | ||
onAcFocused : function () { | ||
this.synEvent.type(this.getInputField("acDest"), "z", { | ||
fn : this.waitForType, | ||
scope : this | ||
}); | ||
}, | ||
|
||
/** | ||
* Need to add a delay to allow the list to open with the returned suggestions including the exact match. | ||
*/ | ||
waitForType : function () { | ||
this.waitFor({ | ||
condition : function () { | ||
return (this.getWidgetInstance("acDest")._state == "normalErrorFocused"); | ||
}, | ||
callback : { | ||
fn : this.checkErrorTooltip, | ||
scope : this | ||
} | ||
}); | ||
}, | ||
/** | ||
* Finalize the test, check the bound widgets value has been updated by a change to the data model when the | ||
* enter key was triggered. | ||
*/ | ||
checkErrorTooltip : function () { | ||
var acWidget = this.getWidgetInstance("acDest"); | ||
this.assertTrue(!!acWidget._onValidatePopup); | ||
this.notifyTemplateTestEnd(); | ||
} | ||
} | ||
}); |
45 changes: 45 additions & 0 deletions
45
test/aria/widgets/form/autocomplete/errorhandling/AutoCompleteTpl.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2013 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
{Template { | ||
$classpath:"test.aria.widgets.form.autocomplete.errorhandling.AutoCompleteTpl", | ||
$hasScript:true, | ||
$width: {min: 500} | ||
}} | ||
|
||
{var view_values = { | ||
ac_air_value: null | ||
}/} | ||
|
||
|
||
{macro main()} | ||
<h2>AutoComplete with LC resources handler</h2> <br /> | ||
|
||
{@aria:AutoComplete { | ||
id: "acDest", | ||
label:"Choose your destination: ", | ||
labelPos:"left", | ||
labelAlign:"right", | ||
width:400, | ||
block:false, | ||
labelWidth:180, | ||
validationEvent:'onError', | ||
freeText:false, | ||
resourcesHandler:_getCitiesHandler() | ||
}/} | ||
|
||
{/macro} | ||
|
||
{/Template} |
41 changes: 41 additions & 0 deletions
41
test/aria/widgets/form/autocomplete/errorhandling/AutoCompleteTplScript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2013 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
Aria.tplScriptDefinition({ | ||
$classpath : "test.aria.widgets.form.autocomplete.errorhandling.AutoCompleteTplScript", | ||
$dependencies : ["aria.resources.handlers.LCResourcesHandler"], | ||
$constructor : function () { | ||
this._lcHandler = new aria.resources.handlers.LCResourcesHandler(); | ||
this._lcHandler.setSuggestions([{ | ||
label : 'Madrid', | ||
code : 'MAD' | ||
}, { | ||
label : 'Rio de Janeiro', | ||
code : 'RIO' | ||
}, { | ||
label : 'Miami', | ||
code : 'MIA' | ||
}]); | ||
}, | ||
$destructor : function () { | ||
this._lcHandler.$dispose(); | ||
this._lcHandler = null; | ||
}, | ||
$prototype : { | ||
_getCitiesHandler : function () { | ||
return this._lcHandler; | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters