skipContainers - Skip Containers
Skips a specified number of named containers to assign a group.
Category
basicsSyntax
skipContainers="n"
Where n
is
an integer and 0 (default) means the innermost container.Usage
In Design mode, click All Properties and look for skipContainers under basics.Every
XPage has two named containers: the top-level view and the form. In
the generated page source, these containers typically have the names
view
and _id1
so
that the form source begins like this:<form id="view:_id1"
The
following elements also generate named containers: List Box control, Combo Box control, Check Box control, Radio Button control, Repeat control, Include Page control, Table control, View control, Data Table control, Tabbed Panel control,
columns in Data Table and View controls, and event handlers.
Groups are assigned on a per-container basis unless skipContainers
is
applied.For example, radio buttons in two columns in a data
table might generate (in the page source) the following identifiers:
id="view:_id1:dataTable1:0:column1:radio1 value="apples""
name="view:_id1:dataTable1:0:column1:fruit"
id="view:_id1:dataTable1:0:column2:radio1" value="oranges"
name="view:_id1:dataTable1:0:column2:fruit"
Where name
is
the group identifier and 0 means the first row. Identifiers for additional
rows are 1, 2, and so on.Notice that the group names are all different so each button acts independently.
By setting
skipContainers
to
1, you can remove the column part from the group identifier. Here
buttons from both columns in each row act as one group.id="view:_id1:dataTable1:0:column1:radio1" value="apples"
name="view:_id1:dataTable1:0:fruit"
id="view:_id1:dataTable1:0:column2:radio2" value="oranges"
name="view:_id1:dataTable1:0:fruit"
For this example, to
force all buttons on the page into one group, set skipContainers
to
3 or 4.Exceeding the named containers on the page causes a Command
Not Handled Exception
error when the page is loaded at run
time.
Examples
The Radio Button controls in this table assign the buttons in both columns of each row to the same group.<xp:dataTable id="dataTable1" rows="30" var="rowdoc"
value="#{javascript:return database.getAllDocuments()}">
<xp:column id="column1">
<xp:radio text="apples" id="radio1"
value="#{document1.fruit}" selectedValue="apples" groupName="fruit"
skipContainers="1">
</xp:radio>
</xp:column>
<xp:column id="column2">
<xp:radio text="Oranges" id="radio2"
value="#{document1.fruit}" selectedValue="oranges" groupName="fruit"
skipContainers="1">
</xp:radio>
</xp:column>
</xp:dataTable>