ICEfaces
  1. ICEfaces
  2. ICE-4584

Date value not being set for selectInputDate with time

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8, 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      When the selectInputDate is set to allow time being set it does not close/set the date when a date is chosen. This is due to the fact that the time needs to be set also. The issue is that when if a user opens the calendar popup, selects a date and then clicks on a commandButton that submits the form the date value in the backing bean is not set until the submit action/actionListener is finished.

        Activity

        Hide
        Ken Fyten added a comment -

        This is the expected behavior of the component. Since we don't want the component to be firing value-change events for every selection change on a sub-section of the total date+time entry, we wait until the user has completed entering all the fields and confirms their entry by closing the popup (by clicking off the popup or clicking the "X" button) to submit the changed entry.

        It might be clearer if we added a set of "OK / Cancel" buttons to the popup (or check + "X") so the user sees they need to confirm the entry, although they will quickly learn the correct behavior when they use it.

        Show
        Ken Fyten added a comment - This is the expected behavior of the component. Since we don't want the component to be firing value-change events for every selection change on a sub-section of the total date+time entry, we wait until the user has completed entering all the fields and confirms their entry by closing the popup (by clicking off the popup or clicking the "X" button) to submit the changed entry. It might be clearer if we added a set of "OK / Cancel" buttons to the popup (or check + "X") so the user sees they need to confirm the entry, although they will quickly learn the correct behavior when they use it.
        Hide
        Ken Fyten added a comment -

        After reviewing the customer's requirements and the general working of the ice:selectInputDate component it seems we need to make the following changes to avoid user-confusion when using this component to enter both dates and times:

        1. Modify the component so that the inputText field associated with it doesn't update it's values as the user selects items in the popup. The inputText field should only be updated once the user closes the popup (and the edited/selected value is applied). This avoids confusion that can occur when the user sees the date and time values changing dynamically in the inputText field as they make selections, and then submit the form without first closing the calendar popup (and applying the changed values), thinking the updated values will be applied, but they are not (at least not prior to the initial submit).

        2. Add a new attribute called "showApplyButton" (boolean, default=false) to the component. When "showApplyButton=false" (default), the popup behavior is the same as it is now such that clicking anywhere off the popup, or clicking the "X" button will both close the popup and apply the selected date-time value. Similarly, when "showApplyButton=true" a button appears at the bottom of the popup with the "Apply" label (from the resources file, of course). When the user clicks the apply button, it closes the popup and applies the selected value (the same action that clicking the "X" button to hide the popup, or clicking anywhere off the popup does now). However, when "showApplyButton=true" the popup should not close automatically when the user clicks off of it, and closing it by clicking the "X" icon should close the popup and not apply the edited value (cancels the edits).

        Note that the behaviors exhibited by these additional component modalities must be described adequately in the component documentation.

        Show
        Ken Fyten added a comment - After reviewing the customer's requirements and the general working of the ice:selectInputDate component it seems we need to make the following changes to avoid user-confusion when using this component to enter both dates and times: 1. Modify the component so that the inputText field associated with it doesn't update it's values as the user selects items in the popup. The inputText field should only be updated once the user closes the popup (and the edited/selected value is applied). This avoids confusion that can occur when the user sees the date and time values changing dynamically in the inputText field as they make selections, and then submit the form without first closing the calendar popup (and applying the changed values), thinking the updated values will be applied, but they are not (at least not prior to the initial submit). 2. Add a new attribute called "showApplyButton" (boolean, default=false) to the component. When "showApplyButton=false" (default), the popup behavior is the same as it is now such that clicking anywhere off the popup, or clicking the "X" button will both close the popup and apply the selected date-time value. Similarly, when "showApplyButton=true" a button appears at the bottom of the popup with the "Apply" label (from the resources file, of course). When the user clicks the apply button, it closes the popup and applies the selected value (the same action that clicking the "X" button to hide the popup, or clicking anywhere off the popup does now). However, when "showApplyButton=true" the popup should not close automatically when the user clicks off of it, and closing it by clicking the "X" icon should close the popup and not apply the edited value (cancels the edits). Note that the behaviors exhibited by these additional component modalities must be described adequately in the component documentation.
        Hide
        Ken Fyten added a comment -

        Created new JIRA for #1 above: ICE-4828.

        Show
        Ken Fyten added a comment - Created new JIRA for #1 above: ICE-4828 .
        Hide
        Ken Fyten added a comment -

        Created new JIRA for #2 above: ICE-4829.

        Show
        Ken Fyten added a comment - Created new JIRA for #2 above: ICE-4829 .
        Hide
        Ken Fyten added a comment -

        If you change the selectInputDate JavaScript to close the popup onMouseDown instead of onClick it should fire BEFORE the button onClick does, thus resolving the issue.

        Show
        Ken Fyten added a comment - If you change the selectInputDate JavaScript to close the popup onMouseDown instead of onClick it should fire BEFORE the button onClick does, thus resolving the issue.
        Hide
        yip.ng added a comment -

        It worked!

        How to test:

        Run the example. Select a date and click on the submit button. Look at the log output (see screenshot-1). The "Date Value:" should be the just-submitted date, not null or some previously submitted date.

        ("Comp Date:" is from getSubmittedValue(), which is always null because by that time the submitted value is already reinitialized to null.)

        Show
        yip.ng added a comment - It worked! How to test: Run the example. Select a date and click on the submit button. Look at the log output (see screenshot-1). The "Date Value:" should be the just-submitted date, not null or some previously submitted date. ("Comp Date:" is from getSubmittedValue(), which is always null because by that time the submitted value is already reinitialized to null.)
        Hide
        Joanne Bai added a comment -

        Verified with success on trunk revision 19164

        Tested on: Tomcat6.0, FF3.5 and IE7

        Test app committed to repo\qa\trunk\Regression\ICE-4584

        Show
        Joanne Bai added a comment - Verified with success on trunk revision 19164 Tested on: Tomcat6.0, FF3.5 and IE7 Test app committed to repo\qa\trunk\Regression\ ICE-4584

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: