javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-437

Immediately process update HtmlInputHidden values during conversion/validation phase

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Lifecycle
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      437
    • Status Whiteboard:
      Hide

      cat2 frame javadoc size_medium importance_small

      Show
      cat2 frame javadoc size_medium importance_small

      Description

      Requested by use balusc
      (https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=765):

      Imagine a request scoped bean with a h:inputHidden field and another UIInput
      field which is to be converted and/or validated. If the h:inputHidden already
      has a value but the conversion and/or validation of the another UIInput field
      fails, then the value of the h:inputHidden will get lost.

      Truly, this is behaviour by specification, but it is not very intuitive. One
      would expect that hidden input values (read: the values which aren't to be
      filled in by the client, but by the server) should retain its value. In real
      world web applications the sole purpose of hidden input elements is to transfer
      values from request to request without any client interaction.

      Thus, hereby my request for an enhancement in the API: make sure that the API
      retains hidden input values regardless of the global outcome of the
      conversion/validation phase. And only if the hidden input value itself is
      already successfully converted and validated.

      In theory this can simply be achieved by adding the following lines at the
      bottom of the if (isValid()) {} block which starts at line 887 of
      javax.faces.component.UIInput in 2.0.0 EDR1:

      if (this instanceof HtmlInputHidden) {
      processUpdates(context);
      }

      If necessary you can also let it implement a certain marker interface, e.g.
      RetainableValueHolder or so (I just say something) so that one can decide to let
      some custom component implement it.

      I am almost sure that this will be greatly appreciated by the web development
      world. It is certainly much more intuitive. And it is much more elegant than the
      'workaround' to bind the h:inputHidden and using the UIInput#getValue() /
      setValue() instead.

        Activity

        Jason Lee created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 437 20042
        Ed Burns made changes -
        Assignee sheetalv [ sheetalv ] Ed Burns [ edburns ]
        Ed Burns made changes -
        Assignee Ed Burns [ edburns ]
        Ed Burns made changes -
        Fix Version/s 2.3 [ 16372 ]
        Fix Version/s 2.2 [ 10403 ]
        Ed Burns made changes -
        Priority Major [ 3 ] Trivial [ 5 ]
        Fix Version/s 2.3 [ 16372 ]
        Manfred Riem made changes -
        Priority Trivial [ 5 ] Minor [ 4 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jason Lee
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: