Another thing: is it really necessary to have have different field orders
for tables and forms? In Estatio we have never had this issue. I find it a
bit hacky to create fields just to accomplish that.

How we do it:
- the Xxx.layout.json provides the order and grouping of the fields. We use
a lot contributed actions, collections and properties and you'll only get
them positioned right using the layout file.
- we use @Hidden(where=...) the not show some properties in tables

Just my two cents.


On Tue, Sep 2, 2014 at 3:02 PM, Jeroen van der Wal <[email protected]>
wrote:

> I see you have a Person.layout.json file too. These two don't work well
> together, either choose annotations or the layout file. I prefer the latter.
>
> Cheers,
>
> Jeroen
>
>
> On Tue, Sep 2, 2014 at 2:58 PM, <[email protected]> wrote:
>
>> >Excuse me for not being clear:
>>
>> My problem is that the other properties of Person appear in columns after
>> gender ("geslacht") although I have made annotations for them to appear
>> before gender:
>>
>> F.I.
>>
>> firstName() has @MemberOrder(sequence="10") but appears after
>> getGenderForTables() that has @MemberOrder(sequence="55")
>>
>> See [2]
>>
>> I don't understand why this is ...
>>
>>
>>
>> [2]
>>
>>
>> https://github.com/johandoornenbal/socrates/blob/master/dom/src/main/java/nl/socrates/dom/party/Person.java
>>
>>
>> Not sure I follow on this...
>>
>> ... the second property listed, getGenderForTables(), is annotated with
>> @Hidden(where=Where.OBJECT_FORMS), so it *is* going to appear in a table,
>> with a column name of "Geslacht".
>>
>> Perhaps remove the two @Named annotations temporarily so you can
>> distinguish one property from the other?
>>
>>
>>
>>
>> On 2 September 2014 13:33,  wrote:
>>
>> > > 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
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> >
>> >
>>
>>
>>
>>
>

Reply via email to