Senin, 14 Februari 2011

Kismiss Field Group

At this section, kismiss give a bonus feature to prepare fields name for grouping. By putting “FieldGroup” tag on top of field name in JavaBean class, we tell kismiss that the fields are used for dynamic group.

This feature is quite simple, only by adding FieldGroup tag like shown below :

    @FieldGroup(label={"firstName:Employee First Name","lastName"})
    private Employee employee;

    @FieldGroup
    private String lastName;

    @FieldGroup
    private String firstName;

    @FieldGroup(label="Alamak")
    private String address;

    @FieldGroup
    private double phoneNumber;

    @FieldGroup
    private String postCode;

After defining the tag, we must add some code when generating report, like :

Map<String,String> fieldsGroup = GroupUtils.getInstance(). groupPropertyForClass(Employee.class);



Then we must passing the fieldsGroup to jsp file in dropdown box or others.

Tidak ada komentar:

Posting Komentar