Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-997

Calendar - incorrect use of converters

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Calendar component uses converter.getAsObject on render phase.
      This is wrong.

      Correct behavior - use converter.getAsObject on process validations phase.
      In case of bad user input - converter will give conversion exception, display submitted value in input field, in calendar grid select last user selected day (if exists).

        Gliffy Diagrams

          Activity

          Hide
          viktor_volkov Viktor Volkov added a comment -

          verified on build 31 richfaces 3.1.3

          Show
          viktor_volkov Viktor Volkov added a comment - verified on build 31 richfaces 3.1.3
          Hide
          daniel.soneira Daniel Soneira added a comment -

          Today I stumbled again over this mess of CalendarRendererBase.getSelectedDate...
          I will upload a modified example war file.

          I will make this as clear as possible. The last fix was a dirty hack and did not solve the misuse of conversion code in the renderer at all.

          THIS time PLEASE rewrite your calendar code:
          Renderer renders, Converter converts, Component stores value - the way it was meant to be.

          Please reopen this issue.

          Thanks,
          Daniel

          Show
          daniel.soneira Daniel Soneira added a comment - Today I stumbled again over this mess of CalendarRendererBase.getSelectedDate... I will upload a modified example war file. I will make this as clear as possible. The last fix was a dirty hack and did not solve the misuse of conversion code in the renderer at all. THIS time PLEASE rewrite your calendar code: Renderer renders, Converter converts, Component stores value - the way it was meant to be. Please reopen this issue. Thanks, Daniel
          Hide
          ilya_shaikovsky Ilya Shaikovsky added a comment -

          please check the users issues. There is a couple of posts at forum again.

          Show
          ilya_shaikovsky Ilya Shaikovsky added a comment - please check the users issues. There is a couple of posts at forum again.
          Hide
          daniel.soneira Daniel Soneira added a comment -

          Here is the new modified version.

          Steps to reproduce:

          1) open http://localhost:8080/richfaces/calendar.jsf
          2) type "asdf" into the calendar input field.
          3) press cancel

          The problem here is, that the renderer tries to access the submitted value and do some conversion with that. Which is clearly not its task. The renderer should not care about conversion - he should take the value as is (was already converted before).

          Show
          daniel.soneira Daniel Soneira added a comment - Here is the new modified version. Steps to reproduce: 1) open http://localhost:8080/richfaces/calendar.jsf 2) type "asdf" into the calendar input field. 3) press cancel The problem here is, that the renderer tries to access the submitted value and do some conversion with that. Which is clearly not its task. The renderer should not care about conversion - he should take the value as is (was already converted before).
          Hide
          vbaranov Vladislav Baranov added a comment -

          Fixed in /trunk.

          Show
          vbaranov Vladislav Baranov added a comment - Fixed in /trunk.

            People

            • Assignee:
              ayanul Aleksej Yanul
              Reporter:
              maksimkaszynski Maksim Kaszynski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development