=== Positioning

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
:page-partial:

The xref:refguide:applib:index/annotation/ActionLayout.adoc#position[position()] element pertains only to actions that have been associated with properties using xref:refguide:applib:index/annotation/ActionLayout.adoc#associateWith[@Action#associateWith()].
For these actions, it specifies the positioning of the action's button with respect to the field representing the object property.

The attribute can take one of four values: `BELOW`, `RIGHT`, `PANEL` or `PANEL_DROPDOWN`.

For example:

[source,java]
----
import lombok.Getter;
import lombok.Setter;

public class Customer {

    @Property( editing=Editing.DISABLED )
    @Getter @Setter
    private BigDecimal cost;

    @Property( editing=Editing.DISABLED )
    @Getter @Setter
    private String location;

    @Action( associateWith="cost" )                     // <.>
    @ActionLayout(
        named="Update",                                 // <.>
        position=Position.BELOW                         // <.>
    )
    public Customer updateCost(BigDecimal cost ) {
        // ...
    }

    @Action( associateWith="location" )
    @ActionLayout(
        named="Update",
        position=Position.BELOW
    )
    public Customer updateLocation(String latitude, String longitude) {
        // ...
    }
}
----

<.> associate the "updateCost" action with the "cost" property

<.> give the action an abbreviated name, because the fact that the "cost" property is to be updated is implied by its positioning

<.> positioning of the action's button


The default is `BELOW`.

If the action is positioned as `RIGHT`, then the action's button is rendered to the right of the property's field, in a compact drop-down.

If the action is positioned as `PANEL`, then the action's button is rendered on the header of the panel that contains the property.

And finally, if the action is positioned as `PANEL_DROPDOWN`, then the action's button is again rendered on the panel header.

If there are multiple actions associated with a single property then the positioning can be mix'ed-and-match'ed as required.
If the `PANEL` or `PANEL_DROPDOWN` are used, then (as the screenshots above show) the actions from potentially multiple properties grouped by that panel will be shown together.


