Package org.richfaces.event

Examples of org.richfaces.event.CurrentDateChangeEvent


    @Override
    public void broadcast(FacesEvent event) throws AbortProcessingException {
        if (event instanceof CurrentDateChangeEvent) {
            FacesContext facesContext = getFacesContext();
            CurrentDateChangeEvent currentDateChangeEvent = (CurrentDateChangeEvent) event;
            String currentDateString = currentDateChangeEvent.getCurrentDateString();
            try {
                // we should use datePattern attribute-based converter only for
                // selectedDate
                // current date string always has predefined format: m/y
                Date currentDate = CalendarHelper.getAsDate(facesContext, this, getCurrentDate());
                Date submittedCurrentDate = CalendarHelper.convertCurrentDate(currentDateString, facesContext, this);
                currentDateChangeEvent.setCurrentDate(submittedCurrentDate);

                if (!submittedCurrentDate.equals(currentDate)) {
                    updateCurrentDate(facesContext, submittedCurrentDate);
                }
            } catch (Exception e) {
View Full Code Here


        ajaxContext.setResponseData(getPreload());
      }
    } else {
      if (event instanceof CurrentDateChangeEvent) {
        FacesContext facesContext = getFacesContext();
        CurrentDateChangeEvent dateChangeEvent = (CurrentDateChangeEvent) event;
        String currentDateString = dateChangeEvent
            .getCurrentDateString();

        // if currentDateString is not null then event cames from
        // apply request phase
        try {
          // XXX nick - kaa - we should use datePattern
          // attribute-based converter only for selectedDate
          // current date string always has predefined format: m/y
          // review
          // org.richfaces.renderkit.CalendarRendererBase.convertCurrentDate(String)
          // method
          // for more

          // XX nick - kaa - throw exception and review resulting
          // message :)

          Date currentDate = getAsDate(getCurrentDate());
          Date submittedCurrentDate = convertCurrentDate(currentDateString);
          dateChangeEvent.setCurrentDate(submittedCurrentDate);

          if (!submittedCurrentDate.equals(currentDate)) {
            updateCurrentDate(facesContext, submittedCurrentDate);
            MethodExpression methodExpression = getCurrentDateChangeListener();
            if (methodExpression != null) {
View Full Code Here

TOP

Related Classes of org.richfaces.event.CurrentDateChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.