Hi everyone.

How can I disable autogeneration of form ids? I have a form which is located
inside zone. 

JAVA:

....
@Component(parameters = { "id=literal:registrationFormZone", "update=show"
})
private Zone registrationFormZone;

@Component(id="registrationForm", parameters = {
"id=literal:registrationForm", "clientId=literal:registrationForm",
"clientValidation=false", "zone=registrationFormZone" })
private Form registrationForm;
...


TML:

<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
<div t:id="registrationFormZone">
<form method="post" t:id="registrationForm">
        <p>Логин (e-mail): <input class="input" type="text" t:id="email" /></p>
        <p>Пароль: <input class="input" type="password" t:id="password" /></p>
        <p><input disabled="false" t:type="submit" class="Go golite regGo"
value="Принять и зарегистрироваться" /></p>
</form>
</div>
</t:container>


Result HTML:

<div id="registrationFormZone" class="t-zone">
<form id="registrationForm_12d9dac2ead" method="post"
action="/shop/products.template.template.loginregisterform.registrationformcomponent.registrationform"
clientid="registrationForm" class="t-prevent-submission">
....
</form>
</div>


After the first submit the content of zone is updated and form has another
id:


<div id="registrationFormZone" class="t-zone">
<form id="registrationForm_12d9dad0b88" method="post"
action="/shop/products.template.template.loginregisterform.registrationformcomponent.registrationform"
clientid="registrationForm">


And the second submit will not send data via AJAX (may be the event assigned
to submit button is linked to old id and not valid anymore).

I looked into the sources of Form.class:

void beginRender(MarkupWriter writer)
{
....   
clientId = javascriptSupport.allocateClientId(resources);


May be it would be better to add parameter clientId and check if user didn't
assign custom id make it automatically?
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-Disable-element-id-autogeneration-tp3347539p3347539.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to