1 2 Previous Next 17 Replies Latest reply on Mar 28, 2012 7:56 PM by lightguard Go to original post
      • 15. Re: selectOneMenu CDI @Named invalid value problem
        ssachtleben.ssachtleben.gmail.com

        Aww next time I should properly read the problem :) I thought you get invalid value with bean name in expression.


        Well I dont like to use named producer if its not used on every page like locale, navigation or stuff like that. On bigger applications with alot of producers you will loose the overview and it slows down the development process. But thats a personal opinion.


        Anways good luck, maybe someone else know why named producers doesn't work here.

        • 16. Re: selectOneMenu CDI @Named invalid value problem
          bwilly

          I was having the invalid/not valid issue regardless of whether I used, say, currentOrg [as named producer] or currentOrgProducer.getCurrentOrg.

           

          I solved my problem by performing equals on both the OrganizationProfile object and the possibility of a string being passed. There is something in CDI that is passing a string and sometimes an object. This is the second time I have encountered this is completely different situations.

           

          Example:

           

          @Override

              public boolean equals(Object o) {

                  if (o == null) return false;

           

           

           

                  if (!(o instanceof OrganizationProfile)) { // todo:researchMe: either ChallengeRoundConverter or SelectItemsRound is passing a String for some reason. W/o this, I get a "Validation Error: Value is not valid"

                      if (o instanceof String) {

                          return o.equals(String.valueOf(this.getId()));

                      } else {

                          return false;

                      }

                  } else {

                      if (this.getId() == null) return false;

           

           

                      return this.getId().equals(((OrganizationProfile) o).getId());

                  }

              }

          • 17. Re: selectOneMenu CDI @Named invalid value problem
            lightguard

            That's a new one for me. Debug it and find out what's calling when it's a string, seems very odd.

            1 2 Previous Next