MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1225

data lost in dataList when conversion error is thrown

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.1.6
    • Fix Version/s: 1.1.7
    • Component/s: Data List
    • Labels:
      None
    • Environment:
      tomcat

      Description

      On jsp there are: dataList with one inputtext component, one main DATE (inputtext with date converter) component, and one main myName component (required).
      Now: filling all data, and putting wrong data in DATE field, click 'Next', validation occurs, message is displayed, but the entered data in dataList are lost.
      However, when both DATE field has wrong date and myName field is empty (two validation errors), the entered data in dataList remains!

      Looks The problem is with handling ConverterException and dataList.

      env: MYFACES 1.1.5, tomahawk 1.1.6.

      Example project is attached. Just fill in 'lib' directory, attach context in Tomcat and run: http://localhost:8080/conversionExceptionAndLostData/jsp/testTDataListAndValidation.jsf

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        82d 17h 7m 1 Leonardo Uribe 25/Jun/08 02:12
        Closed Closed Reopened Reopened
        407d 11h 32m 1 Tomasz Bech 06/Aug/09 13:45
        Tomasz Bech made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Tomasz Bech added a comment -

        this fix is working on myfaces and tomahawk 1.1.8, but unfortunatelly it is not working on sun ri 1.1_01

        Show
        Tomasz Bech added a comment - this fix is working on myfaces and tomahawk 1.1.8, but unfortunatelly it is not working on sun ri 1.1_01
        Leonardo Uribe made changes -
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Fix Version/s 1.1.7 [ 12313398 ]
        Leonardo Uribe made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Hide
        Leonardo Uribe added a comment -

        The error was due to _isValidChilds field of HtmlDataTableHack is private, so when is overridden processUpdates and processValidators if some error exists, this field should be false.

        The solution was to create a protected method on HtmlDataTableHack like this:

        protected void checkUpdateModelError(FacesContext context)
        {
        if (context.getRenderResponse())

        { _isValidChilds = false; }

        }

        so when processUpdates and processValidators is overriden, this method is called and set the value properly.

        Thanks for the example, it makes easier find and solve this bug.

        fixed at revision 671389

        Show
        Leonardo Uribe added a comment - The error was due to _isValidChilds field of HtmlDataTableHack is private, so when is overridden processUpdates and processValidators if some error exists, this field should be false. The solution was to create a protected method on HtmlDataTableHack like this: protected void checkUpdateModelError(FacesContext context) { if (context.getRenderResponse()) { _isValidChilds = false; } } so when processUpdates and processValidators is overriden, this method is called and set the value properly. Thanks for the example, it makes easier find and solve this bug. fixed at revision 671389
        Tomasz Bech made changes -
        Field Original Value New Value
        Attachment conversionExceptionAndLostData.zip [ 12379238 ]
        Tomasz Bech created issue -

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Tomasz Bech
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development