Search code examples
javahibernatedrop-down-menupojoopenxava

How to create dropdown list in OpenXava?


how can we create the dropdown list type question in OpenXava? Let's say Gender is the question with (Male, Female, Other) with respective answers.

How can I declare the variable in the POJO class. Or do we have any hibernate annotations for the same.

Please suggest.


Solution

  • Define your property as an enum, thus:

    private Sex sex;
    public enum Sex { MALE, FEMALE, OTHER }
    

    OpenXava will generate a combo for that.