This really bugged me as well, since can easily add 100K to your page.
First, it only seems to happen inside a @Form component, as best as I
can tell from reading the docs. You can provide a "keyExpression" to
have it serialize the value of the object's attribute, e.g. it's
primary key for database access. This saves a bunch of space.
The old @Foreach (Tapestry 4.0.x) did NOT do this, and I wish there
was an option to do this with @For.
The documentation (http://tapestry.apache.org/tapestry4.1/components/
general/for.html) says you can set a "volatile" parameter to not do
this, but this can lead to a StaleLinkException if the data changes
between rendering and form submission. My app can't guarantee this my
data comes from a database, but it may work for you.
-Norman Franke
ASD, Inc.
On Oct 26, 2007, at 11:20 AM, Mateus Lucio dos Santos wrote:
Hi everybody !!
I'm having a little problem when using the @For component ... while
I'm iterating through the source collection the component prints a
string representation of the object as the value of the @For
component, I went to check the documentation and it says that the
value attribute is optional and if I don't provide one, it won't be
used (at least that's what I think).
Is there a way to avoid the print of the object's string
representation?
That's my mapping:
<component id="eachEntry" type="For">
<binding name="source" value="entries"/>
<binding name="element" value="literal:tr"/>
<binding name="index" value="index"/>
<binding name="class" value="beans.evenOdd.next"/>
</component>
I'm trying to use the index to access the objects in the collection
this way I don't need to print the whole object in the html.
I appreciate any help!
Thanks in advance.
Mateus Lucio Santos
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]