0 Replies Latest reply on May 10, 2010 6:25 PM by Swen Vogel

    Value binding with generic method

    Swen Vogel Newbie


      i have some simple entity class that stores different restrictions, the restrictions
      are used for dynamic building of JPQL-Queries:

      public class Restriction extends BaseEntity {
        private String name = null;
        private T value = null;
        public T getValue() {
            return value;
        public void setValue(T value) {
          this.value = value;

      The generic type parameter is used because different restrictions must hold different
      types of values, for example String for an name, Integer for an age. etc.

      I also want to take advantage of build in JSF/SEAM validation and conversation.

      The problem is that when is use the following in my xhtml, the value is allways null.

      <h:inputText value="#{restriction.value}" />