You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Resto Tesis <re...@gmail.com> on 2014/08/27 02:21:03 UTC

Grouping menu buttons

Hi there,
We are a group of students and we are doing a project with ISIS.
We need to know how to group the buttons in the menu bar of Wicket.

Thank you. greetings

Re: Grouping menu buttons

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Resto,
welcome to the Isis mailing list, nice to hear you've selected Isis for
your project.

Currently Isis only offers limited support in this particular area.  It is
possible to move menu items around, but it isn't possible to create
submenus or have separators in menus.

We've found that moving menu items around has provided enough flexibility
for now.  For example:

@DomainService(menuOrder="10")
public class Persons {

    @MemberOrder(sequence="10.1")
    public Person findPerson(...) { ... }

    @MemberOrder(sequence="10.2")
    public Person newPerson(...) { ... }

    @Prototype
    @MemberOrder(sequence="10.9")
    public Collection<Person> allPersons() { ... }

}

will create a "Persons" menu with menu items, and then:


@DomainService
public class Organizations {

    @MemberOrder(name="Persons", sequence="20.1")
    public Organization findOrganization(...) { ... }

    @MemberOrder(name="Persons", sequence="20.2")
    public Organization newOrganization(...) { ... }

    @Prototype
    @MemberOrder(name="Persons", sequence="20.9")
    public Collection<Organization> allOrganizations() { ... }

}

will move all of Organization's menu items under the "Persons" menu.

You could also use a "dummy" service to act as the menu name

@DomainService(menuOrder="10")
public class Parties {
    // nothing here
}

and then always for the other services use @MemberOrder(name="Parties",
...) etc to attach onto that menu.


~~~
Other things to mention:
* @NotInServiceMenu will suppress an action that is intended to be
contributed.  (We tend to use XxxContributions as the name for services
that hold only contributions)
* @NotContributed is the opposite; says that an action should only appear
as a menu item.
* @NotContributed(As.ACTION) says for a 1-arg action to be contributed as a
property (if returns a scalar) or a collection (if returns a collection).
 Usually combined with @Render(Type.EAGERLY).

HTH
Dan



On 27 August 2014 01:21, Resto Tesis <re...@gmail.com> wrote:

> Hi there,
> We are a group of students and we are doing a project with ISIS.
> We need to know how to group the buttons in the menu bar of Wicket.
>
> Thank you. greetings
>