Menu

A search field/button returning a result list

2023-01-19
2023-01-23
  • Mihaela Popa

    Mihaela Popa - 2023-01-19

    Hello,
    I need help , user wants to have a search field where to input a string and return a list with all records containing that string The string cand be present in several columns from table, and the result list must highlight the column that contains that string.

    Lets say I have :

    @Entity
    public class Dosare extends Identifiable {

    @Column(name = "resgister_number")
    private String registernumber;
    @Column(name = "data")
    private Date data;

    // any of the following , posible many or all of them , can contain the string user is searching for:

    @Column(name = "Cui_benef")
    private String cuiBenef;
    @Column(name = "den_benef")
    private String denBenef;
    @Column(name = "Cui_fz")
    private String cuiFz;
    @Column(name = "den_fz")
    private String denFz

    //Getter &Setter

    I think I need a separate module with a specific Tab , how to create the search field/button? in this module?
    Thank you so much

     
  • Javier Paniza

    Javier Paniza - 2023-01-23

    Hi Mihaela,

    The solution is to create your own editor for list, like explained here:
    https://openxava.org/OpenXavaDoc/docs/customizing_en.html#Customizing-Editors-Editors%20for%20tabs%20%28list%20mode%29%20%28new%20in%20v4.6%29

    The best solution but most difficult is to create your own editor from scratch. Although you can use a simpler alternativa like put you own texfield and button to search in the JSP and then include the standard JSP editor, like the example in the doc.

    Another completely different alternative is to create a @Formula property that concats all columns and show only that property in the @Tab. This very simple, but the final result is not so polished.


    Help others in this forum as I help you.

     

Log in to post a comment.

MongoDB Logo MongoDB