Package reahl.web.bootstrap.tabbedpanel¶
Added in version 3.2.
TabbedPanels are used to save space by stacking different panels on top of one another. While each panel has its own contents only the top panel is visible, thus taking up visual space of only one such panel.
TabbedPanel¶
- class reahl.web.bootstrap.tabbedpanel.TabbedPanel(view, nav_layout=None)¶
Bases:
Widget
A Widget that appears as having multiple panels of content stacked on top of one another – with only one panel visible at a time.
Each content panel appears to have a label sticking out (its “tab”). When the user clicks on a different Tab, its panel is raised to the top and thus made visible. This is done without refreshing the entire page, provided that JavaScript is available on the user agent.
- Parameters:
view – (See
reahl.web.fw.Widget
)nav_layout – Optionally, an
PillLayout
orTabLayout
for fine-grained control over how theNav
which represents the tabs is displayed.
- query_fields¶
Used to declare the arguments of this Widget on its class.
Override this class attribute to declare arguments this Widget, each described by a
Field
.When constructed, the Widget uses the names and validation details of each Field to parse values for its arguments from the current query string. The resultant argument values are set as attributes on this Widget (with names matching the argument names).
To declare arguments on your own Widget class, assign a ExposedNames instance to query_fields and then assign a single-argument callable for each Widget argument to it. This callable will be called with the Widget instance as argument, and should return a
Field
describing it:class MyWidget(Widget): query_fields = ExposedNames() query_fields.my_argument = lambda i: Field()
Changed in version 6.1: This used to be set up using a method using an
exposed
decorator.
Tab¶
- class reahl.web.bootstrap.tabbedpanel.Tab(view, title, tab_key, contents_factory)¶
Bases:
object
One Tab in a
TabbedPanel
, including the contents that should be displayed for it.- Parameters:
view – (See
reahl.web.fw.Widget
)title – The label Text that is displayed inside the Tab itself.
tab_key – A name for this tag identifying it uniquely amongst other Tabs in the same
TabbedPanel
.contents_factory – A
reahl.web.fw.WidgetFactory
specifying how to create the contents of this Tab, once selected.
MultiTab¶
- class reahl.web.bootstrap.tabbedpanel.MultiTab(view, title, tab_key)¶
Bases:
Tab
A composite tab. Instead of a single choice for the user, clicking on a MultiTab results in a dropdown menu with more choices for the user. These second-level choices are navigable tabs.
- Parameters:
view – (See
reahl.web.fw.Widget
)title – (See
Tab
)tab_key – (See
Tab
)