ICEfaces
  1. ICEfaces
  2. ICE-6074

Sparkle DateTimeSelector: Attributes not working correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0-Beta2
    • Component/s: None
    • Labels:
      None
    • Environment:
      N/A
    • Assignee Priority:
      P1

      Description

      Following attributes have problem:

      Valid : setting is true or false does not results in any change in behaviour
      ValidatorMessage: is not displayed when validation error occurs
      Immediate: need more information on test scenario for this attribute.

      1. screenshot-01.png
        119 kB
      2. screenshot-02.png
        94 kB
      3. screenshot-03.png
        112 kB
      4. screenshot-04.png
        108 kB
      5. screenshot-05.png
        103 kB
      6. screenshot-06.png
        106 kB

        Activity

        Hide
        yip.ng added a comment -

        valid property is used internally by UIInput in ProcessValidators() and not supposed to be exposed as a tag attribute?

        Show
        yip.ng added a comment - valid property is used internally by UIInput in ProcessValidators() and not supposed to be exposed as a tag attribute?
        Hide
        yip.ng added a comment - - edited

        To test the validatorMessage attribute, you need to generate a ValidatorException from a validator method. See screenshot-01 and screenshot-02 for one way to do this.

        Show
        yip.ng added a comment - - edited To test the validatorMessage attribute, you need to generate a ValidatorException from a validator method. See screenshot-01 and screenshot-02 for one way to do this.
        Hide
        yip.ng added a comment -

        One way to test the immediate attribute is to add another input field for validation:

        <h:inputText id="testInput" validator="#

        {calendarBean.validate2}

        " validatorMessage="h:inputText validation failed."
        required="true" requiredMessage="h:inputText is required."/>
        <h:messages for="testInput"/>

        Make it always fail in the validator:

        public void validate2(FacesContext context, UIComponent component, java.lang.Object newValue)

        { throw new ValidatorException(new FacesMessage()); }

        Press ENTER in the input field, with or without input. Normally, the validation message would always show up for the input field. When immediate is set to true for calendar, calendar's validation is done in Apply Request Values phase. If the validation fails, other phases (including Process Validations phase) are skipped, and the input field won't get any validation or validation message.

        See screenshots-03, -04, -05.

        Show
        yip.ng added a comment - One way to test the immediate attribute is to add another input field for validation: <h:inputText id="testInput" validator="# {calendarBean.validate2} " validatorMessage="h:inputText validation failed." required="true" requiredMessage="h:inputText is required."/> <h:messages for="testInput"/> Make it always fail in the validator: public void validate2(FacesContext context, UIComponent component, java.lang.Object newValue) { throw new ValidatorException(new FacesMessage()); } Press ENTER in the input field, with or without input. Normally, the validation message would always show up for the input field. When immediate is set to true for calendar, calendar's validation is done in Apply Request Values phase. If the validation fails, other phases (including Process Validations phase) are skipped, and the input field won't get any validation or validation message. See screenshots-03, -04, -05.
        Hide
        yip.ng added a comment - - edited

        Another way is to add a value changed listener to display the current life cycle phase id:

        <ice:dateTimeSelector valueChangeListener="#

        {calendarBean.valueChangeListener}

        " ......

        In the listener:

        public void valueChangeListener()

        { System.out.println("CalendarBean.valueChangeListener"); System.out.println("CurrentPhaseId = " + FacesContext.getCurrentInstance().getCurrentPhaseId()); }

        Make sure that validation passes and also the value changes.

        See screenshot-06.

        Show
        yip.ng added a comment - - edited Another way is to add a value changed listener to display the current life cycle phase id: <ice:dateTimeSelector valueChangeListener="# {calendarBean.valueChangeListener} " ...... In the listener: public void valueChangeListener() { System.out.println("CalendarBean.valueChangeListener"); System.out.println("CurrentPhaseId = " + FacesContext.getCurrentInstance().getCurrentPhaseId()); } Make sure that validation passes and also the value changes. See screenshot-06.
        Hide
        yip.ng added a comment -

        Revision: 24398


        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java
        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml

        Revision: 24402


        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java
        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml

        Revision: 24404


        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java
        Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml

        Show
        yip.ng added a comment - Revision: 24398 Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml Revision: 24402 Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml Revision: 24404 Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/src/org/icefaces/calendar/CalendarBean.java Modified : /qa/trunk/Regression-Icefaces2/Sparkle/calendar/web/calendarAttribute.xhtml
        Hide
        Mandeep Hayher added a comment -

        Verified successfully on on icefaces2 revision# 22531
        & Sparkle revision# 22532

        Show
        Mandeep Hayher added a comment - Verified successfully on on icefaces2 revision# 22531 & Sparkle revision# 22532

          People

          • Assignee:
            yip.ng
            Reporter:
            Mandeep Hayher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: