javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-26

Hidden Field - FormRenderer - Renderer Dependencies

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      26

      Description

      Our implementation to set up hidden fields in the form introduces
      tightly coupled renderer dependencies. For the original cause of
      this implementation see bugster report 5055795.

      For example.. We expose public static methods on FormRenderer that
      are used in CommandLinkRenderer as well as HiddenFieldRenderer.
      (ex: FormRenderer.addNeededHiddenField....)
      Anyone now using our CommandLinkRenderer must also use our FormRenderer..

      1. message.txt
        74 kB
        Ed Burns
      2. message.txt
        20 kB
        Ed Burns

        Activity

        Hide
        jayashri added a comment -

        CommandButton and CommandLink renderers use different ways to find its nearest
        form element if interpreted the diffs correctly.

        CommandButton
        + while (!myForm.getFamily().equals("javax.faces.Form") && root != myForm)

        { + myForm = myForm.getParent(); + }

        commandLink
        while (parent != null) {
        if (parent instanceof UIForm)

        { break; }

        parent = parent.getParent();
        }

        Shouldn't it be consistent ?

        Otherwise looks great.
        r=jayashri

        Show
        jayashri added a comment - CommandButton and CommandLink renderers use different ways to find its nearest form element if interpreted the diffs correctly. CommandButton + while (!myForm.getFamily().equals("javax.faces.Form") && root != myForm) { + myForm = myForm.getParent(); + } commandLink while (parent != null) { if (parent instanceof UIForm) { break; } parent = parent.getParent(); } Shouldn't it be consistent ? Otherwise looks great. r=jayashri
        Hide
        Ed Burns added a comment -

        Fix checked in, including Jayashri's suggestion.

        Show
        Ed Burns added a comment - Fix checked in, including Jayashri's suggestion.
        Hide
        Ed Burns added a comment -

        While merging wta-head into jsf-head, I discovered another bug.

        The HiddenRenderer needs to make sure that its values are cleared when the
        "clear" script is executed. This leads to a contract between the HiddenRenderer
        and the CommandLinkRenderer. We currently don't do this, creating a back buttor
        problem:

        — src/com/sun/faces/renderkit/html_basic/HiddenRenderer.java 2005-04-21
        14:55:36.000000000 -0400
        +++
        /home/edburns/Projects/J2EE/workareas/webtier-alignment-trunk/prototype/jsf-ri/src/com/sun/faces/renderkit/html_basic/HiddenRenderer.java
        2005-05-02 17:23:17.000000000 -0400
        @@ -1,5 +1,5 @@
        /*

        • * $Id: HiddenRenderer.java,v 1.23 2005/04/21 18:55:36 edburns Exp $
          + * $Id: HiddenRenderer.java,v 1.4 2005/03/31 16:39:17 edburns Exp $
          */

        /*
        @@ -89,6 +89,8 @@
        writer.writeAttribute("value", currentValue, "value");
        }
        writer.endElement("input");
        +
        + FormRenderer.addRenderedHiddenField(context, clientId);
        }

        // The testcase for this class is TestRenderers_3.java

        Show
        Ed Burns added a comment - While merging wta-head into jsf-head, I discovered another bug. The HiddenRenderer needs to make sure that its values are cleared when the "clear" script is executed. This leads to a contract between the HiddenRenderer and the CommandLinkRenderer. We currently don't do this, creating a back buttor problem: — src/com/sun/faces/renderkit/html_basic/HiddenRenderer.java 2005-04-21 14:55:36.000000000 -0400 +++ /home/edburns/Projects/J2EE/workareas/webtier-alignment-trunk/prototype/jsf-ri/src/com/sun/faces/renderkit/html_basic/HiddenRenderer.java 2005-05-02 17:23:17.000000000 -0400 @@ -1,5 +1,5 @@ /* * $Id: HiddenRenderer.java,v 1.23 2005/04/21 18:55:36 edburns Exp $ + * $Id: HiddenRenderer.java,v 1.4 2005/03/31 16:39:17 edburns Exp $ */ /* @@ -89,6 +89,8 @@ writer.writeAttribute("value", currentValue, "value"); } writer.endElement("input"); + + FormRenderer.addRenderedHiddenField(context, clientId); } // The testcase for this class is TestRenderers_3.java
        Hide
        Ed Burns added a comment -

        After talking to Jayashri, I realize that we don't need to clear out the values
        from h:inputHidden fields in the page. These values should be submitted
        regardless of any commandLinks in the page.

        Closing.

        Show
        Ed Burns added a comment - After talking to Jayashri, I realize that we don't need to clear out the values from h:inputHidden fields in the page. These values should be submitted regardless of any commandLinks in the page. Closing.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            rogerk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: