> Still wrestling with ENUM: gender always appears in first column no matter
> what I do with MemberOrder.
Any Idea?
��private PersonGenderType gender;
� ��@javax.jdo.annotations.Column(allowsNull = "false", length =
JdoColumnLength.TYPE_ENUM)
� � @MemberOrder(sequence = "50")
� � @Named("Geslacht")
� � @Hidden(where=Where.ALL_TABLES)
� � public PersonGenderType getGender() {
� � � � return gender;
� � }
�� �
� � @Hidden(where=Where.OBJECT_FORMS) // appears only in tables
� � @MemberOrder(sequence = "55")
� � @Named("Geslacht")� �
� � public PersonGenderType getGenderForTables() {
� � � � return getGender();
� � }
�
� � public void setGender(final PersonGenderType gender) {
� � � � this.gender = gender;
� � }
There's a couple of tricks you can do to order columns in a table
separately from as an object form.
One technique is to use member groups to group on the object form. The
groups are then laid out in the order of @MemberGroupLayout.
Meanwhile, (I'm pretty sure that) the columns of the table are laid out per
@MemberOrder(sequence) without regard for the member group. So with a bit
of playing around you can get the columns to appear in a different order.
The above technique has been all we've needed for Estatio.
~~~
Alternatively, (more boilerplate but perhaps more maintainable) you can
create derived properties and then hide the originals as required, eg:
public class Customer {
@Hidden(where=ALL_TABLES) // appears only on object forms
@MemberOrder(sequence="1")
String getFirstName() { ... }
@MemberOrder(sequence="2")
String getLastName() { ... }
@Hidden(where=OBJECT_FORMS) // appears only in tables
@MemberOrder(sequence="3")
@Named("First name")
String getFirstNameInTables() { return getFirstName());
}
In an object form, you should see: firstName, lastName.
In a table, you should see: lastName, firstName
HTH
Dan
On 2 September 2014 10:47, wrote:
> > Tnc Dan. I checked those already but somehow it is not clear to me how
> to order columns within a table that represents a collection. (Without
> altering the order of fields in the form using @MemberOrder). Is there a
> way to do that?
>
>
> statically via @MemberOrder and @MemberGroupLayout annotations, see [1]
>
> dynamically via .layout.json file: see [2]
>
> HTH
> Dan
>
> [1] http://isis.apache.org/components/viewers/wicket/static-layouts.html
> [2] http://isis.apache.org/components/viewers/wicket/dynamic-layouts.html
>
>
>
> On 2 September 2014 08:28, wrote:
>
> > Hi,
> >
> >
> >
> > How can I order the columns (properties of an object) of an collection in
> > the wicketviewer? I think Jeroen told me but I forgot, sorry.
> >
> > (I would like to know how to do it using JSON layout and/or Annotations)
> >
> > For example ordering all persons in my socrates app [1]
> >
> >
> >
> > [1] https://github.com/johandoornenbal/socrates
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
�