You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by david joffrin <da...@hotmail.com> on 2006/11/10 00:24:57 UTC
Dymanic list of ValidField components
Hi,
First, i am a Tapestry v3 user.
Has any one any code to share to release a dynamic ValidField components?
To make it clear, i have an entry page with several valid field components.
That list is dymanic and depends on the product.
Is there a way to do that with Tapestry?
Otherwise, I have tried to addComponent in my BasePage (to get over the
..page component listing), but I can not find out how to instanciate a
ValidField component. Is there a factory for that?
If I would go with that route, how can I implement that line then <input
jwcid="quantity" type="text" size="20" maxlength="8"/>. Can "quantity" be
dymanic? How do I speficy it?
Cheers.
DvJ
_________________________________________________________________
Windows Live Messenger has arrived. Click here to download it for free!
http://imagine-msn.com/messenger/launch80/?locale=en-gb
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Stale Link Issue
Posted by Peter Stavrinides <p....@albourne.com>.
Hi David,
A Stale Link Exception usually occurs when data changes between the
rendering phase and form submission. In other words if any components in
the page are modified dynamically for instance you might encounter this
when you submit because the rewind has no recollection of those
components. (References to the components are stored in a hidden field,
so when the page submits these are checked, if there are more or less
fields then the stale link exception is thrown). You should take a look
at the hints section of the documentation of the For component:
http://tapestry.apache.org/tapestry4.1/components/general/for.html
Back to your question, it is possible to have multiple textfields, but
because you are generating them on the fly the stale link exception
occurs... a quick fix could be to set the parameter volitile="true",
which prevents the component reference in a hidden field, but you need
to be carefull using this because form structure will be different for
render and rewind.
Lastly, also be aware of the data types you use, if you are binding
objects directly to the component then use a converter
(IPrimaryKeyConverter
<http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/components/IPrimaryKeyConverter.html>).
good luck,
Peter
david joffrin wrote:
> Hi,
>
> I have defined something like:
> <tr jwcid="@Foreach"
> source="ognl:accountFieldDefinitionsList"
> value="ognl:accountFieldDefinition" index="ognl:index" element="tr">
> <tr>
> <td bgcolor="#EAEAF7" colspan="2"><img
> border="0" src="images/spacer.gif" width="1" height="3"/></td>
> <td bgcolor="#EAEAF7"><img border="0"
> src="images/spacer.gif" width="1" height="3"/></td>
> </tr>
> <td bgcolor="#EAEAF7"><font
> color="#FF0000"></font> </td>
> <td bgcolor="#EAEAF7">
> <b><a jwcid="@Insert"
> value="ognl:accountFieldDefinition.fieldName"/>:</b>
> </td>
> <td bgcolor="#FFFFFF">
> <input jwcid="@TextField"
> value="ognl:fieldValue" size="20" maxlength="8"/>
> </td>
> </tr>
> <tr><td bgcolor="#FFFFFF" colspan="3"><img
> border="0" src="images/spacer.gif" width="1" height="3"/></td></tr>
> <tr>
> <td colspan="2"><input jwcid="@Submit"
> value="Cancel" type="button" listener="ognl:listeners.onCancel"
> class="buttons"/></td>
> <td align="right"><input jwcid="@Submit"
> value="Confirm" type="button" listener="ognl:listeners.onConfirm"
> class="buttons"/></td>
> </tr>
>
> I am trying to implement a list of TextField.
>
> When I press the Submit button, I have the Stale Link error page coming!
>
> Any idea why it is not possible to have multiple TextField in a page?
>
> Thanks.
> DvJ
>
> _________________________________________________________________
> Windows Live^(TM) Messenger has arrived. Click here to download it for
> free! http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail.
Stale Link Issue
Posted by david joffrin <da...@hotmail.com>.
Hi,
I have defined something like:
<tr jwcid="@Foreach" source="ognl:accountFieldDefinitionsList"
value="ognl:accountFieldDefinition" index="ognl:index" element="tr">
<tr>
<td bgcolor="#EAEAF7" colspan="2"><img border="0"
src="images/spacer.gif" width="1" height="3"/></td>
<td bgcolor="#EAEAF7"><img border="0" src="images/spacer.gif"
width="1" height="3"/></td>
</tr>
<td bgcolor="#EAEAF7"><font color="#FF0000"></font> </td>
<td bgcolor="#EAEAF7">
<b><a jwcid="@Insert"
value="ognl:accountFieldDefinition.fieldName"/>:</b>
</td>
<td bgcolor="#FFFFFF">
<input jwcid="@TextField" value="ognl:fieldValue" size="20"
maxlength="8"/>
</td>
</tr>
<tr><td bgcolor="#FFFFFF" colspan="3"><img border="0"
src="images/spacer.gif" width="1" height="3"/></td></tr>
<tr>
<td colspan="2"><input jwcid="@Submit" value="Cancel" type="button"
listener="ognl:listeners.onCancel" class="buttons"/></td>
<td align="right"><input jwcid="@Submit" value="Confirm" type="button"
listener="ognl:listeners.onConfirm" class="buttons"/></td>
</tr>
I am trying to implement a list of TextField.
When I press the Submit button, I have the Stale Link error page coming!
Any idea why it is not possible to have multiple TextField in a page?
Thanks.
DvJ
_________________________________________________________________
Windows Live Messenger has arrived. Click here to download it for free!
http://imagine-msn.com/messenger/launch80/?locale=en-gb
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org