Interface PortalLayoutDrop
Drag and Drop behavior within PortalLayouts
PortalLayouts are a special Layout subclass designed to containPortlet windows. PortalLayouts support drag and drop
behavior to add new Portlets to the layout and to reorganize the Portlets, as well as to
reorder existing columns.
Portlet drop behavior within a PortalLayout is enabled by default, and may be configured per
portlet by setting Portlet.canDragReposition and Portlet.canDrop. Developers wishing to restrict portlet drop capabilities by type may also set
Portlet.dragType and PortalLayout.portletDropTypes, or override PortalLayout.willAcceptPortletDrop() for custom restrictions.
Users may drop existing
Portlets or any other droppable component into a portalLayout. If something other than a
Portlet is dropped into a portalLayout, a Portlet autoChild will
automatically be created to contain it. Standard autoChild configuration patterns may be used to customize these automatically created
Portlets.
Users may add portlets to, or move portlets within a PortalLayout via the following interactions:
- If
PortalLayout.canAddColumnsis true, users may add a new column to the PortalLayout by dropping a Portlet or other valid component directly onto the PortalLayout outside of any existing columns, or by dropping within thePortalLayout.portletHDropOffsetof a column. The dropped component will be rendered inside the new column. This behavior can be turned off usingPortalLayout.canAcceptDropor settingPortalLayout.dropTypesto explicitly disallow portlet drop. - The user may add a new
row to a column by dropping into the
rowLayout within a column. This behavior can be turned off by settingcanAcceptDropto false in theportalLayout.rowLayoutProperties. - The user may add a Portlet to an
existing row by dropping within
PortalLayout.portletHDropOffsetof an existing Portlet in a row. This behavior can be turned off by settingcanAcceptDropto false in the defaults for therow autoChildrenusingportalLayout.rowDefaults
PortalLayout.getDropPortlet()
method. This method may be overridden to change what components are added to the PortalLayout
on drop. By default when a user drags all the portlets out of a column, leaving it empty,
the Column will automatically be removed from the Portlet. This behavior may be configured
using PortalLayout.removeEmptyColumns.