Hi Norman, thanks for the tips!
Studying a little bit the whole web app architecture I think I can use the volatile attribute, since the data always come from a database and I believe it´s never modified between form rendering and submission (that's the most difficult thing to analyze), my collection is stored as a session attribute as the result of a search method performed by the user and this data only changes when the user performs another search.

I did see this volatile attribute in the API but I never though about using it since I hadn't understood what the API meant with "data modified between form rendering and submission". When you answered the e-mail talking about volatile I stated to think about it, and I'm almost sure I can use without causing negative impacts in the web app.


Thanks, and if anything comes up I'll post again!

Norman Franke wrote:
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]



Reply via email to