diff options
Diffstat (limited to 'tests')
4 files changed, 163 insertions, 8 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page index a615363b..f9be4aee 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page @@ -15,13 +15,41 @@ {
background-position: 10px -90px;
}
+ .more td.rating_hover
+ {
+ background-position: 10px -290px;
+ }
</style>
+
<com:TLabel ID="label1" Text="Rate It:" />
-<com:TActiveRatingList ID="list1" CaptionID="label1" RatingStyle="blocks" OnCallback="list1_oncallback">
+<com:TActiveRatingList ID="list1"
+ Rating="3.7"
+ CaptionID="label1" OnCallback="list1_oncallback">
+ <com:TListItem Text="1 Star" />
+ <com:TListItem Text="2 Stars" />
+ <com:TListItem Text="3 Stars" />
+ <com:TListItem Text="4 Stars" />
+ <com:TListItem Text="5 Stars" />
+ <prop:ClientSide
+ OnLoading="Element.show('status')"
+ OnComplete="Element.hide('status')" />
+</com:TActiveRatingList>
+
+<hr />
+
+<com:TActiveButton ID="button1" Text="Enable" OnClick="button1_clicked" />
+<com:TActiveButton ID="button2" Text="Disable" OnClick="button2_clicked" />
+<com:TActiveButton ID="button5" Text="Index=3" OnClick="button5_clicked" />
+
+
+<hr />
+
+<com:TLabel ID="label2" Text="Rate It:" />
+<com:TActiveRatingList ID="list2" CaptionID="label2" RatingStyle="blocks" OnCallback="list2_oncallback">
<com:TListItem Text="1 Block" />
<com:TListItem Text="2 Blocks" />
<com:TListItem Text="3 Blocks" />
- <com:TListItem Text="4 Blocks" />
+ <com:TListItem Text="4 Blocks" Selected="true" />
<com:TListItem Text="5 Blocks" />
<prop:ClientSide
OnLoading="Element.show('status')"
@@ -30,7 +58,7 @@ <br />
-<com:TActiveRatingList ID="list2" Rating="3.5"
+<com:TActiveRatingList ID="list3" Rating="3.5"
Attributes.title="3.5 Blocks" RatingStyle="blocks" ReadOnly="true">
<com:TListItem Text="1 Block" />
<com:TListItem Text="2 Blocks" />
@@ -58,7 +86,7 @@ </com:TActiveRatingList>
<br />
-<com:TActiveRatingList ID="list3" Rating="3.5" Attributes.title="3.5 Stars" ReadOnly="true">
+<com:TActiveRatingList ID="list4" Rating="3.5" Attributes.title="3.5 Stars" ReadOnly="true">
<com:TListItem Text="1 Star" />
<com:TListItem Text="2 Stars" />
<com:TListItem Text="3 Stars" />
@@ -76,10 +104,6 @@ Loading...
</div>
-<com:TActiveButton ID="button1" Text="Enable" OnClick="button1_clicked" />
-<com:TActiveButton ID="button2" Text="Disable" OnClick="button2_clicked" />
-<com:TActiveButton ID="button5" Text="Index=3" OnClick="button5_clicked" />
-
<com:TJavascriptLogger />
</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.php b/tests/FunctionalTests/active-controls/protected/pages/RatingList.php index c6661182..98b62e04 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.php +++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.php @@ -4,6 +4,15 @@ class RatingList extends TPage {
function list1_oncallback($sender, $param)
{
+ $newRating = ($sender->Rating + $sender->SelectedIndex+1)/2;
+ $sender->Rating = $newRating;
+ $sender->Caption = "Rating : ".$newRating;
+ $sender->Enabled=false;
+ }
+
+
+ function list2_oncallback($sender, $param)
+ {
}
function button1_clicked($sender, $param)
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page new file mode 100644 index 00000000..5847371f --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page @@ -0,0 +1,61 @@ +<com:TForm>
+<style>
+ .textbox
+ {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1.2em;
+ display: block;
+ width: 20em;
+ }
+
+ .textbox
+ {
+ padding: 2px 0px 4px 2px;
+ border:1px solid #eee;
+ }
+
+
+ input.textbox
+ {
+ background-color: #ffc;
+ }
+ .loader
+ {
+ position:absolute;
+ right:0px;
+ top:0px;
+ color:white;
+ background-color:#900;
+ padding: 0.5em 1em;
+ }
+ input.required
+ {
+ border: 1px solid red;
+ background-color: pink;
+ }
+</style>
+
+<h1>Repeater With Active Controls Tests</h1>
+
+<com:TRepeater ID="repeater1">
+<prop:ItemTemplate>
+ <com:TInplaceTextBox
+ id="edit_box"
+ Text=<%# $this->DataItem %>
+ OnTextChanged="Page.label_changed"
+ AutoHideTextBox="false"
+ CssClass="textbox" />
+ <com:TRequiredFieldValidator ControlToValidate="edit_box" ControlCssClass="required"/>
+</prop:ItemTemplate>
+</com:TRepeater>
+
+<br />
+
+<com:TActiveButton id="edit_button" Text="Display As textboxes" OnCallback="enable_edit"/>
+<com:TActiveButton id="update_button" Text="Display As Labels" Enabled="false" OnCallback="disable_edit"/>
+
+<com:TActiveLabel ID="label1" />
+
+<com:TJavascriptLogger />
+
+</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.php b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.php new file mode 100644 index 00000000..c5235dc6 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.php @@ -0,0 +1,61 @@ +<?php
+
+class RepeaterWithActiveControls extends TPage
+{
+ private $_data=array('Hello', 'World', 'Prado');
+
+ private $_status='';
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsCallback)
+ {
+ $this->repeater1->DataSource = $this->_data;
+ $this->repeater1->dataBind();
+ }
+ }
+
+ public function label_changed($sender, $param)
+ {
+ $index = $sender->getParent()->ItemIndex + 1;
+ $this->_status .= " Update textbox {$index}: ".$sender->Text;
+ }
+
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+ if(trim($this->_status))
+ $this->label1->Text = $this->_status;
+ }
+
+ public function enable_edit($sender, $param)
+ {
+ if($this->update_button->Enabled==false)
+ {
+ for($i = 0; $i<count($this->repeater1->Items); $i++)
+ {
+ $textbox = $this->repeater1->Items[$i]->edit_box;
+ $textbox->DisplayTextBox = true;
+ }
+ $this->update_button->Enabled = true;
+ $sender->Enabled=false;
+ }
+ }
+
+ public function disable_edit($sender, $param)
+ {
+ if($this->update_button->Enabled==true)
+ {
+ for($i = 0; $i<count($this->repeater1->Items); $i++)
+ {
+ $textbox = $this->repeater1->Items[$i]->edit_box;
+ $textbox->DisplayTextBox = false;
+ }
+ $this->edit_button->Enabled = true;
+ $sender->Enabled=false;
+ }
+ }
+}
+
+?>
\ No newline at end of file |