One more thing.
I made a mistake in the 2nd case. Using a property expression ${zoneId} to
bind the zone parameter in the Form is allowed but not preferred. Better
use t:zone="prop:zoneId".


Cheers,
Dragan Sahpaski



On Mon, Dec 12, 2011 at 8:01 AM, Dragan Sahpaski
<dragan.sahpa...@gmail.com>wrote:

> Hi,
> 1. If your javascript code is located after the zone, than you can make a
> getter getZoneId(){ return zone.getClientId();} and use it in the
> javascript with a property expression ${zoneId}.
>
> 2. Of you want to provide the exact zone id it is possible
>
> <t:Dialog t:clientId="loginDialog" t:title="${shortTitle}" >
> <t:zone t:id="loginZone" id="${loginZone}">
> <form t:type="Form" t:id="loginForm" id="loginForm" class="loginForm"
> title="${res.Login}" t:zone="${loginZone}">
>
> <table  align="center">
> <tr>
> <td colspan="2"><t:errors /></td>
> </tr>
>                                        .... some other form elements .....
> </table>
> </form>
> </t:zone>
> </t:Dialog>
>
> Java
>
> public String getLoginZone(){
>   return "loginZone";
> }
>
> 3. There is another solution in your case. You can use the '^' symbol to
> tell the form to bind to the surrounding  zone see here in the
> documentation.
> http://tapestry.apache.org/ajax-and-zones.html#AjaxandZones-ZoneComponentIdvs.ZoneElementId
>
> <t:Dialog t:clientId="loginDialog" t:title="${shortTitle}" >
> <t:zone t:id="loginZone">
> <form t:type="Form" t:id="loginForm" id="loginForm" class="loginForm"
> title="${res.Login}" t:zone="^">
>
> <table  align="center">
> <tr>
> <td colspan="2"><t:errors /></td>
> </tr>
>                                        .... some other form elements .....
> </table>
> </form>
> </t:zone>
> </t:Dialog>
>
> Hope this helps.
>
> Cheers,
> Dragan Sahpaski
>
>
> On Mon, Dec 12, 2011 at 7:53 AM, Andreas Bohnert <a...@weberhofer.at>wrote:
>
>> Hi,
>>
>> the id of a form element changes after the Zone which contains the form
>> is updated. (id before: loginForm, id after loginForm_13871283787...)
>> I know, this is done by tapestry to prevent unwanted id clashes (see:
>> What's that weird number in the middle of the client ids after a Zone is
>> updated? 
>> http://tapestry.apache.org/**ajax-components-faq.html<http://tapestry.apache.org/ajax-components-faq.html>
>> )
>>
>> But there is no solution given in how to deal with this random ids if
>> your javascript code depends on the id. Some people have suggested to
>> provide both id and t:id by yourself to prevent tapestry from changing the
>> ids but for me it does not work.
>>
>> here is my code:
>>
>> <t:Dialog t:clientId="loginDialog" t:title="${shortTitle}" >
>> <t:zone t:id="loginZone" id="loginZone">
>> <form t:type="Form" t:id="loginForm" id="loginForm" class="loginForm"
>> title="${res.Login}" t:zone="loginZone">
>> <table  align="center">
>> <tr>
>> <td colspan="2"><t:errors /></td>
>> </tr>
>>                                        .... some other form elements .....
>> </table>
>> </form>
>> </t:zone>
>> </t:Dialog>
>>
>> $('#oginForm').submit(); // this does not work anymore if the zone has
>> got updated
>>
>> There is another suggestion to use setSubmittingElement before submit the
>> form, but I haven't find a jquery method to do this (and I don't really
>> understand why I have to do this)
>>
>> I'm using tapestry 5.3 and tapestry5-jquery-3.0.0-**20111122.140306-63.
>>
>> Thanks for your help!!
>> Andreas
>>
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: 
>> users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org>
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

Reply via email to