# SubpanelHidingActor
The SubpanelHidingActor is used to hide subpanels automatically when they are empty. This can happen after initial loading or later when the subpanel content is updated.
# Parameter
subpanelIds
- type:
array
- description: An array with all the layout ids that should be hidden when their list is empty
- type:
listActorIds
(optional)- type:
map
ofstrings
- description: In most cases this parameter can be omitted. It defines the id of the listActor in its corresponding subpanel. By default, this is the id of the listActor in the default subpanel
global/defaults/layouts/subpanel/default.4aplayout
. Currently, the id islistActor
. The key of each entry is the subpanel id and the value its listActor id. - example:
<entry key="subpanelIds" class="array"> <value>myFirstSubpanel</value> <value>theSecondOne</value> <value>lastButNotLeast</value> </entry> <entry key="listActorIds" class="map"> <entry key="myFirstSubpanel">listActorIdOfSubpanelWithId_myFirstSubpanel</entry> <!-- no entry for the second, so it will uses the default --> <entry key="lastButNotLeast">listActor</entry> <!-- default value, should be omitted if default subpanel is used --> </entry>
- type:
# Example
In the following example there is a subpanel and a SubpanelHidingActor
. Whenever the subpanel has an empty list, it will be removed from visible content. (CSS: display: none
)
<layout>
<!-- other stuff -->
<actors>
<!-- other stuff -->
<actor type="SubpanelHidingActor">
<parameter>
<entry key="subpanelIds" class="array">
<value>mySubpanelId</value>
</entry>
</parameter>
</actor>
</actors>
<elements>
<!-- other stuff -->
<import_layout id="mySubpanelId" layout_id="subpanel">
<parameter>
<entry key="beanActor" class="actor">beanActor</entry>
<entry key="relationName" class="string">myRelation</entry>
<entry key="targetModule" class="string">myModule</entry>
</parameter>
</import_layout>
</elements>
</layout>