Check the archives, this exact same topic was just discussed this month.

On 11/29/06, Magnus Sandberg <[EMAIL PROTECTED]> wrote:
Hi,

I have a problem with pages that gets very large.

I have a page with a form and a result list, each row in the result list
has one or several <h:commandLink  .. />. My problem is that page (even
when showing a very limited number of hits get very big, somewhere
around 100-150k. I can probably optimize my html somewhat but when
looking at the page I can see that each <h:commandLink  .. /> renders
link that look like this:

<a href="#"
onclick="clear__5Fid11();document.forms['_id11'].elements['_id11:_link_hidden_'].value='_id11:_id13';if(document.forms['_id11'].onsubmit){var
result=document.forms['_id11'].onsubmit();  if( (typeof result ==
'undefined') || result )
{document.forms['_id11'].submit();}}else{document.forms['_id11'].submit();}return
false;" id="_id11:_id13">XXXXXX</a>


The problem is when there are 100+ links on single page the space these
links take up is quite large. As fas as I can see all scripts snippets
looks the same for all links (apart from the form-id).

I guess that this code really should be generalized and put into a
included js-file?

Are there any other things to think about when trying to make the pages
as small as possible using JSF/Myfaces (and facelets in this case)?

A page like this should not really be larger than 20k or so ...

Thanks,

/Magnus


Reply via email to