3 Replies Latest reply on May 28, 2012 7:49 AM by vadivelcit

    How to reset input value for rich:calendar

    vadivelcit

      Hi guys,

       

           Pls give some solution, i want to reset input value for rich:calendar.

       

      In rich:dataTable i have multiple rows, when i click on the row it will open a panel, inside the panel i kept rich:calendar input box

      once i select the date i will close the panel and again i will open the same panel that time rich:calendar input box should to be reset.

       

      Regards,

      Vadivel K.

        • 1. Re: How to reset input value for rich:calendar
          jpapouse

          You can obtain calendar object on the client side via the following code:

          #{rich:component('calendarId')}
          

          This object has a few usefel methods like:

          .setValue()
          

          To reset the calendar value you can just call:

          #{rich:component('calendarId')}.setValue('')
          
          • 2. Re: How to reset input value for rich:calendar
            vi_mahe_ka1

            Use following code

             

            <a4j:commandButton value="reset"
                     action="#{bean.resetFormFields}"
                     oncomplete="#{rich:component('popup')}.show()">
                    </a4j:commandButton>

            public static void setValuesToUIInput(String id, String value) {

            UIInput component=(UIInput) FacesContext.getCurrentInstance().getViewRoot().findComponent(id);
              if (null != component) {
               component.setValue(value);
               component.setSubmittedValue(value);
              }

            }

            setValuesToUIInput("popup:calndar", null);

            1 of 1 people found this helpful
            • 3. Re: How to reset input value for rich:calendar
              vadivelcit

              Thanks guys