Just a suggestion: you might want to store only the primary key of the objects that you iterate upon, rather than the full objects -- that may greatly cut down on size. If your objects have a property that returns their primary key, say 'id', you could add keyExpression="literal: id" to your For. This is an OGNL expression that extracts the primary key from the iterated object. (it could be more complex if necessary, but usually it is quite simple). On 'rewind' the For component will try to find an object with a matching primary key and then use it. In general, your HTML may become much smaller as only the primary keys would be stored in hidden fields.

Also, I second Kevin's view -- if you need to display 1000 objects, it may be prudent to use some sort of paging mechanism. For example, contrib:Table is almost as simple as a For (you only need to define the columns), but you get paging and sorting with it for free.


XYZ wrote:

Thank you a complete response. The reason I want to turn on volatile is because it would save a lot of rendering time. My page renders 1000 rows inside a form. If each If and For iteration requires a hidden field, this accounts for a lot of the render time and page size (~2mb).

On 20050825, at 165620, Mind Bridge wrote:

The hidden fields guarantee that the 'rewind' will proceed exactly in the same way as the 'render' that generated the form. That ensures that the form will be rewinded in exactly the same way as it was rendered and eliminates the possibility of StaleLink exceptions.

An example: during a 'render' the condition passed to Conditional may be true, but when the form is submitted it could be 'false'. As a result the form will be rewinded differently. With 'If' that cannot happen as the value of the condition was stored in a hidden field and is read from there during a rewind.

'volatile' turns this behaviour off and If starts behaving exactly as a Conditional. I would not recommend using it, unless you know very well what you are doing.

XYZ wrote:


When For and If are inside a Form, they generate many hidden fields. What are they for?I notice that getVolatile is used inside evaluateCondition() of IfBean. But I do not yet see the side effects of setting volatile="true" when using the If and For inside a form (except that much less html is generated). Can somebody explain what are the side effects? Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: tapestry-user- [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to