diff options
7 files changed, 112 insertions, 3 deletions
diff --git a/.gitattributes b/.gitattributes index da614cfb..e0d73d89 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1324,6 +1324,8 @@ demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.p  demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.php -text  demos/quickstart/protected/pages/Controls/Samples/TSafeHtml/Home.page -text  demos/quickstart/protected/pages/Controls/Samples/TStatements/Home.page -text +demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.page -text +demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.php -text  demos/quickstart/protected/pages/Controls/Samples/TTable/Home.page -text  demos/quickstart/protected/pages/Controls/Samples/TTable/Home.php -text  demos/quickstart/protected/pages/Controls/Samples/TTable/backimage.gif -text @@ -1345,6 +1347,7 @@ demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample5.php -text  demos/quickstart/protected/pages/Controls/Samples/config.xml -text  demos/quickstart/protected/pages/Controls/Standard.page -text  demos/quickstart/protected/pages/Controls/Statements.page -text +demos/quickstart/protected/pages/Controls/TabPanel.page -text  demos/quickstart/protected/pages/Controls/Table.page -text  demos/quickstart/protected/pages/Controls/TextBox.page -text  demos/quickstart/protected/pages/Controls/TextHighlighter.page -text diff --git a/buildscripts/texbuilder/quickstart/pages.php b/buildscripts/texbuilder/quickstart/pages.php index 608463ab..324af67a 100644 --- a/buildscripts/texbuilder/quickstart/pages.php +++ b/buildscripts/texbuilder/quickstart/pages.php @@ -82,6 +82,7 @@ $pages['Control Reference : Standard Controls'] = array(  	'Controls/RadioButton.page',
  	'Controls/SafeHtml.page',
  	'Controls/Statements.page',
 +	'Controls/TabPanel.page',
  	'Controls/Table.page',
  	'Controls/TextBox.page',
  	'Controls/TextHighlighter.page',
 diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.page new file mode 100644 index 00000000..dd084a47 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.page @@ -0,0 +1,40 @@ +<com:TContent ID="body">
 +<h1>TTabPanel Samples</h1>
 +
 +<com:TTabPanel ActiveViewID="View2">
 +
 +  <com:TTabView ID="View1" Caption="View 1" Height="200px">
 +    <h2>View 1</h2>
 +    <p>
 +    This shows a nested tab panel. To ensure the property display, we explicitly
 +    set the height of the outer view to be 200px.
 +    </p>
 +	<com:TTabPanel ActiveViewIndex="1" Width="50%">
 +	  <com:TTabView ID="View11" Caption="View 11">
 +	   This is view 11.
 +	  </com:TTabView>
 +	  <com:TTabView ID="View21" Caption="View 12" Text="This is view 12" />
 +	 </com:TTabPanel>
 +  </com:TTabView>
 +
 +  <com:TTabView ID="View2" Caption="View 2">
 +    <h2>View 2</h2>
 +    <p>Please choose a color:</p>
 +    <com:TDropDownList ID="DropDownList">
 +      <com:TListItem Value="Red" />
 +      <com:TListItem Value="Blue" />
 +      <com:TListItem Value="Green" />
 +    </com:TDropDownList>
 +  </com:TTabView>
 +
 +  <com:TTabView Caption="View 3">
 +    <h2>View 3</h2>
 +    <p>
 +    Click on the following button to see if we keep your input after postback.
 +    </p>
 +    <com:TButton Text="Submit" />
 +  </com:TTabView>
 +</com:TTabPanel>
 +
 +<div class="last-modified">$Id$</div>
 +</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.php new file mode 100644 index 00000000..badbca73 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TTabPanel/Home.php @@ -0,0 +1,7 @@ +<?php
 +
 +class Home extends TPage
 +{
 +}
 +
 +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index f04e61b7..287a5c5c 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -120,6 +120,9 @@    </li>
    <li>
 +  <a href="?page=Controls.TabPanel">TTabPanel</a> displays a tabbed panel consisting of multiple tab views. At any time, only one tab view is visible.
 +  </li>
 +  <li>
    <a href="?page=Controls.TextBox">TTextBox</a> represents a text input field on a Web page. It can collect single-line, multi-line or password text input from users.
    </li>
 diff --git a/demos/quickstart/protected/pages/Controls/TabPanel.page b/demos/quickstart/protected/pages/Controls/TabPanel.page new file mode 100644 index 00000000..d85de681 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/TabPanel.page @@ -0,0 +1,55 @@ +<com:TContent ID="body" >
 +
 +<h1>TTabPanel</h1>
 +<com:DocLink ClassPath="System.Web.UI.WebControls.TTabPanel" />
 +
 +<p>
 +<tt>TTabPanel</tt> displays a tabbed panel. Users can click on the tab bar to switching among different tab views. Each tab view is an independent panel that can contain arbitrary content.
 +</p>
 +
 +<p>
 +A <tt>TTabPanel</tt> control consists of one or several <tt>TTabView</tt> controls representing the possible tab views. At any time, only one tab view is visible (active), which is specified by any of the following properties:
 +</p>
 +
 +<ul>
 +<li><tt>ActiveViewIndex</tt> - the zero-based integer index of the view in the view collection.</li>
 +<li><tt>ActiveViewID</tt> - the text ID of the visible view.</li>
 +<li><tt>ActiveView</tt> - the visible view instance.</li>
 +</ul>
 +
 +<p>
 +If both <tt>ActiveViewIndex</tt> and <tt>ActiveViewID</tt> are set, the latter takes precedence.
 +</p>
 +
 +<p>
 +<tt>TTabPanel</tt> uses CSS to specify the appearance of the tab bar and panel. By default, an embedded CSS file will be published which contains the default CSS for <tt>TTabPanel</tt>. You may also use your own CSS file by specifying the <tt>CssUrl</tt> property. The following properties specify the CSS classes used for elements in a <tt>TTabPanel</tt>:
 +</p>
 +
 +<ul>
 +<li><tt>CssClass</tt> - the CSS class name for the outer-most div element (defaults to 'tab-panel');</li>
 +<li><tt>TabCssClass</tt> - the CSS class name for nonactive tab div elements (defaults to 'tab-normal');</li>
 +<li><tt>ActiveTabCssClass</tt> - the CSS class name for the active tab div element (defaults to 'tab-active');</li>
 +<li><tt>ViewCssClass</tt> - the CSS class for the div element enclosing view content (defaults to 'tab-view');</li>
 +</ul>
 +
 +<p>
 +To use TTabPanel, write a template like following:
 +</p>
 +
 +<com:TTextHighlighter Language="prado" CssClass="source">
 + <com:TTabPanel>
 +   <com:TTabView Caption="View 1">
 +     content for view 1
 +   </com:TTabView>
 +   <com:TTabView Caption="View 2">
 +     content for view 2
 +   </com:TTabView>
 +   <com:TTabView Caption="View 3">
 +     content for view 3
 +   </com:TTabView>
 + </com:TTabPanel>
 +</com:TTextHighlighter>
 +
 +<com:RunBar PagePath="Controls.Samples.TTabPanel.Home" />
 +
 +<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php index 42aac98b..411c0c0f 100644 --- a/framework/Web/UI/WebControls/TTabPanel.php +++ b/framework/Web/UI/WebControls/TTabPanel.php @@ -274,7 +274,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler  	 */
  	public function loadPostData($key,$values)
  	{
 -		if(($index=$values[$key.':1'])!==null)
 +		if(($index=$values[$this->getClientID().'_1'])!==null)
  		{
  			$index=(int)$index;
  			$currentIndex=$this->getActiveViewIndex();
 @@ -359,7 +359,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler  		$cs->registerPradoScript('prado');
  		$code="new $className($options);";
  		$cs->registerEndScript("prado:$id", $code);
 -		$cs->registerHiddenField($id.':1',$this->getActiveViewIndex());
 +		$cs->registerHiddenField($id.'_1',$this->getActiveViewIndex());
  		$page->registerRequiresPostData($this);
  	}
 @@ -378,7 +378,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler  	 */
  	protected function getClientOptions()
  	{
 -		$options['ID']=$this->getUniqueID();
 +		$options['ID']=$this->getClientID();
  		$options['ActiveCssClass']=$this->getActiveTabCssClass();
  		$options['NormalCssClass']=$this->getTabCssClass();
  		$viewIDs=array();
  | 
