You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jgn <jg...@yahoo.com.mx> on 2009/01/09 06:47:18 UTC

problem with t:formdata

t:formdata is too big on a page that I have (5MB or more).

I have a form with only 12 fields and I display a table with 14 rows, the
problem is that if the loop component that displays the tables is inside the
form, the t:formdata becomes huge. If is not inside the form, it works just
fine :D.

The loop is throw a list of beans. Is a complex structure because that beans
have properties that are beans too and so, but what I display is not all the
info, just a couple of fields. I have all the information on memory to save
time loading from DB, etc, that is why the info is big.

The problem seems to be (or I suppose, but not sure)  that the loop
component is serializing the beans and including them on the t:formdata
field. If this is true, is there a way to tell the loop component not to
serialize the beans ?, I mean, if they are not part of the form, why
serialize them ?.

I keep the loop inside the form because at the end of the table I have a
submit component, I need to keep it there for a reason long to explain, so
to keep a short post, what can I do to keep the t:formdata smaller ? (the
response from tapestry is fast, but firefox takes a long time to display the
results, from 3 to 4 seconds, because the size of the page)

Thank you.
-- 
View this message in context: http://www.nabble.com/problem-with-t%3Aformdata-tp21366619p21366619.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: problem with t:formdata

Posted by Ville Virtanen <vi...@cerion.fi>.
Also you can use the encoder to override the default serialize problem: you
can, for an example use primary key encoder and only the integers are
encoded to form data.

    private DefaultPrimaryKeyEncoder<Long, MyObject> encoder;
    public PrimaryKeyEncoder getEncoder() {
        if(encoder == null){
            encoder = new DefaultPrimaryKeyEncoder< Long, MyObject>();
            for(MyObject dto : myObjects){
                encoder.add(dto.getId(), dto);
            }
        }
        return encoder;
    }

Do this in onPrepare() part of the page and it uses the primary keys. (If
you have textfields etc. in the loop.)

 - Ville


jgn wrote:
> 
> Thank you, It works :). I think that I won't have any problem because I do
> not have fields on the loop, just LinkSubmit components, thank you.
> 
> 
> Fernando Padilla wrote:
>> 
>> by default t:loop serializes the source list into t:formdata, so that in 
>> can have predictable form processing.  But if you can reconstitute the 
>> source list used by the loop, and understand that the form might behave 
>> erratic in some edge cases ( if the list changes between form render and 
>> form handling ).
>> 
>> Then just look at the volatile flag on the loop component:
>> 
>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html
>> 
>> 
>> 
>> jgn wrote:
>>> t:formdata is too big on a page that I have (5MB or more).
>>> 
>>> I have a form with only 12 fields and I display a table with 14 rows,
>>> the
>>> problem is that if the loop component that displays the tables is inside
>>> the
>>> form, the t:formdata becomes huge. If is not inside the form, it works
>>> just
>>> fine :D.
>>> 
>>> The loop is throw a list of beans. Is a complex structure because that
>>> beans
>>> have properties that are beans too and so, but what I display is not all
>>> the
>>> info, just a couple of fields. I have all the information on memory to
>>> save
>>> time loading from DB, etc, that is why the info is big.
>>> 
>>> The problem seems to be (or I suppose, but not sure)  that the loop
>>> component is serializing the beans and including them on the t:formdata
>>> field. If this is true, is there a way to tell the loop component not to
>>> serialize the beans ?, I mean, if they are not part of the form, why
>>> serialize them ?.
>>> 
>>> I keep the loop inside the form because at the end of the table I have a
>>> submit component, I need to keep it there for a reason long to explain,
>>> so
>>> to keep a short post, what can I do to keep the t:formdata smaller ?
>>> (the
>>> response from tapestry is fast, but firefox takes a long time to display
>>> the
>>> results, from 3 to 4 seconds, because the size of the page)
>>> 
>>> Thank you.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-with-t%3Aformdata-tp21366619p21373175.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: problem with t:formdata

Posted by jgn <jg...@yahoo.com.mx>.
Thank you, It works :). I think that I won't have any problem because I do
not have fields on the loop, just LinkSubmit components, thank you.


Fernando Padilla wrote:
> 
> by default t:loop serializes the source list into t:formdata, so that in 
> can have predictable form processing.  But if you can reconstitute the 
> source list used by the loop, and understand that the form might behave 
> erratic in some edge cases ( if the list changes between form render and 
> form handling ).
> 
> Then just look at the volatile flag on the loop component:
> 
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html
> 
> 
> 
> jgn wrote:
>> t:formdata is too big on a page that I have (5MB or more).
>> 
>> I have a form with only 12 fields and I display a table with 14 rows, the
>> problem is that if the loop component that displays the tables is inside
>> the
>> form, the t:formdata becomes huge. If is not inside the form, it works
>> just
>> fine :D.
>> 
>> The loop is throw a list of beans. Is a complex structure because that
>> beans
>> have properties that are beans too and so, but what I display is not all
>> the
>> info, just a couple of fields. I have all the information on memory to
>> save
>> time loading from DB, etc, that is why the info is big.
>> 
>> The problem seems to be (or I suppose, but not sure)  that the loop
>> component is serializing the beans and including them on the t:formdata
>> field. If this is true, is there a way to tell the loop component not to
>> serialize the beans ?, I mean, if they are not part of the form, why
>> serialize them ?.
>> 
>> I keep the loop inside the form because at the end of the table I have a
>> submit component, I need to keep it there for a reason long to explain,
>> so
>> to keep a short post, what can I do to keep the t:formdata smaller ? (the
>> response from tapestry is fast, but firefox takes a long time to display
>> the
>> results, from 3 to 4 seconds, because the size of the page)
>> 
>> Thank you.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-with-t%3Aformdata-tp21366619p21366944.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: problem with t:formdata

Posted by Fernando Padilla <fe...@alum.mit.edu>.
by default t:loop serializes the source list into t:formdata, so that in 
can have predictable form processing.  But if you can reconstitute the 
source list used by the loop, and understand that the form might behave 
erratic in some edge cases ( if the list changes between form render and 
form handling ).

Then just look at the volatile flag on the loop component:

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html



jgn wrote:
> t:formdata is too big on a page that I have (5MB or more).
> 
> I have a form with only 12 fields and I display a table with 14 rows, the
> problem is that if the loop component that displays the tables is inside the
> form, the t:formdata becomes huge. If is not inside the form, it works just
> fine :D.
> 
> The loop is throw a list of beans. Is a complex structure because that beans
> have properties that are beans too and so, but what I display is not all the
> info, just a couple of fields. I have all the information on memory to save
> time loading from DB, etc, that is why the info is big.
> 
> The problem seems to be (or I suppose, but not sure)  that the loop
> component is serializing the beans and including them on the t:formdata
> field. If this is true, is there a way to tell the loop component not to
> serialize the beans ?, I mean, if they are not part of the form, why
> serialize them ?.
> 
> I keep the loop inside the form because at the end of the table I have a
> submit component, I need to keep it there for a reason long to explain, so
> to keep a short post, what can I do to keep the t:formdata smaller ? (the
> response from tapestry is fast, but firefox takes a long time to display the
> results, from 3 to 4 seconds, because the size of the page)
> 
> Thank you.

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