1 Reply Latest reply on Nov 22, 2010 1:29 PM by cobar

    Problem with rich:inputNumberSpinner not setting value

    cobar

      I am having problems with the inputNumberSpinner not setting the bound value,  value="#{spinBean.fromDtl.ch1}",  when it changes or when the a4j:commandButton is fired. The component does not have the value either: getFromCh1UI().getValue().toString() = 0

       

      Any help with what I am doing wrong is greatly appreciated.

       

       

      {code}

      <rich:inputNumberSpinner id="reqFromCh1" tabindex="11" inputSize="2"
                   minValue="#{spinBean.fromDtl.ch1Min}"
                   maxValue="#{spinBean.fromDtl.ch1Max}"
                   inputClass="fieldInput" style="width:20px;"
                   disabled="#{spinBean.fromDtl.ch1Disabled}"
                   binding="#{spinBean.fromCh1UI}"
                   value="#{spinBean.fromDtl.ch1}"/>

       

       

          private UIInputNumberSpinner fromCh1UI;

          public UIInputNumberSpinner getFromCh1UI() {
              return fromCh1UI;
          }

          public void setFromCh1UI(UIInputNumberSpinner fromCh1UI) {
              this.fromCh1UI = fromCh1UI;
          }

       

      {code}

       

       

      Side note: I have a selectOneMenu field that when changed updates the minValue, maxValue, disabled and value attributes correctly. There are actually ch1-ch5 input spinners.

        • 1. Re: Problem with rich:inputNumberSpinner not setting value
          cobar

          Upon futher investigation the culprit is the support I used to set the min/max and enable the correct number of spinners which there are 5. The value is actually set on the a4j:commandButton action so the spinner must keep track of the number using javaScript and then marshals value on the form submit to the bound value?

           

          {code}

          <a4j:support id="fromLvlSprt" action="#{spinnerBean.updateFromSpinners}"
                   event="onchange"
                   reRender="reqFromCh1, reqFromCh2, reqFromCh3, reqFromCh4, reqFromCh5"/>

          {code}