0 Replies Latest reply on Sep 4, 2012 3:32 PM by David Allen

    simpleTogglePanel update backing bean with status

    David Allen Newbie

      I have a rich:simpleTogglePanel component that I want to set in my bean as to the whether the panel is open or closed.  I have tried many combinations but when I set it up to the way that I have seen in some examples I get the following error

       

      Can't set property 'dateFilterOpened' on class 'net.mecoil.xman2.actions.diagnosis.HistoryAction_$$_javassist_seam_67' to value 'false'.: java.lang.IllegalArgumentException: argument type mismatch

       

      the xhtml setup for this panel

      <rich:simpleTogglePanel switchType="ajax" opened="#{historyAction.dateFilterOpened}" action="#{historyAction.dateFilterOpened} reRender="dateFilterContainer">

       

      In my bean I have the following

      private String dateFilterOpened = "closed";

      public boolean isDateFilterOpened() {

           Utils.logTrace(this, "isDateFilterOpened=" +  this.dateFilterOpened);

           if ( this.dateFilterOpened == null) {

                return false;

           } else if ( this.dateFilterOpened.equalsIgnoreCase("true")

           || this.dateFilterOpened.equalsIgnoreCase("opened")

           || this.dateFilterOpened.equalsIgnoreCase("open")) {

           return true;

           } else {

           return false;

           }

      }

      public String getDateFilterOpened() {

           if ( this.dateFilterOpened == null) {

           return "closed";

           } else {

           return this.dateFilterOpened;

           }

      }

      public void setDateFilterOpened(String inValue){

           Utils.logTrace(this, "setDateFilterOpened:Value=" + inValue);

           this.dateFilterOpened = inValue;

      }

      public void setDateFilterOpened(boolean inValue){

           Utils.logTrace(this, "setDateFilterOpened:Value=" + inValue);

           if ( inValue) {

           this.dateFilterOpened = "opened";

           } else {

           this.dateFilterOpened = "closed";

           }

      }

       

      I'm at a loss to understand what the problem is.  I had errors when I tried to setup the property as a boolean also.

       

      Dave