Menu

Choose what fields to display in Listview

2021-04-05
2021-04-22
  • Lucio Crusca

    Lucio Crusca - 2021-04-05

    Here is my "Recapito" entity code, and the attached image shows how it renders by default:

    @Entity @Getter @Setter
    public class Recapito extends AceArcId implements Serializable {
        private static final long serialVersionUID = 1L;
    
        @ManyToOne(fetch=FetchType.LAZY, optional=false)
        private Contatto contatto; 
    
        @Column(length=254)
        private String email;
    
        @Column(length=254)
        private String telefono;
    
        @Column(length=254)
        private String sito;
    
        @Column(length=254)
        private String paginaSocial;
    
        @Column()
        private Date data;
    }
    

    I'd like to choose what properties of "Contatto" to show in the list view of "Recapito", instead of just the "nome" property. I couldn't find that in the docs (almost sure my fault, but that's it...).

    How do I choose what properties to show in the list view?

     
  • Javier Paniza

    Javier Paniza - 2021-04-07

    Hi Lucio,

    You can use @Tab annotation for that. @Tab allows you to use qualified properties until infinite level.

    @Entity @Getter @Setter
    @Tab(properties="contatto.nome, telefono, email")
    public class Recapito extends AceArcId implements Serializable {
    

    Note the contatto.nome.

    Moreover, you user can add any property he want, including property from Contatto in Recapito, using the customization options of the list.

    Look a this to learn more about @Tab:
    https://openxava.org/OpenXavaDoc/docs/tab_en.html


    Help others in this forum as I help you.

     

Log in to post a comment.

MongoDB Logo MongoDB