Skip to content

Configuring list view, quick view, and show view display

ikostenko edited this page Apr 20, 2013 · 14 revisions

On the domain view, three views are present to display data:

  • List View: table representation of entity data with configurable paging defaulting to 10 entries per page.
  • Quick View: allows to review information of one or more individual entries, while still observing the List View.
  • Show View: displays individual entry information in a separate page

Each of the views may have its own set of fields. By default, all persistent entity fields of the following types are displayed:

  • Byte
  • Short
  • Integer
  • Long
  • Float
  • Double
  • BigDecimal
  • Date
  • String
  • Fields associated with other entities

It is possible to narrow down the list of persistent entity fields by explicitly specifying fields to be displayed:

@Administration( Booking.class )
public class BookingAdministration {

	public static FieldSetConfigurationUnit listView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
		return fragmentBuilder
			.field( "user" ).caption( "Customer" )
			.field( "hotel" ).caption( "Hotel" )
			.field( "smoking" ).caption( "Smoking" )
			.field( "beds" ).caption( "Beds" ).build();
	}

	public static FieldSetConfigurationUnit quickView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
		return fragmentBuilder
				.field( "checkinDate" ).caption( "Check-In Date" )
				.field( "checkoutDate" ).caption( "Check-Out Date" ).build();
	}

	public static FieldSetConfigurationUnit showView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
		return fragmentBuilder
				.field( "user" ).caption( "Customer" )
				.field( "hotel" ).caption( "Hotel" )
				.field( "smoking" ).caption( "Smoking" )
				.field( "beds" ).caption( "Beds" )
				.field( "checkinDate" ).caption( "Check-In Date" )
				.field( "checkoutDate" ).caption( "Check-Out Date" ).build();
	}
}

This will produce the following result: Views

Along with persistent fields, each of the views can display the following types of fields:

  • Fields with dynamically calculated values, such as fields of an associated entity, results of entity's methods calls, non-persistent entity fields
  • Fields with custom content based on persistent and associated fields