summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-03-25 14:29:46 +0000
committerxue <>2006-03-25 14:29:46 +0000
commitde4e0fc293b8f5a9d009cf40018bba88d9416b41 (patch)
tree98543330162a6e103f95257ce9dcdb25540fd6df
parentd8d697fe108e488e4b210d96ec08aa69942a3902 (diff)
Finished all TWizard demos.
-rw-r--r--.gitattributes4
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.page61
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.php25
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.page85
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.php11
-rw-r--r--demos/quickstart/protected/pages/Controls/Wizard.page7
-rw-r--r--framework/Exceptions/messages.txt10
-rw-r--r--framework/Web/UI/WebControls/TWizard.php6
8 files changed, 204 insertions, 5 deletions
diff --git a/.gitattributes b/.gitattributes
index def0017f..27aea6ff 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -229,6 +229,10 @@ demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample1.page -text
demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample1.php -text
demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page -text
demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.php -text
+demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.page -text
+demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.php -text
+demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.page -text
+demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.php -text
demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample5.page -text
demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample5.php -text
demos/quickstart/protected/pages/Controls/Samples/config.xml -text
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.page b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.page
new file mode 100644
index 00000000..bb0a251c
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.page
@@ -0,0 +1,61 @@
+<com:TContent ID="body">
+
+<h2>Nonlinear Wizard Navigation Sample</h2>
+
+<p>
+In the following survey, if you are a college student, you will be asked which major you are in. Otherwise, the question is skipped to your favorite sport. This demo also shows unidrectional navigation.
+</p>
+
+<com:TWizard ID="Wizard3"
+ BackColor="#FFFBD6"
+ Width="300px"
+ HeaderText="A Mini Survey"
+ DisplaySideBar="false"
+ HeaderStyle.BackColor="PaleGoldenrod"
+ HeaderStyle.HorizontalAlign="Center"
+ NavigationStyle.HorizontalAlign="Center"
+ OnNextButtonClick="wizard3NextStep"
+ OnCompleteButtonClick="wizard3Completed" >
+
+ <com:TWizardStep Title="Background" AllowReturn="false">
+ <b><%= $this->Parent->Title %></b>
+ <br/><br/>
+ <com:TCheckBox ID="StudentCheckBox" Text="I am a college student." />
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep Title="Major" AllowReturn="false">
+ <b><%= $this->Parent->Title %></b>
+ <br/><br/>
+ My major is
+ <com:TDropDownList ID="DropDownList11">
+ <com:TListItem Value="Computer Science" />
+ <com:TListItem Value="Chemistry" />
+ <com:TListItem Value="Mathematics" />
+ <com:TListItem Value="Others" />
+ </com:TDropDownList>
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep Title="Hobbies" AllowReturn="false">
+ <b><%= $this->Parent->Title %></b>
+ <br/><br/>
+ My favorite Sport is
+ <com:TDropDownList ID="DropDownList22">
+ <com:TListItem Value="Baseball" />
+ <com:TListItem Value="Football" />
+ <com:TListItem Value="Tennis" />
+ </com:TDropDownList>
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep Title="Summary" StepType="Complete">
+ <h3>Thank you for taking this survey!</h3>
+ <p>
+ <com:TLabel ID="Wizard3Result" />
+ </p>
+ </com:TWizardStep>
+
+</com:TWizard>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.php b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.php
new file mode 100644
index 00000000..d85d041a
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample3.php
@@ -0,0 +1,25 @@
+<?php
+
+class Sample3 extends TPage
+{
+ public function wizard3Completed($sender,$param)
+ {
+ if($this->StudentCheckBox->Checked)
+ {
+ $str="You are a college student.<br/>";
+ $str.="You are in major: ".$this->DropDownList11->SelectedValue."<br/>";
+ $str.="Your favorite sport is: ".$this->DropDownList22->SelectedValue;
+ }
+ else
+ $str="Your favorite sport is: ".$this->DropDownList22->SelectedValue;
+ $this->Wizard3Result->Text=$str;
+ }
+
+ public function wizard3NextStep($sender,$param)
+ {
+ if($param->CurrentStepIndex===0 && !$this->StudentCheckBox->Checked)
+ $this->Wizard3->ActiveStepIndex=2;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.page b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.page
new file mode 100644
index 00000000..8687d842
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.page
@@ -0,0 +1,85 @@
+<com:TContent ID="body">
+
+<h2>Customized Wizard Template Sample</h2>
+
+<com:TWizard ID="Wizard1"
+ BackColor="OldLace"
+ Width="400px"
+ SideBarStyle.Width="120px"
+ StepStyle.BackColor="#FFFBD6"
+ HeaderStyle.BackColor="Moccasin"
+ NavigationStyle.BackColor="PaleGoldenrod"
+ OnActiveStepChanged="wizardCompleted" >
+
+ <prop:HeaderTemplate>
+ <i>Header Template</i>
+ <br/>
+ <b>Step <%= $this->Parent->Parent->ActiveStepIndex+1 %> of 3</b>
+ </prop:HeaderTemplate>
+
+ <prop:SideBarTemplate>
+ <i>SideBar Template</i>
+ <br/>
+ <com:TDataList ID="SideBarList">
+ <prop:ItemTemplate>
+ <com:TButton ID="SideBarButton" />
+ </prop:ItemTemplate>
+ <prop:SelectedItemTemplate>
+ <com:TButton ID="SideBarButton" Font.Bold="true" />
+ </prop:SelectedItemTemplate>
+ </com:TDataList>
+ </prop:SideBarTemplate>
+
+ <prop:StartNavigationTemplate>
+ <com:TLinkButton CommandName="NextStep" Text="Next &gt;" />
+ <br/>
+ <i>Start Navigation Template</i>
+ </prop:StartNavigationTemplate>
+
+ <prop:StepNavigationTemplate>
+ <com:TLinkButton CausesValidation="False" CommandName="PreviousStep" Text="&lt; Previous" />
+ <com:TLinkButton CommandName="NextStep" Text="Next &gt;" />
+ <br/>
+ <i>Step Navigation Template</i>
+ </prop:StepNavigationTemplate>
+
+ <prop:FinishNavigationTemplate>
+ All navigation buttons are removed.
+ <br/>
+ <i>Step Navigation Template</i>
+ </prop:FinishNavigationTemplate>
+
+ <com:TWizardStep ID="WizardStep1" Title="Step 1">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ Your favorite color:
+ <com:TDropDownList ID="DropDownList1">
+ <com:TListItem Value="Red" />
+ <com:TListItem Value="Blue" />
+ <com:TListItem Value="Green" />
+ <com:TListItem Value="Purple" />
+ <com:TListItem Value="Black" />
+ <com:TListItem Value="Yellow" />
+ <com:TListItem Value="Orange" />
+ <com:TListItem Value="Pink" />
+ <com:TListItem Value="Cyan" />
+ </com:TDropDownList>
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep ID="WizardStep2" Title="Step 2">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ <com:TLabel ID="Result" />
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep ID="WizardStep3" Title="Step 3">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ Thank you for completing this survey.<br />
+ <br/><br/>
+ </com:TWizardStep>
+</com:TWizard>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.php b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.php
new file mode 100644
index 00000000..6b79698d
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample4.php
@@ -0,0 +1,11 @@
+<?php
+
+class Sample4 extends TPage
+{
+ public function wizardCompleted($sender,$param)
+ {
+ $this->Result->Text="Your favorite color is: " . $this->DropDownList1->SelectedValue;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Wizard.page b/demos/quickstart/protected/pages/Controls/Wizard.page
index 29718930..7d83c697 100644
--- a/demos/quickstart/protected/pages/Controls/Wizard.page
+++ b/demos/quickstart/protected/pages/Controls/Wizard.page
@@ -10,6 +10,10 @@
<img src="<%~wizard.gif%>" alt="components of wizard" />
<p>
+By default, <tt>TWizard</tt> embeds the above components in an HTML table so that the side bar is displayed on the left while the rest on the right. If <tt>UseDefaultLayout</tt> is set to false, no HTML table will be used, and developers should use pure CSS techniques to position the wizard components. Note, each component is displayed as a &lt;div&gt; and the wizard itself is also a &lt;div&gt; that encloses its components' &lt;div&gt;.
+</p>
+
+<p>
Wizard steps are represented by <tt>TWizardStep</tt> and are maintained in <tt>TWizard</tt> through its <tt>WizardSteps</tt> property. At any time, only one step is visible, which is determined by the <tt>ActiveStep</tt> property. The <tt>ActiveStepIndex</tt> property gives the index of the active step in the step collection. Clicking on navigation buttons can activate different wizard steps.
</p>
@@ -85,9 +89,6 @@ Given a set of wizard steps, <tt>TWizard</tt> supports three different ways of n
<li>Navigation - <tt>StartNavigationTemplate</tt>, <tt>StepNavigationTemplate</tt>, <tt>FinishNavigationTemplate</tt>.</li>
<li>Side bar - <tt>SideBarTemplate</tt>.</li>
</ul>
-Note about side bar button IDs, navigation button commands
-headertext vs. headertemplate
-tablelayout vs pure div layout
<com:RunBar PagePath="Controls.Samples.TWizard.Sample4" />
<h3>Using Templated Wizard Steps</h3>
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt
index 81664b3e..798fb50a 100644
--- a/framework/Exceptions/messages.txt
+++ b/framework/Exceptions/messages.txt
@@ -159,6 +159,7 @@ templatecontrol_mastercontrol_invalid = Master control must be of type TTemplate
templatecontrol_contentid_duplicated = TContent ID '{0}' is duplicated.
templatecontrol_placeholderid_duplicated= TContentPlaceHolder ID '{0}' is duplicated.
templatecontrol_directive_invalid = {0}.{1} can only accept a static text string through a template directive.
+templatecontrol_placeholder_inexistent = TContent '{0}' does not have a matching TPlaceHolder.
page_form_duplicated = A page can contain at most one TForm. Use regular HTML form tags for the rest forms.
page_isvalid_unknown = TPage.IsValid has not been evaluated yet.
@@ -257,4 +258,11 @@ multiview_viewid_invalid = TMultiView cannot find the view '{0}' to switch to
viewcollection_view_required = TViewCollection can only accept TView as its element.
-view_visible_readonly = TView.Visible is read-only. Use TView.Active to toggle its visibility. \ No newline at end of file
+view_visible_readonly = TView.Visible is read-only. Use TView.Active to toggle its visibility.
+
+wizard_step_invalid = The step to be activated cannot be found in wizard step collection.
+wizard_command_invalid = Invalid wizard navigation command '{0}'.
+
+completewizardstep_steptype_readonly = TCompleteWizardStep.StepType is read-only.
+
+wizardstepcollection_wizardstep_required = TWizardStepCollection can only accept objects of TWizardStep or its derived classes. \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index 3a37b590..0da859f8 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -202,6 +202,7 @@ class TWizard extends TWebControl implements INamingContainer
/**
* @param TWizardStep step to be activated
+ * @throws TInvalidOperationException if the step is not in the wizard step collection
*/
public function setActiveStep($step)
{
@@ -1275,6 +1276,7 @@ class TWizard extends TWebControl implements INamingContainer
* wizard-specific events.
* @param mixed sender of the original command event
* @param TEventParameter event parameter
+ * @throws TInvalidDataValueException if a navigation command is associated with an invalid parameter
*/
public function onBubbleEvent($sender,$param)
{
@@ -1751,6 +1753,7 @@ class TWizardStepCollection extends TList
* the item being added is a {@link TWizardStep}.
* @param integer the speicified position.
* @param mixed new item
+ * @throws TInvalidDataTypeException if the item being added is not TWizardStep.
*/
public function insertAt($index,$item)
{
@@ -1760,7 +1763,7 @@ class TWizardStepCollection extends TList
$this->_wizard->addedWizardStep($item);
}
else
- throw new TInvalidDataTypeException('wizardstepcollection_wizardstepbase_required');
+ throw new TInvalidDataTypeException('wizardstepcollection_wizardstep_required');
}
/**
@@ -2032,6 +2035,7 @@ class TWizardNavigationTemplate extends TComponent implements ITemplate
* @param TWizardNavigationButtonStyle button style
* @param boolean whether the button should cause validation
* @param string command name for the button's OnCommand event
+ * @throws TInvalidDataValueException if the button type is not recognized
*/
protected function createNavigationButton($buttonStyle,$causesValidation,$commandName)
{