-- Ralf Eggert <[email protected]> wrote
(on Thursday, 08 January 2009, 06:56 PM +0100):
> I just wonder how StackContainer and BorderContainer work compared to
> AccordionContainer and TabContainer.
> 
> I have an example running with a TabContainer layout elements which
> includes three ContentPane layout elements. Looks and works as expected.
> I changed this example and switched to AccordionContainer and
> AccordionPane and that example works as well as expected.
> 
> Then I tried to change from TabContainer to StackContainer, but this
> does not work. Only the content of the first ContentPane is shown
> without any design. Just black and white output. 

That's normal. StackContainer is typically used for creating custom
widgets -- in fact, TabContainer is a type of StackContainer. With
StackContainer, one ContentPane is shown at a time, and you have to
provide UI elements for switching through panes (TabContainer does this
via tabs...). The standard example shows using it for a pager (for
instance, flipping through "pages" of an article).

> The same with BorderContainer but this time it shows the content of
> all ContentPane without any design.

BorderContainer is for composing a layout consisting of multiple panes;
each ContentPane represents a particular region of that layout.

For it to work, BorderContainer requires that you specify a "region"
parameter for each ContentPane; that pane is then shown in that region.
The standard regions are top, bottom, left, right, and center; how they
are rendered is based on which layout design you specify for the
BorderContainer. You specify the layout design using the "design"
parameter of the BorderContainer; the types are "headline"
(the default) and "sidebar". "Headline" has the ContentPanes
representing the top and bottom regions stretch to fill the container
horizontally; the left, center, and right pane widths are then split
across the width and appear between the top and bottom. With "sidebar",
the left and right panes fill the vertical height.

You may create your BorderContainer using any number of panes; you don't
need to represent all regions.

For the layout to show correctly, you *do* need to use one of the Dijit
themes.

When in doubt, go to http://dojotoolkit.org or http://dojocampus.org. :)

> Do StackContainer and BorderContainer really do work different than
> AccordionContainer and TabContainer? And if yes, how do they work?
> 
> Here is my example.
> 
> -----------------------------------------------------------------
> <? $this->borderContainer()->captureStart('container'); ?>
> 
> <? $this->contentPane()->captureStart(
>       'pizza1', array(), array('title' => 'Pizza 1')
>       'pizza1', array(), array('title' => 'Pizza 1')
> ); ?>
>     <h1>Pizza 1</h1>
>     <p>Pizza 1 description.</p>
> <?= $this->contentPane()->captureEnd('pizza1');?>
> 
> <? $this->contentPane()->captureStart(
>       'pizza2', array(), array('title' => 'Pizza 2')
> ); ?>
>     <h1>Pizza 2</h1>
>     <p>Pizza 2 description.</p>
> <?= $this->contentPane()->captureEnd('pizza2'); ?>
> 
> <? $this->contentPane()->captureStart(
>       'pizza3', array(), array('title' => 'Pizza 3')
> ); ?>
>     <h1>Pizza 3</h1>
>     <p>Pizza 3 description</p>
> <?= $this->contentPane()->captureEnd('pizza3'); ?>
> 
> <?= $this->borderContainer()->captureEnd('container'); ?>
> -----------------------------------------------------------------
> 
> To test this, just change the borderContainer() calls to tabContainer()
> 
> Thanks and best regards,
> 
> Ralf
> 

-- 
Matthew Weier O'Phinney
Software Architect       | [email protected]
Zend Framework           | http://framework.zend.com/

Reply via email to