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

          Hide
          Judy Guglielmin added a comment -

          rev 46310

          Show
          Judy Guglielmin added a comment - rev 46310
          Hide
          Liana Munroe added a comment -

          Tested with ICEfaces 4 trunk r46310. JS console error is no longer seen.
          The date picker will now accept any 4 digit number for the year such as '7777'. Is this expected?

          The missing header on the date picker is still reproducible.
          To reproduce:
          1.) Using device or desktop browser navigate to the showcase-mobile Date and Time demo.
          2.) Toggle Use Native to OFF.
          3.) Open the date picker, the header is visible. Choose cancel
          4.) Toggle Read Only to ON, then back to OFF.
          5.) Open the date picker again, the header will not be visible.

          Show
          Liana Munroe added a comment - Tested with ICEfaces 4 trunk r46310. JS console error is no longer seen. The date picker will now accept any 4 digit number for the year such as '7777'. Is this expected? The missing header on the date picker is still reproducible. To reproduce: 1.) Using device or desktop browser navigate to the showcase-mobile Date and Time demo. 2.) Toggle Use Native to OFF. 3.) Open the date picker, the header is visible. Choose cancel 4.) Toggle Read Only to ON, then back to OFF. 5.) Open the date picker again, the header will not be visible.
          Hide
          Carmen Cristurean added a comment -

          This issue is still reproducible with ICEfaces-4.1.0 tag r46885.

          Show
          Carmen Cristurean added a comment - This issue is still reproducible with ICEfaces-4.1.0 tag r46885.
          Hide
          Carmen Cristurean added a comment - - edited

          This issue is still reproducible with ICEface 4.1.1 Jenkins Build #2 on iOS7/iOS9.

          Show
          Carmen Cristurean added a comment - - edited This issue is still reproducible with ICEface 4.1.1 Jenkins Build #2 on iOS7/iOS9.
          Hide
          Judy Guglielmin added a comment -

          rev. 48623.
          Note that an enter will still submit the incorrect date as the submit will be done on the form (jsf validation should be used for that). A tab out will do the correct validation. WHen using 'useNative' true, perhaps jsf validation should be used as the component writes out a "min" and "max" as her html5 specs, but they are not always implemented in the browsers.

          Show
          Judy Guglielmin added a comment - rev. 48623. Note that an enter will still submit the incorrect date as the submit will be done on the form (jsf validation should be used for that). A tab out will do the correct validation. WHen using 'useNative' true, perhaps jsf validation should be used as the component writes out a "min" and "max" as her html5 specs, but they are not always implemented in the browsers.
          Hide
          Carmen Cristurean added a comment - - edited

          IF4 trunk r48623/ Chrome/desktop: a JS occurs when entering an invalid year (0015), and changing 'Use Native' to off:
          Chrome:
          VM225:6 Uncaught ReferenceError: yrMin is not definedmobi.datespinner.validate @ VM225:6mobi.datespinner.updateDate @ VM225:5mobi.datespinner.init @ VM225:3(anonymous function) @ VM272:1runScripts @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1doUpdate @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1response @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1onComplete @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1AjaxEngine.req.xmlReq.onreadystatechange @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1

          When opening the date spinner component, the header does not render a date, as in the attached image.

          Show
          Carmen Cristurean added a comment - - edited IF4 trunk r48623/ Chrome/desktop: a JS occurs when entering an invalid year (0015), and changing 'Use Native' to off: Chrome: VM225:6 Uncaught ReferenceError: yrMin is not definedmobi.datespinner.validate @ VM225:6mobi.datespinner.updateDate @ VM225:5mobi.datespinner.init @ VM225:3(anonymous function) @ VM272:1runScripts @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1doUpdate @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1response @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1onComplete @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1AjaxEngine.req.xmlReq.onreadystatechange @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160413:1 When opening the date spinner component, the header does not render a date, as in the attached image.
          Hide
          Liana Munroe added a comment -

          Tested with ICEfaces 4 trunk 48623. Showcase mobile demo Date and Time fails manually on mobile devices ipad ios 9 and android 6.0.1.
          When useNative = true the date value is not updated after setting it with the picker.
          The time value does update as expected.

          Show
          Liana Munroe added a comment - Tested with ICEfaces 4 trunk 48623. Showcase mobile demo Date and Time fails manually on mobile devices ipad ios 9 and android 6.0.1. When useNative = true the date value is not updated after setting it with the picker. The time value does update as expected.
          Hide
          Judy Guglielmin added a comment -

          rev 48633 new js function for useNative only. Also has error message span to help in testing.

          Show
          Judy Guglielmin added a comment - rev 48633 new js function for useNative only. Also has error message span to help in testing.
          Hide
          Liana Munroe added a comment - - edited

          Tested with showcase.war from ICEfaces 4 trunk Jenkins build 1913.
          The js console error is still reproduced when useNative=off/on (desktop browser) or useNative=off (mobil device) and entering an invalid date.

          To reproduce
          1.) Open the Date and Time showcase mobile demo in a desktop browser. (can also be reproduced on mobile device)
          2.) Toggle Use native to off if using mobile device.
          3.) Type 0012-12-12 into the date field. Press TAB or ENTER. The console error is shown.

          VM126:6 Uncaught ReferenceError: yrMin is not definedmobi.datespinner.validate @ VM126:6mobi.datespinner.updateDate @ VM126:5mobi.datespinner.init @ VM126:3(anonymous function) @ VM132:1runScripts @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1doUpdate @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1response @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1onComplete @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1AjaxEngine.req.xmlReq.onreadystatechange @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1

          Show
          Liana Munroe added a comment - - edited Tested with showcase.war from ICEfaces 4 trunk Jenkins build 1913. The js console error is still reproduced when useNative=off/on (desktop browser) or useNative=off (mobil device) and entering an invalid date. To reproduce 1.) Open the Date and Time showcase mobile demo in a desktop browser. (can also be reproduced on mobile device) 2.) Toggle Use native to off if using mobile device. 3.) Type 0012-12-12 into the date field. Press TAB or ENTER. The console error is shown. VM126:6 Uncaught ReferenceError: yrMin is not definedmobi.datespinner.validate @ VM126:6mobi.datespinner.updateDate @ VM126:5mobi.datespinner.init @ VM126:3(anonymous function) @ VM132:1runScripts @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1doUpdate @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1response @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1onComplete @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1AjaxEngine.req.xmlReq.onreadystatechange @ jsf.js.jsf?ln=javax.faces&v=4_2_0_160415:1
          Hide
          Judy Guglielmin added a comment -

          rev 48635

          Show
          Judy Guglielmin added a comment - rev 48635
          Hide
          Judy Guglielmin added a comment -

          redo example page so that submit of input does not submit the values in the dateSpinner and timeSpinner components

          Show
          Judy Guglielmin added a comment - redo example page so that submit of input does not submit the values in the dateSpinner and timeSpinner components
          Hide
          Judy Guglielmin added a comment -

          rev 48638 for example code page fix

          Show
          Judy Guglielmin added a comment - rev 48638 for example code page fix
          Hide
          Liana Munroe added a comment - - edited

          Tested with ICEfaces 4 trunk r 48638. There are still issues with the showcase-mobile date and Time demo.
          1.) The Time Spinner input changes from PM to AM when submit.
          2.) You can still set invalid dates by editing the date field then pressing Enter, or on a mobile device by dismissing the keyboard.
          Please see attached screenshot time.png

          Show
          Liana Munroe added a comment - - edited Tested with ICEfaces 4 trunk r 48638. There are still issues with the showcase-mobile date and Time demo. 1.) The Time Spinner input changes from PM to AM when submit. 2.) You can still set invalid dates by editing the date field then pressing Enter, or on a mobile device by dismissing the keyboard. Please see attached screenshot time.png
          Hide
          Liana Munroe added a comment -

          Tested with ICEfaces 4 trunk r48642.
          Issue 1 - The Time Spinner input changes from PM to AM when submit can no longer be reproduced.
          Issue 2 - You can still set invalid dates by editing the date field then pressing Enter, or on a mobile device by dismissing the keyboard, is still reproducible.

          Show
          Liana Munroe added a comment - Tested with ICEfaces 4 trunk r48642. Issue 1 - The Time Spinner input changes from PM to AM when submit can no longer be reproduced. Issue 2 - You can still set invalid dates by editing the date field then pressing Enter, or on a mobile device by dismissing the keyboard, is still reproducible.
          Hide
          Judy Guglielmin added a comment -

          The component now does not submit unless an ace:ajax is present. The renderer also checks the year values to ensure nothing is submitted (like a form submit that bypasses any client validation) that does not pass the year range. Build was modified to use the messages as resource bundle to I8N the error message on the client. The non-native widget will respect the min and max year values. The useNative may or may not depending on the browser implementation of html5 markup, but when submitting the input element (where it is source), the onchange/blur will run client side validation built into the component.
          rev. 48677

          Show
          Judy Guglielmin added a comment - The component now does not submit unless an ace:ajax is present. The renderer also checks the year values to ensure nothing is submitted (like a form submit that bypasses any client validation) that does not pass the year range. Build was modified to use the messages as resource bundle to I8N the error message on the client. The non-native widget will respect the min and max year values. The useNative may or may not depending on the browser implementation of html5 markup, but when submitting the input element (where it is source), the onchange/blur will run client side validation built into the component. rev. 48677
          Hide
          Judy Guglielmin added a comment -

          see last comment.

          Show
          Judy Guglielmin added a comment - see last comment.
          Hide
          Liana Munroe added a comment - - edited

          Verified showcase demo issue ICEfaces EE-4.1 r48677. Tomcat 8, IE 11, FF 43, Chrome 50, android 6.0.1, ios 9.3.1.
          It seems that with this latest fix the required attribute no longer functions with the mobi:dateSpinner. No messages are rendered when trying to submit an empty date. This can be demonstrated with the QA test app /dateSpinnerDynAttribute.jsf found at
          http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Manual/dateSpinner.
          Open the application, select rendered and required, then submit the field with no value. Prior to the last commit for this JIRA a required message was shown, now it no longer appears. The required attribute is not seen in the browser console when inspecting the markup.

          Show
          Liana Munroe added a comment - - edited Verified showcase demo issue ICEfaces EE-4.1 r48677. Tomcat 8, IE 11, FF 43, Chrome 50, android 6.0.1, ios 9.3.1. It seems that with this latest fix the required attribute no longer functions with the mobi:dateSpinner. No messages are rendered when trying to submit an empty date. This can be demonstrated with the QA test app /dateSpinnerDynAttribute.jsf found at http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Manual/dateSpinner . Open the application, select rendered and required, then submit the field with no value. Prior to the last commit for this JIRA a required message was shown, now it no longer appears. The required attribute is not seen in the browser console when inspecting the markup.
          Hide
          Mircea Toma added a comment -

          In regard to useNative=“true”option:- uses onchange attribute with jsf call. Problem is that when user presses enter a “keydown” shows up in the network request. When I code a “onkeydown” attribute, it fires unless an enter key is pressed. The network shows an onkeydown being submitted on the form, but the js function is not called. The bridge just submits it with a “keydown” execute=“@all” render=“@all” when you have focus on the input field and hit enter, the form submits and this is the result (but the onkeypress is not fired). ClientValidation must have already dealt with this I am thinking . :

          To avoid having the bridge capture the 'keydown' event the callback function registered by the component will need to cancel the event bubbling so that the 'keydown' event does not reach the form and thus not trigger the submit.

          Show
          Mircea Toma added a comment - In regard to useNative=“true”option:- uses onchange attribute with jsf call. Problem is that when user presses enter a “keydown” shows up in the network request. When I code a “onkeydown” attribute, it fires unless an enter key is pressed. The network shows an onkeydown being submitted on the form, but the js function is not called. The bridge just submits it with a “keydown” execute=“@all” render=“@all” when you have focus on the input field and hit enter, the form submits and this is the result (but the onkeypress is not fired). ClientValidation must have already dealt with this I am thinking . : To avoid having the bridge capture the 'keydown' event the callback function registered by the component will need to cancel the event bubbling so that the 'keydown' event does not reach the form and thus not trigger the submit.
          Hide
          Judy Guglielmin added a comment -

          rev 48682 for required validation message added to component, see last comment.

          Show
          Judy Guglielmin added a comment - rev 48682 for required validation message added to component, see last comment.
          Hide
          Liana Munroe added a comment -

          Verified required attribute functioning again. ICEfaces EE-4.1 r48686. Tomcat 8

          Show
          Liana Munroe added a comment - Verified required attribute functioning again. ICEfaces EE-4.1 r48686. Tomcat 8

            People

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

              Dates

              • Created:
                Updated:
                Resolved: