You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ashish Raniwala <ar...@gmail.com> on 2005/01/29 00:32:57 UTC

Submit Component Problem

Hi Guys,
I am facing a strange problem. We have the requirement to put submit button 
on top of the page.
I am using Submit component with listener methods. If I put submit button on 
top of the page my listener method does not get form properties but if I put 
submit button on bottom of the page I get my form properties in my listener 
method.
Here is trimmed down version of my HTML

<form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
id="processForm" class="pageForm">
<input type="submit" value="Save" id="Save" class="button" jwcid="@Submit" 
label="message:saveButton" listener="ognl:listeners.save" />
<table border="0" cellpadding="0" cellspacing="0" class="twocol">
<tr>
<th><label jwcid="@FieldLabel" 
field="ognl:components.processNameField">Name</label></th>
<td>
<input jwcid="processNameField" type="text" id="processName">Name</input>
</td>
</tr>
</table>
</form>

Specification of field is
    <component id="processNameField" type="ValidField">
        <binding name="value" expression="process.processName"/>
        <binding name="validator" expression="beans.requiredValidator"/>
        <message-binding name="displayName" key="processNameLabel"/>
    </component>

With above HTML I don't get processName in my process object in listener 
method save!!
But if I shift submit button just below table closing tag. I get processName 
in process object correctly...

If I am doing something wrong here or its a bug in tapestry?

Thanks,
Ashish 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Submit Component Problem

Posted by Ashish Raniwala <ar...@gmail.com>.
Thanks for your quick reply. So much relief to know its tapestry known 
issue. I am new to tapestry so I thought I am not on right track.
The solution you have proposed worked for me.
Thanks,
Ashish

----- Original Message ----- 
From: "Danny Mandel" <dm...@tolweb.org>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, January 28, 2005 3:38 PM
Subject: Re: Submit Component Problem


> This is a known issue and is not a bug in tapestry.  When you place a 
> listener on an individual submit as opposed to the form, the listener gets 
> called in the order it appears on the form.  If it's at the top, the other 
> components in the form haven't had a chance to rewind, so they won't have 
> set their values properly.  If you move your listener from your submit 
> component to the form, everything will have had its value set by the time 
> the listener gets called (since the form listener gets fired after the 
> form has completely rewound).
>
> So, instead of
>
> <form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
> id="processForm" class="pageForm">
> <input type="submit" value="Save" id="Save" class="button" jwcid="@Submit" 
> label="message:saveButton" listener="ognl:listeners.save" />
>
> Do this:
>
> <form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
> id="processForm" class="pageForm" listener="ognl:listeners.save" >
> <input type="submit" value="Save" id="Save" class="button" jwcid="@Submit" 
> label="message:saveButton" />
>
> Hope that helps,
> Danny
>
> Ashish Raniwala wrote:
>
>> Hi Guys,
>> I am facing a strange problem. We have the requirement to put submit 
>> button on top of the page.
>> I am using Submit component with listener methods. If I put submit button 
>> on top of the page my listener method does not get form properties but if 
>> I put submit button on bottom of the page I get my form properties in my 
>> listener method.
>> Here is trimmed down version of my HTML
>>
>> <form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
>> id="processForm" class="pageForm">
>> <input type="submit" value="Save" id="Save" class="button" 
>> jwcid="@Submit" label="message:saveButton" listener="ognl:listeners.save" 
>> />
>> <table border="0" cellpadding="0" cellspacing="0" class="twocol">
>> <tr>
>> <th><label jwcid="@FieldLabel" 
>> field="ognl:components.processNameField">Name</label></th>
>> <td>
>> <input jwcid="processNameField" type="text" id="processName">Name</input>
>> </td>
>> </tr>
>> </table>
>> </form>
>>
>> Specification of field is
>>    <component id="processNameField" type="ValidField">
>>        <binding name="value" expression="process.processName"/>
>>        <binding name="validator" expression="beans.requiredValidator"/>
>>        <message-binding name="displayName" key="processNameLabel"/>
>>    </component>
>>
>> With above HTML I don't get processName in my process object in listener 
>> method save!!
>> But if I shift submit button just below table closing tag. I get 
>> processName in process object correctly...
>>
>> If I am doing something wrong here or its a bug in tapestry?
>>
>> Thanks,
>> Ashish
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Submit Component Problem

Posted by Danny Mandel <dm...@tolweb.org>.
This is a known issue and is not a bug in tapestry.  When you place a 
listener on an individual submit as opposed to the form, the listener 
gets called in the order it appears on the form.  If it's at the top, 
the other components in the form haven't had a chance to rewind, so they 
won't have set their values properly.  If you move your listener from 
your submit component to the form, everything will have had its value 
set by the time the listener gets called (since the form listener gets 
fired after the form has completely rewound).

So, instead of

<form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
id="processForm" class="pageForm">
<input type="submit" value="Save" id="Save" class="button" 
jwcid="@Submit" label="message:saveButton" listener="ognl:listeners.save" />

Do this:

<form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
id="processForm" class="pageForm" listener="ognl:listeners.save" >
<input type="submit" value="Save" id="Save" class="button" 
jwcid="@Submit" label="message:saveButton" />

Hope that helps,
Danny

Ashish Raniwala wrote:

> Hi Guys,
> I am facing a strange problem. We have the requirement to put submit 
> button on top of the page.
> I am using Submit component with listener methods. If I put submit 
> button on top of the page my listener method does not get form 
> properties but if I put submit button on bottom of the page I get my 
> form properties in my listener method.
> Here is trimmed down version of my HTML
>
> <form jwcid="processForm@Form" delegate="ognl:beans.delegate" 
> id="processForm" class="pageForm">
> <input type="submit" value="Save" id="Save" class="button" 
> jwcid="@Submit" label="message:saveButton" 
> listener="ognl:listeners.save" />
> <table border="0" cellpadding="0" cellspacing="0" class="twocol">
> <tr>
> <th><label jwcid="@FieldLabel" 
> field="ognl:components.processNameField">Name</label></th>
> <td>
> <input jwcid="processNameField" type="text" id="processName">Name</input>
> </td>
> </tr>
> </table>
> </form>
>
> Specification of field is
>    <component id="processNameField" type="ValidField">
>        <binding name="value" expression="process.processName"/>
>        <binding name="validator" expression="beans.requiredValidator"/>
>        <message-binding name="displayName" key="processNameLabel"/>
>    </component>
>
> With above HTML I don't get processName in my process object in 
> listener method save!!
> But if I shift submit button just below table closing tag. I get 
> processName in process object correctly...
>
> If I am doing something wrong here or its a bug in tapestry?
>
> Thanks,
> Ashish
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org