Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.5
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Java6, NetBeans, Linux, Glassfish V1, V2

      Description

      getClientId() returns only a part of the generated id with multiple forms (using org.apache.tapestry.form.MultipleFormSupportFactory, see https://issues.apache.org/jira/browse/TAPESTRY-1274) in render phase if no submit was before.

      I have 2 forms on a page and I'd like to generate the client ids into the HTML output. With org.apache.tapestry.form.MultipleFormSupportFactory the component ids are generated fine (with the form prefix) but getClientId skips that prefix, so it returns only "text" instead of "Form_0:text" or "Form_1:text". After submit one of the forms the getClientId returns correct values (in listener and render) in the submitted form, but the other one is still wrong.

        Activity

        József Börcsök created issue -
        Andreas Andreou made changes -
        Field Original Value New Value
        Assignee Andreas Andreou [ andyhot ]
        Hide
        Andreas Andreou added a comment -

        in render mode? is this portlet related?

        Show
        Andreas Andreou added a comment - in render mode? is this portlet related?
        Hide
        Andreas Andreou added a comment -

        Please attach/post a simple example demonstrating this...

        Are you using getClientId() before the related component renders?

        I believe that in complex scenarios (component in component in loop) the safe way is
        using it after the component renders - and it's unrelated to the form support implementation.

        Show
        Andreas Andreou added a comment - Please attach/post a simple example demonstrating this... Are you using getClientId() before the related component renders? I believe that in complex scenarios (component in component in loop) the safe way is using it after the component renders - and it's unrelated to the form support implementation.
        Hide
        József Börcsök added a comment -

        The example has a template with 2 forms and the component of the form is the same component (without loop).

        The container template:
        <form jwcid="@Form"><div jwcid="@SubComponent"/></form>
        <form jwcid="@Form"><div jwcid="@SubComponent/></form>

        The SubComponent template:
        <div>
        <span jwcid="@Insert" value="ognl:getComponent('text').clientId"/>
        <input jwcid="text@TextField" value="ognl:text"/>
        <input jwcid="@Submit" value="Enter" action="listener:doSubmit"/>
        </div>

        The SubComponent source:
        @ComponentClass()
        public abstract class SubComponent extends BaseComponent {
        public String text;

        public void doSubmit()

        { System.out.println("clientId = " + getComponent("text").getClientId()); System.out.println("text = " + text); }

        }

        After submit clientId displays correct value (in listener and in "ognl:getComponent('text').clientId") but "ognl:getComponent('text').clientId" skips form prefix without submit.

        Show
        József Börcsök added a comment - The example has a template with 2 forms and the component of the form is the same component (without loop). The container template: <form jwcid="@Form"><div jwcid="@SubComponent"/></form> <form jwcid="@Form"><div jwcid="@SubComponent/></form> The SubComponent template: <div> <span jwcid="@Insert" value="ognl:getComponent('text').clientId"/> <input jwcid="text@TextField" value="ognl:text"/> <input jwcid="@Submit" value="Enter" action="listener:doSubmit"/> </div> The SubComponent source: @ComponentClass() public abstract class SubComponent extends BaseComponent { public String text; public void doSubmit() { System.out.println("clientId = " + getComponent("text").getClientId()); System.out.println("text = " + text); } } After submit clientId displays correct value (in listener and in "ognl:getComponent('text').clientId") but "ognl:getComponent('text').clientId" skips form prefix without submit.
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.2 [ 12312202 ]
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.2 [ 12312202 ]
        Fix Version/s 4.1.3 [ 12312516 ]
        József Börcsök made changes -
        Environment Java6, NetBeans, Linux, Glassfish V1 Java6, NetBeans, Linux, Glassfish V1, V2
        Priority Minor [ 4 ] Major [ 3 ]
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.3 [ 12312516 ]
        Fix Version/s 4.1.4 [ 12312763 ]
        Andreas Andreou made changes -
        Assignee Andreas Andreou [ andyhot ] Jesse Kuhnert [ jkuhnert ]
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12397751 ] Default workflow, editable Closed status [ 12568231 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568231 ] jira [ 12591305 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        330d 5h 17m 1 Jesse Kuhnert 15/Jan/08 13:42

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            József Börcsök
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development