1 Reply Latest reply on Sep 29, 2010 6:05 AM by Andrey Markhel

    rich:calender not updating backing bean

    Chakradhar Kantipudi Newbie

      hii all,


      my problem is , when a calender value is changed i am firing an a4j: event and going for validation in bakcing bean methods. but they raise null pointer exception.



      my code is,


                           <rich:calendar datePattern="dd/MM/yyyy" value="#{registrationFormBean.fromDate}" />
                          <rich:calendar datePattern="dd/MM/yyyy" value="#{registrationFormBean.toDate}">
                          <a4j:support event="onchanged" action="countNumberOfDays" reRender="daysofleave" ajaxSingle="true"/>


                          <h:outputLabel for="daysofleave" value="Number of Days:"/>
                          <h:inputText id="daysofleave"  value="#{numberOfDays}" ajaxRendered="true"/>



      so when i run this page it gives out Null pointer exception saying {registrationFormBean} maps to a null value.


      please some known of this help me.

        • 1. Re: rich:calender not updating backing bean
          Andrey Markhel Newbie

          You should post you stacktrace and full page code.

          Anyway, 1. <h:inputText id="daysofleave"  value="#{numberOfDays}" ajaxRendered="true"/> h:inputText haven't attribbute ajaxRendered.

          2. <a4j:support event="onchanged" action="countNumberOfDays" reRender="daysofleave" ajaxSingle="true"/> After click event rerendered only your h:inputText, it is wrong your must rerender some container. like this :

          <a4j:region id="daysofleave">
                              <h:inputText value="#{numberOfDays}" ajaxRendered="true"/>

          3. You clearly understand why you use ajaxSingle="true" attribbute? What will be if remove this attribbute?