Support and Documentation

@ToolUi.AddToTop

Applies to: Field

Places new entries at the top of a list's selection field; without this annotation, new entries appear at the bottom of the selection field. (Applies only to fields of type List; does not apply to fields of type Set.)

The following table lists the elements available with this annotation.

Element

Description

Valid Value

value

Indicates new elements appear at top of selection field.

true (default), false

The following snippet includes an example of implementing this annotation.

package content.article;

import com.psddev.cms.db.Content;
import com.psddev.cms.db.ToolUi;

public class Article extends Content  {

    @ToolUi.AddToTop
    private List<Article> relatedArticles;

}

In the previous snippet—

  • Line 8 opens entries in the selection field on top of the existing entries.

  • Line 9 renders a selection field for selecting items of type Article.

add-to-top.png