ICEfaces
  1. ICEfaces
  2. ICE-10876

mobi:dateTimeSpinner validation fails in showcase

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: EE-4.1.0.RC1, EE-4.1.0.GA, 4.2.BETA, 4.2
    • Labels:
      None
    • Environment:
      Tomcat 7, all browsers, showcase-mobile. Issue can be reproduced with the ICEfaces 4 public demo
    • Assignee Priority:
      P2
    • Affects:
      Compatibility/Configuration

      Description

      The year validation in the mobi Date and Time demo does not work properly.Typing an invalid year, as example "0015", opening the component and trying to adjust/correct the invalid year via the "+" or "-" buttons, triggers a JS error in desktop browsers.
      TypeError: b.toDateString is not a function
      Also, the date is not rendered in the component header, see attached screen shot.
      While the js console error is easy to reproduce, the missing header in the dateTimeEntry requires specific steps to reproduce.
      This can be reproduced while using the icefaces public demo.
      1.) Go to http://icefaces-showcase.icesoft.org/showcase-mobile.jsf and navigate to mobi Date and Time demo.
      2.) Change the Use Native control to OFF
      3.) Click inside the Date entry and edit year to "0015".
      4.) Click on the Date thumbnail and open component -> the date is displayed incorrectly as "Mon Nov 30 2015".
      4.) Click the + or - buttons to change the year -> "b.toDateString is not a function" JS error appears in the browser console.
      5.) While having the Date popup open, refresh using F5, then click the date thumbnail again to open the Date component. The date component opens up, without any date in the header
      1. header.png
        58 kB
      2. time.PNG
        16 kB

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48682 Mon May 02 15:53:57 MDT 2016 judy.guglielmin ICE-10876 previous rev. of this component showed a facesmessage when the input was empty and required as it tried to submit a blank value. Now that the renderer checks the valid year range, it was no longer doing that. A FacesMessage is now created in the decode of the renderer if the value is blank and the required attribute is true. (rather than submitting a blank value and allowing JSF input component code inherited to do the work). The validation message can be I8N with the key org.icefaces.mobi.component.datespinner.required
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/resources/messages.properties
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48678 Mon May 02 13:11:03 MDT 2016 judy.guglielmin ICE-11016 enter when useNative now does not do submit unless ace:ajax tag is present. ICE-10876 already fixes this problem for dateSpinner. mobi:flipswitch is only other input component with 4.0, and does not submit unless ace:ajax so already compliant
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/timespinner/TimeSpinnerRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48677 Mon May 02 11:16:19 MDT 2016 judy.guglielmin ICE-10876 - startYear and endYear will now be checked in all instances. The component will not submit itself unless an <ace:ajax > tag is used. An error message will be displayed on the client. Note that the browser may still think the date is valid, but any full year should work. If you use startYear as 2000 and endYear as 2020 for example, and try to enter 1999 or 2021 etc, then you will see the error message (which can be internationalized). The build had to be modified to allow use of resource loading of the messages.
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/build.xml
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.datespinner/datespinner.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/resources/messages.properties
          Commit graph ADD /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/resources/messages_en.properties
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerMeta.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48638 Mon Apr 18 11:30:55 MDT 2016 judy.guglielmin ICE-10876 - redo example page so that input values for readonly and useNative do not submit the values in input fields for the dateSpinner or timeSpinner
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/mobi/datespinner/date-example.xhtml
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48635 Fri Apr 15 16:23:46 MDT 2016 judy.guglielmin ICE-10876 - every entry for javascript now has the yrMin and yrMax defined and the validation performed. The widget input does not have an error_msg yet...not sure if that should be kept in the useNative yet either...
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/mobi/datespinner/date-example.xhtml
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.datespinner/datespinner.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48633 Fri Apr 15 13:44:29 MDT 2016 judy.guglielmin ICE-10876 - the onchange now fires a function in mobi.datespinner that checks for valid date based on yearStart and yearEnd for useNative only. min and max values are written from renderer so can be retrieved as Date js objects to check for validity. An error message span has been created for useNative only. Might not leave it, but will help for testing purposes.
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.datespinner/datespinner.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #48623 Tue Apr 12 17:06:14 MDT 2016 judy.guglielmin ICE-10882 - ensured that the script gets fired when readonly is changed.
          ICE-10876 - the onchange now fires a function in mobi.datespinner that checks for valid date based on yearStart and yearEnd attributes. Note that the function will take care of any tab out of the field, but an "enter" will automatically submit (for the button) anything on the form. The javascript is mainly for the client of that particular component and if the user wants to enforce validation on any other control on the form, they should use a jsf validator.
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.datespinner/datespinner.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/datespinner/DateSpinnerRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46310 Tue Dec 01 14:10:12 MST 2015 judy.guglielmin ICE-10876 do check on date object to ensure it is valid (for title of non-native widget). Also implement the yearStart and yearEnd attributes in the dateSpinner component so that if not valid, the year gets defaulted to the yearStart.
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/mobi/datespinner/date-example.xhtml
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.datespinner/datespinner.js

            People

            • Assignee:
              Judy Guglielmin
              Reporter:
              Liana Munroe
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: