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

        .getRequestParameterMap();

    String currentDateString = (String) requestParameterMap.get(clientId + CURRENT_DATE_INPUT);

    if (currentDateString != null) {
      CurrentDateChangeEvent ev = new CurrentDateChangeEvent(component,
          currentDateString);
      ev.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
      ev.queue();
    }

    if (requestParameterMap.get(clientId + CURRENT_DATE_PRELOAD) != null) {
      // TODO nick - nick - queue this event when ValueChangeEvent is
      // queued?
View Full Code Here

        .getRequestParameterMap();

    String currentDateString = (String) requestParameterMap.get(clientId + CURRENT_DATE_INPUT);

    if (currentDateString != null) {
      CurrentDateChangeEvent ev = new CurrentDateChangeEvent(component,
          currentDateString);
      ev.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
      ev.queue();
    }

    if (requestParameterMap.get(clientId + CURRENT_DATE_PRELOAD) != null) {
      // TODO nick - nick - queue this event when ValueChangeEvent is
      // queued?
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

        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

        .getRequestParameterMap();

    String currentDateString = (String) requestParameterMap.get(clientId + CURRENT_DATE_INPUT);

    if (currentDateString != null) {
      CurrentDateChangeEvent ev = new CurrentDateChangeEvent(component,
          currentDateString);
      ev.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
      ev.queue();

      // TODO nick - nick - queue this event when ValueChangeEvent is
      // queued?
      new AjaxEvent(component).queue();
View Full Code Here

        Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();

        String clientId = calendar.getClientId(context);
        String currentDateString = (String) requestParameterMap.get(clientId + CURRENT_DATE_INPUT);
        if (currentDateString != null) {
            calendar.queueEvent(new CurrentDateChangeEvent(calendar, currentDateString));
        }

        String selectedDateString = requestParameterMap.get(clientId + "InputDate");
        if (selectedDateString != null) {
            calendar.setSubmittedValue(selectedDateString);
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

        .getRequestParameterMap();

    String currentDateString = (String) requestParameterMap.get(clientId + CURRENT_DATE_INPUT);

    if (currentDateString != null) {
      CurrentDateChangeEvent ev = new CurrentDateChangeEvent(component,
          currentDateString);
      ev.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
      ev.queue();
    }

    if (requestParameterMap.get(clientId + CURRENT_DATE_PRELOAD) != null) {
      // TODO nick - nick - queue this event when ValueChangeEvent is
      // queued?
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.