summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/features/protected/pages
diff options
context:
space:
mode:
authorwei <>2006-05-13 00:21:16 +0000
committerwei <>2006-05-13 00:21:16 +0000
commitddc3ea15bbfd0235fe90f3b2211bf4cc605e25d6 (patch)
treee9eafa54b795bd1514944a4492554014dee169a8 /tests/FunctionalTests/features/protected/pages
parent0b792552008e99d3104f4153f7e95f5c17fdaf5c (diff)
Adding TCallbackOptions
Diffstat (limited to 'tests/FunctionalTests/features/protected/pages')
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page7
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.page24
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php23
3 files changed, 47 insertions, 7 deletions
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
index fab91c40..260ee805 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
@@ -1,7 +1,12 @@
<com:TContent ID="Content">
<h1>TCallback Demo</h1>
+ <com:TCallbackOptions
+ ID="options1"
+ ClientSide.OnSuccess="alert('ok')"
+ ClientSide.EnablePageStateUpdate="false" />
+
<com:TCallback id="control1"
- ClientSide.EnablePageStateUpdate="false"
+ CallbackOptions="options1"
OnCallback="slowResponse" />
<com:TActiveLabel id="label1" Text="Name:" AllowCallbackUpdate="false" />
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.page b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.page
index f0d78267..9d85b3fa 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.page
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.page
@@ -2,15 +2,33 @@
<style>
.autocomplete
{
- border:1px solid black;
+ border:1px solid #919EA9;
background-color:white;
}
+.autocomplete ul, .autocomplete li
+{
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ font-size: 12px;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ color: #333;
+}
+
+.autocomplete li
+{
+ padding: 4px;
+ border-top: 1px solid #ccc;
+}
.autocomplete .selected
{
- background-color: #888;
+ background-color: #ffc;
}
</style>
- <com:TAutoComplete OnCallback="suggestEmails" ResultPanel.CssClass="autocomplete" />
+ <com:TAutoComplete Style="width: 20em"
+ OnCallback="suggestCountries"
+ ClientSide.Separator=", "
+ ResultPanel.CssClass="autocomplete" />
<p><br /></p>
<p><br /></p>
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
index 81508000..3474234e 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
@@ -5,13 +5,30 @@
class AutoComplete extends TPage
{
- public function suggestEmails($sender, $param)
+ public function suggestCountries($sender, $param)
{
- $words = array('hello', 'world');
- $sender->setDataSource($words);
+ $sender->setDataSource($this->matchCountries($param->getParameter()));
$sender->dataBind();
$sender->render($param->getOutput());
}
+
+ protected function matchCountries($token)
+ {
+ $info = Prado::createComponent('System.I18N.core.CultureInfo', 'en');
+ $list = array();
+ $count = 0;
+ $token = strtolower($token);
+ foreach($info->getCountries() as $country)
+ {
+ if(strpos(strtolower($country), $token) === 0)
+ {
+ $list[] = $country;
+ $count++;
+ if($count > 10) break;
+ }
+ }
+ return $list;
+ }
}
?> \ No newline at end of file