Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
12c (12.2.1)

E52774-02

<af:masonryLayoutBehavior>

masonryLayoutBehavior masonry layout behavior

The masonryLayoutBehavior tag is a declarative way to have a command component (e.g. a button) apply visual changes to a masonryLayout before your application code modifies the component tree on the server. This behavior does not modify the component tree at all. Instead, it alters the visual appearance of the masonryLayout and allows you to make optimized changes without having to redraw the entire masonryLayout. This tag will be ignored for any server-rendered components, as it is only supported for the rich client.

</section> <section name="Code_Example_s_">

This is a commandLink that you might use near a masonryLayout to provide a list of components that can be "inserted" in to the masonryLayout. When the link is clicked, the masonryLayout will start opening up some real estate at the specified indexed position. This link has an actionListener on a managed bean that will perform the appropriate changes to the component tree (e.g. setting rendered to true on a panelBox child of the masonryLayout). It is important to note that you are not required to use a behavior tag to do this. The benefit of using this behavior tag is that it will immediately start opening up space for the content before the server starts processing the action event and the managed bean makes the changes to send down the new panelBox content. If you decided to not use a behavior tag, the user may experience a delay while the server code is processing; the space within the masonryLayout will not open up until the new content is retrieved from the server.


       <af:commandLink text="Add #{sideBarItem.title}"
                    partialSubmit="true"
                    actionListener="#{someBean.addChild}"
                    rendered="#{sideBarItem.notShown}">
            <af:masonryLayoutBehavior for="someMasonryLayout"
                                      operation="insert"
                                      index="#{sideBarItem.indexIfRendered}"/>
       </af:commandLink>

Attributes

Name Type Supports EL? Description
for String yes The ID of the child of the masonryLayout component being modified if the operation is "delete" or "resize", or the ID of the masonryLayout component itself if the operation is "insert". An ID beginning with a colon will be treated as absolute (after trimming off the colon). All other IDs will be resolved relative to the component which contains the masonryLayoutBehavior. If no ID is provided, the component tree will be walked to find the ancestor masonryLayout component and its child that contains the masonryLayoutBehavior.
operation String yes The type of visual change to apply to the masonryLayout. Possible values are: "insert", "delete", and "resize".
index int yes The index within the list of rendered masonryLayout children at which the insert (operation="insert") will occur. Since the insertion placeholder gets added before the insertion occurs on the server, you must specify the location where you are planning to insert the child so that if the user reloads the page, the children will continue to remain displayed in the same order.
sizeStyleClass String yes The style class specifying the size of the child to be inserted (operation="insert") or resized (operation="resize").