You can drag the Layout Panel component from
the Palette's Layout category to the Visual Designer to create a panel that groups
other components visually. The Layout Panel component is called
panelLayout
in the JSP code, and the associated Java class in the page bean is PanelLayout
.
After you drag the Layout Panel to
your page, you can add components by dropping them on the Layout Panel. The primary feature of this component is that it can be either in Grid Layout or Flow Layout, which affects how the components you drop on it are arranged. See below for more information on these two panelLayout
property settings.
The IDE automatically adds a Layout Panel component to a new Tab Component. You see it below the tab component when you add a new tab to your page, for example, by dropping a Tab Set component on a page. If you select the Layout Panel component below the Tab component, you see the Layout Panel component's Properties window.
In the page bean, a Layout Panel component is a PanelLayout
object.
<div>
element surrounding the group of child components, which puts the Layout Panel on its own line on the page, below any component that precedes it and above any component placed after it. If you want the panel to appear on the same line as the components that precede and follow it, use a Group Panel component.Depending on whether you choose Grid Layout or Flow Layout for the panelLayout
property, there are a number of ways to position the components in the Layout Panel.
This setting is the default for this component. Setting the panelLayout
property to this value aligns components from left to right on the top line as you drop them on the panel. When no more components fit, the components are lined up left to right on the next line, proceeding down the page.
Setting the panelLayout
property to this value aligns components at the location where they were created on the panel. This is often called absolute positioning. If you are using snap to grid, each component is positioned relative to the nearest grid corner when it is created. If snap to grid is off, Grid Layout has no effect, and the panel acts as though it is in Flow Layout.
By default, when you drop components on the panel, they are positioned in a single column, one above the other. You can change the arrangement of the components by selecting the Layout Panel component and dragging the selection handles to change the panel's size.