[ 
https://issues.apache.org/jira/browse/TAPESTRY-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474375
 ] 

József Börcsök commented on TAPESTRY-1278:
------------------------------------------

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="[EMAIL PROTECTED]" 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.

> wrong clientId with multiple forms
> ----------------------------------
>
>                 Key: TAPESTRY-1278
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1278
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.1.2
>         Environment: Java6, NetBeans, Linux, Glassfish V1
>            Reporter: József Börcsök
>         Assigned To: Andreas Andreou
>            Priority: Minor
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to