diff options
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples')
14 files changed, 762 insertions, 0 deletions
| diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page new file mode 100644 index 00000000..71b83c5a --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page @@ -0,0 +1,66 @@ +<com:TContent ID="body">
 +
 +<h1>TActiveCheckBoxList Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Check box list with default settings:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveCheckBoxList>
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" Selected="true" />
 +</com:TActiveCheckBoxList>
 +</td>
 +</tr>
 +
 +<tr>
 +<td class="samplenote">
 +Check box list's behavior upon callback:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveCheckBoxList ID="CheckBoxList" OnCallback="selectionChanged">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" Enabled="false" />
 +  <com:TListItem Value="value 5" Text="item 5" Selected="true" />
 +</com:TActiveCheckBoxList>
 +<br/>
 +<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
 +</td>
 +</tr>
 +
 +</table>
 +
 +
 +<h2>CheckBox List with Validation</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +CheckBox list causing validation:
 +</td>
 +<td class="sampleaction">
 +<com:TTextBox ID="TextBox" />
 +<com:TRequiredFieldValidator
 +	ControlToValidate="TextBox"
 +	ErrorMessage="You must enter a value"
 +	Display="Dynamic"
 +	ValidationGroup="Group2"
 +	/>
 +<com:TActiveCheckBoxList ValidationGroup="Group2">
 +  <com:TListItem Text="Agree" />
 +  <com:TListItem Text="Disagree" />
 +</com:TActiveCheckBoxList>
 +</td>
 +</tr>
 +
 +</table>
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php new file mode 100644 index 00000000..3644721e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php @@ -0,0 +1,26 @@ +<?php
 +
 +class Home extends TPage
 +{
 +	protected function collectSelectionResult($input,$output)
 +	{
 +		$indices=$input->SelectedIndices;
 +		$result='';
 +		foreach($indices as $index)
 +		{
 +			$item=$input->Items[$index];
 +			$result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
 +		}
 +		if($result==='')
 +			$output->Text='Your selection is empty.';
 +		else
 +			$output->Text='Your selection is: '.$result;
 +	}
 +
 +	public function selectionChanged($sender,$param)
 +	{
 +		$this->collectSelectionResult($this->CheckBoxList,$this->SelectionResult);
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page new file mode 100644 index 00000000..90ba4ea3 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page @@ -0,0 +1,108 @@ +<com:TContent ID="body">
 +
 +<h1>TActiveDropDownList Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Callback dropdown list:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveDropDownList
 +	OnSelectedIndexChanged="selectionChanged">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" />
 +</com:TActiveDropDownList>
 +<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
 +</td>
 +</tr>
 +
 +</table>
 +
 +
 +<h2>Changing items to DropDown Lists on callback</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Adding an item on every callback:
 +  </td>
 +  <td class="sampleaction">
 +    <com:TActiveDropDownList ID="ddl1" />
 +    <com:TActiveButton ID="button1" Text="add a new item" OnCallback="buttonClicked" />
 +    <com:TActiveLabel ID="label1" ForeColor="red" />
 +  </td>
 +</tr>
 +
 +</table>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Clearing / restoring the dropdownlist on callback:
 +  </td>
 +  <td class="sampleaction">
 +    <com:TActiveDropDownList ID="ddl2" />
 +    <com:TActiveButton ID="button2" Text="clear" OnCallback="clearClicked" />
 +    <com:TActiveButton ID="button3" Text="reset" OnCallback="resetClicked" />
 +    <com:TActiveLabel ID="label2" ForeColor="red" />
 +  </td>
 +</tr>
 +
 +</table>
 +
 +<h2>List Boxes with Validation</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Dropdown list is being validated:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveDropDownList ID="VDropDownList1">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" />
 +</com:TActiveDropDownList>
 +<com:TRequiredFieldValidator
 +	ControlToValidate="VDropDownList1"
 +	ErrorMessage="You must make a selection other than the first option"
 +	InitialValue="value 1"
 +	Display="Dynamic"
 +	ValidationGroup="Group1"
 +	/>
 +<com:TActiveButton Text="Submit" ValidationGroup="Group1" />
 +</td>
 +</tr>
 +
 +<tr>
 +<td class="samplenote">
 +Dropdown list causing validation:
 +</td>
 +<td class="sampleaction">
 +<com:TTextBox ID="TextBox" />
 +<com:TRequiredFieldValidator
 +	ControlToValidate="TextBox"
 +	ErrorMessage="You must enter a value"
 +	Display="Dynamic"
 +	ValidationGroup="Group2"
 +	/>
 +<com:TActiveDropDownList
 +	ID="VDropDownList2"
 +	ValidationGroup="Group2">
 +  <com:TListItem Text="Agree" />
 +  <com:TListItem Text="Disagree" />
 +</com:TActiveDropDownList>
 +</td>
 +</tr>
 +
 +</table>
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php new file mode 100644 index 00000000..0ba728c6 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php @@ -0,0 +1,60 @@ +<?php
 +
 +class Home extends TPage
 +{
 +	public function onLoad($param)
 +	{
 +		parent::onLoad($param);
 +		if(!$this->IsPostBack && !$this->IsCallback)
 +		{
 +			$this->resetClicked(null,null);
 +		}
 +	}
 +
 +	protected function collectSelectionResult($input,$output)
 +	{
 +		$indices=$input->SelectedIndices;
 +		$result='';
 +		foreach($indices as $index)
 +		{
 +			$item=$input->Items[$index];
 +			$result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
 +		}
 +		if($result==='')
 +			$output->Text='Your selection is empty.';
 +		else
 +			$output->Text='Your selection is: '.$result;
 +	}
 +
 +	public function selectionChanged($sender,$param)
 +	{
 +		$this->collectSelectionResult($sender,$this->SelectionResult);
 +	}
 +
 +	public function buttonClicked($sender, $param)
 +	{
 +		$data=array();
 +		for($i = 0; $i <= $this->ddl1->Items->Count; $i++)
 +			$data[$i]="Item number #".$i;
 +		$this->ddl1->DataSource=$data;
 +		$this->ddl1->dataBind();
 +		$this->label1->Text="Total ".count($data)." items";
 +	}
 +
 +	public function resetClicked($sender, $param)
 +	{
 +		$data=array('item 1','item 2','item 3','item 4');
 +		$this->ddl2->DataSource=$data;
 +		$this->ddl2->dataBind();
 +		$this->label2->Text="DropDownList has been reset";
 +	}
 +
 +	public function clearClicked($sender, $param)
 +	{
 +		$this->ddl2->DataSource=array();
 +		$this->ddl2->dataBind();
 +		$this->label2->Text="DropDownList cleared";
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page new file mode 100644 index 00000000..b23b644d --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page @@ -0,0 +1,108 @@ +<com:TContent ID="body">
 +
 +<h1>TActiveListBox Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Callback listbox:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveListBox
 +	OnSelectedIndexChanged="selectionChanged">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" />
 +</com:TActiveListBox>
 +<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
 +</td>
 +</tr>
 +
 +</table>
 +
 +
 +<h2>Changing items to a Listbox on callback</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Adding an item on every callback:
 +  </td>
 +  <td class="sampleaction">
 +    <com:TActiveListBox ID="box1" />
 +    <com:TActiveButton ID="button1" Text="add a new item" OnCallback="buttonClicked" />
 +    <com:TActiveLabel ID="label1" ForeColor="red" />
 +  </td>
 +</tr>
 +
 +</table>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Clearing / restoring the listbox on callback:
 +  </td>
 +  <td class="sampleaction">
 +    <com:TActiveListBox ID="box2" />
 +    <com:TActiveButton ID="button2" Text="clear" OnCallback="clearClicked" />
 +    <com:TActiveButton ID="button3" Text="reset" OnCallback="resetClicked" />
 +    <com:TActiveLabel ID="label2" ForeColor="red" />
 +  </td>
 +</tr>
 +
 +</table>
 +
 +<h2>List Boxes with Validation</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Listbox is being validated:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveListBox ID="VDropDownList1">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" />
 +</com:TActiveListBox>
 +<com:TRequiredFieldValidator
 +	ControlToValidate="VDropDownList1"
 +	ErrorMessage="You must make a selection other than the first option"
 +	InitialValue="value 1"
 +	Display="Dynamic"
 +	ValidationGroup="Group1"
 +	/>
 +<com:TActiveButton Text="Submit" ValidationGroup="Group1" />
 +</td>
 +</tr>
 +
 +<tr>
 +<td class="samplenote">
 +Listbox causing validation:
 +</td>
 +<td class="sampleaction">
 +<com:TTextBox ID="TextBox" />
 +<com:TRequiredFieldValidator
 +	ControlToValidate="TextBox"
 +	ErrorMessage="You must enter a value"
 +	Display="Dynamic"
 +	ValidationGroup="Group2"
 +	/>
 +<com:TActiveListBox
 +	ID="VDropDownList2"
 +	ValidationGroup="Group2">
 +  <com:TListItem Text="Agree" />
 +  <com:TListItem Text="Disagree" />
 +</com:TActiveListBox>
 +</td>
 +</tr>
 +
 +</table>
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php new file mode 100644 index 00000000..5ec96613 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php @@ -0,0 +1,60 @@ +<?php
 +
 +class Home extends TPage
 +{
 +	public function onLoad($param)
 +	{
 +		parent::onLoad($param);
 +		if(!$this->IsPostBack && !$this->IsCallback)
 +		{
 +			$this->resetClicked(null,null);
 +		}
 +	}
 +
 +	protected function collectSelectionResult($input,$output)
 +	{
 +		$indices=$input->SelectedIndices;
 +		$result='';
 +		foreach($indices as $index)
 +		{
 +			$item=$input->Items[$index];
 +			$result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
 +		}
 +		if($result==='')
 +			$output->Text='Your selection is empty.';
 +		else
 +			$output->Text='Your selection is: '.$result;
 +	}
 +
 +	public function selectionChanged($sender,$param)
 +	{
 +		$this->collectSelectionResult($sender,$this->SelectionResult);
 +	}
 +
 +	public function buttonClicked($sender, $param)
 +	{
 +		$data=array();
 +		for($i = 0; $i <= $this->box1->Items->Count; $i++)
 +			$data[$i]="Item number #".$i;
 +		$this->box1->DataSource=$data;
 +		$this->box1->dataBind();
 +		$this->label1->Text="Total ".count($data)." items";
 +	}
 +
 +	public function resetClicked($sender, $param)
 +	{
 +		$data=array('item 1','item 2','item 3','item 4');
 +		$this->box2->DataSource=$data;
 +		$this->box2->dataBind();
 +		$this->label2->Text="ListBox has been reset";
 +	}
 +
 +	public function clearClicked($sender, $param)
 +	{
 +		$this->box2->DataSource=array();
 +		$this->box2->dataBind();
 +		$this->label2->Text="ListBox cleared";
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page new file mode 100644 index 00000000..1e3a185f --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page @@ -0,0 +1,66 @@ +<com:TContent ID="body">
 +
 +<h1>TActiveRadioButtonList Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +Check box list with default settings:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveRadioButtonList>
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" Selected="true" />
 +</com:TActiveRadioButtonList>
 +</td>
 +</tr>
 +
 +<tr>
 +<td class="samplenote">
 +Check box list's behavior upon callback:
 +</td>
 +<td class="sampleaction">
 +<com:TActiveRadioButtonList ID="RadioButtonList" OnCallback="selectionChanged">
 +  <com:TListItem Value="value 1" Text="item 1" />
 +  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +  <com:TListItem Value="value 3" Text="item 3" />
 +  <com:TListItem Value="value 4" Text="item 4" Enabled="false" />
 +  <com:TListItem Value="value 5" Text="item 5" Selected="true" />
 +</com:TActiveRadioButtonList>
 +<br/>
 +<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
 +</td>
 +</tr>
 +
 +</table>
 +
 +
 +<h2>RadioButton List with Validation</h2>
 +
 +<table class="sampletable">
 +
 +<tr>
 +<td class="samplenote">
 +RadioButton list causing validation:
 +</td>
 +<td class="sampleaction">
 +<com:TTextBox ID="TextBox" />
 +<com:TRequiredFieldValidator
 +	ControlToValidate="TextBox"
 +	ErrorMessage="You must enter a value"
 +	Display="Dynamic"
 +	ValidationGroup="Group2"
 +	/>
 +<com:TActiveRadioButtonList ValidationGroup="Group2">
 +  <com:TListItem Text="Agree" />
 +  <com:TListItem Text="Disagree" />
 +</com:TActiveRadioButtonList>
 +</td>
 +</tr>
 +
 +</table>
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php new file mode 100644 index 00000000..dfa52ce4 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php @@ -0,0 +1,26 @@ +<?php
 +
 +class Home extends TPage
 +{
 +	protected function collectSelectionResult($input,$output)
 +	{
 +		$indices=$input->SelectedIndices;
 +		$result='';
 +		foreach($indices as $index)
 +		{
 +			$item=$input->Items[$index];
 +			$result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
 +		}
 +		if($result==='')
 +			$output->Text='Your selection is empty.';
 +		else
 +			$output->Text='Your selection is: '.$result;
 +	}
 +
 +	public function selectionChanged($sender,$param)
 +	{
 +		$this->collectSelectionResult($this->RadioButtonList,$this->SelectionResult);
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page new file mode 100644 index 00000000..49baa47c --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page @@ -0,0 +1,39 @@ +<com:TContent ID="body">
 +<h1>TCallbackClientScript Samples</h1>
 +
 +<p>
 +  Choose an action from the list and click the button; the server-side php code will get the selected value and
 +  force the execution of some clientside js code in the callback response.
 +</p>
 +
 +<h2>Actions</h2>
 +<com:TRadioButtonList ID="radio1">
 +  <com:TListItem Value="1" Text="alert() me of something" />
 +  <com:TListItem Value="2" Text="toggle Checkbox 1" />
 +  <com:TListItem Value="3" Text="hide Label 1" />
 +  <com:TListItem Value="4" Text="show Label 1" />
 +  <com:TListItem Value="5" Text="focus TextBox 1" />
 +</com:TRadioButtonList>
 +
 +<br/><com:TActiveButton ID="button1" OnCallback="buttonCallback" Text="callback!" />
 +
 +<h2>Results</h2>
 +
 +<table>
 +  <tr>
 +    <td>Checkbox 1:</td>
 +    <td><com:TCheckBox ID="check1" Text="Checkbox 1" /></td>
 +  </tr>
 +  <tr>
 +    <td>Label 1:</td>
 +    <td><com:TLabel ID="label1" ForeColor="Red" Text="Text of Label 1" /></td>
 +  </tr>
 +  <tr>
 +    <td>TextBox 1:</td>
 +    <td><com:TTextBox ID="txt1" Text="Sample text" /></td>
 +  </tr>
 +</table>
 +
 +<com:TJavascriptLogger />
 +
 +<div class="last-modified">$Id: Home.page -1   $</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php new file mode 100644 index 00000000..500d7987 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php @@ -0,0 +1,29 @@ +<?php
 +
 +// $Id: Home.php -1   $
 +class Home extends TPage
 +{
 +	public function buttonCallback ($sender, $param)
 +	{
 +		switch($this->radio1->SelectedValue)
 +		{
 +			case 1:
 +				$this->getCallbackClient()->evaluateScript("<script> alert('something'); </script>");
 +				break;
 +			case 2:
 +				$this->getCallbackClient()->check($this->check1, !$this->check1->Checked);
 +				break;
 +			case 3:
 +				$this->getCallbackClient()->hide($this->label1);
 +				break;
 +			case 4:
 +				$this->getCallbackClient()->show($this->label1);
 +				break;
 +			case 5:
 +				$this->getCallbackClient()->focus($this->txt1);
 +				break;
 +		}
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page new file mode 100644 index 00000000..4540dd91 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page @@ -0,0 +1,73 @@ +<com:TContent ID="body">
 +<h1>TCallbackClientSide Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr><td class="samplenote">
 +A callback button with attached client side options:
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="click me"
 +	OnCallback="buttonCallback"
 +>
 +	<prop:ClientSide
 +	  OnLoading="$('callback_status2').hide(); new Effect.BlindDown('callback_status', { duration: 1 });"
 +	  OnComplete="new Effect.BlindUp('callback_status', { duration: 1 }); $('callback_status2').show();"
 +	/>
 +</com:TActiveButton>
 +<div id="callback_status" style="display:none;">please wait 5 seconds for the callback to complete...</div>
 +<div id="callback_status2" style="display:none;">callback completed!</div>
 +</td></tr>
 +
 +<tr><td class="samplenote">
 +A callback button logging all callback events (5 seconds delay):
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="click me"
 +	OnCallback="buttonCallback"
 +>
 +	<prop:ClientSide
 +		onPreDispatch   = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onPreDispatch');"
 +		onUninitialized = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onUninitialized');"
 +		onLoading       = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onLoading');"
 +		onLoaded        = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onLoaded');"
 +		onInteractive   = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onInteractive');"
 +		onComplete      = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onComplete');"
 +		onSuccess       = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onSuccess');"
 +		onFailure       = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onFailure');"
 +		onException     = "new Insertion.Bottom('<%= $this->label1->ClientID %>', '<br/>onException');"
 +	/>
 +</com:TActiveButton>
 +<br/><com:TLabel ID="label1" ForeColor="Red" Text="waiting for button click.." />
 +</td></tr>
 +
 +<tr><td class="samplenote">
 +A callback with RequestTimeout="3000" (3 seconds). Since the callback will take 5 seconds to complete, the clientside will timeout.
 +This will cause a "missing page state" error; note that the callback is not considered failed, since no
 +connection error has occured.
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="click me"
 +	OnCallback="buttonCallback"
 +>
 +	<prop:ClientSide
 +		onPreDispatch   = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onPreDispatch');"
 +		onUninitialized = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onUninitialized');"
 +		onLoading       = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onLoading');"
 +		onLoaded        = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onLoaded');"
 +		onInteractive   = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onInteractive');"
 +		onComplete      = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onComplete');"
 +		onSuccess       = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onSuccess');"
 +		onFailure       = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onFailure');"
 +		onException     = "new Insertion.Bottom('<%= $this->label2->ClientID %>', '<br/>onException');"
 +		RequestTimeOut  = "3000"
 +	/>
 +</com:TActiveButton>
 +<br/><com:TLabel ID="label2" ForeColor="Red" Text="waiting for button click.." />
 +</td></tr>
 +
 +</table>
 +
 +<com:TJavascriptLogger />
 +
 +<div class="last-modified">$Id: Home.page -1   $</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.php new file mode 100644 index 00000000..8dd794fe --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.php @@ -0,0 +1,12 @@ +<?php
 +
 +// $Id: Home.php -1   $
 +class Home extends TPage
 +{
 +	public function buttonCallback ($sender, $param)
 +	{
 +		sleep(5);
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page new file mode 100644 index 00000000..9cc2f155 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page @@ -0,0 +1,77 @@ +<com:TContent ID="body">
 +<h1>TCallbackOptions Samples</h1>
 +
 +<table class="sampletable">
 +
 +<tr><td class="samplenote">
 +A callback button with attached client side options:
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="click me"
 +	OnCallback="buttonCallback"
 +	ActiveControl.CallbackOptions="options"
 +/>
 +<com:TCallbackOptions
 +	ID="options"
 +	ClientSide.OnLoading="$('callback_status2').hide(); new Effect.BlindDown('callback_status', { duration: 1 });"
 +	ClientSide.OnComplete="new Effect.BlindUp('callback_status', { duration: 1 }); $('callback_status2').show();"
 +/>
 +<div id="callback_status" style="display:none;">please wait 5 seconds for the callback to complete...</div>
 +<div id="callback_status2" style="display:none;">callback completed!</div>
 +</td></tr>
 +
 +<tr><td class="samplenote">
 +Same example as before, but this time interacting with another Prado control:
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="click me"
 +	OnCallback="buttonCallback"
 +	ActiveControl.CallbackOptions="options2"
 +/>
 +<com:TCallbackOptions
 +	ID="options2"
 +	ClientSide.OnLoading="$('<%= $this->label1->ClientID %>').innerHTML='please wait 5 seconds for the callback to complete....';"
 +	ClientSide.OnComplete="$('<%= $this->label1->ClientID %>').innerHTML='callback completed!';"
 +/>
 +<br/><com:TLabel ID="label1" ForeColor="Red" Text="waiting for button click.." />
 +</td></tr>
 +
 +<tr><td class="samplenote">
 +The same TCallbackOptions can be shared among different controls, even of different types:
 +</td><td class="sampleaction">
 +<com:TActiveButton
 +	Text="simple button"
 +	OnCallback="buttonCallback"
 +	ActiveControl.CallbackOptions="options3"
 +/>
 +
 +<br/><com:TActiveCheckBox
 +	Text="simple checkbox"
 +	OnCallback="buttonCallback"
 +	ActiveControl.CallbackOptions="options3"
 +/>
 +
 +<br/><com:TActiveDropDownList
 +	OnCallback="buttonCallback"
 +	ActiveControl.CallbackOptions="options3"
 +>
 +	<com:TListItem Value="value 1" Text="item 1" />
 +	<com:TListItem Value="value 2" Text="item 2" Selected="true" />
 +	<com:TListItem Value="value 3" Text="item 3" />
 +	<com:TListItem Value="value 4" Text="item 4" />
 +</com:TActiveDropDownList>
 +
 +<br/><com:TLabel ID="label2" ForeColor="Red" Text="waiting for any control to callback.." />
 +
 +<com:TCallbackOptions
 +	ID="options3"
 +	ClientSide.OnLoading="$('<%= $this->label2->ClientID %>').innerHTML='please wait 5 seconds for the callback to complete....';"
 +	ClientSide.OnComplete="$('<%= $this->label2->ClientID %>').innerHTML='callback completed!';"
 +/>
 +
 +</td></tr>
 +</table>
 +
 +<com:TJavascriptLogger />
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.php new file mode 100644 index 00000000..6f101107 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.php @@ -0,0 +1,12 @@ +<?php
 +
 +// $Id$
 +class Home extends TPage
 +{
 +	public function buttonCallback ($sender, $param)
 +	{
 +		sleep(5);
 +	}
 +}
 +
 +?>
\ No newline at end of file | 
