• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

performance issue with DIV tags

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
we have around 10000 rows in the data base.
there is a selection criteria to get all the rows.
once we get the rows from database...in jsp page we are looping the resultset.Here is the issue.we displaying data in DIV tags. each row has 5 div tags.so it takes lot of time to load the page.The main purpose of using DIV tags it flip(toggle) the data ( [+] to [-]).
Is there any other way to do that....some one said innerHTML is the best way to do that..but what about this Flipping mechanism??? How can i do that?? I will provide a sample code what am using ....We are using Velocity framefork...code looks little bit different so I just modified to make you understand clearly...{i} gives value of i

<table>
<%
for(int i=0;i<10000;i++){
%>
<tr>
<td>
<div id="max_${i}"><a href="javascript:toggleCmt('${i}')">[+]</a></div>
<div id="min_${i}" style="display:none"><a href="javascript:toggleCmt('${i}')" >[-]</a></div>
<div id="prvw_${i}">Hellllloooo...</div>
<div id="fulldata_${i}" style="display:none" >Hellllloooo How are you doing!!!</div>
</td>
<td>same div tags </td>
<td>same div tags </td>
<td>same div tags </td>
<td>same div tags </td>
</tr>
<% } %>
</table>


Please give me some ideas to improve loading the page faster.
It you provide any sample code that so helpful for me...
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doing 10,000 of anything is going to take a long time. You should really consider modifying your UI to include filtering and paging to prevent such long (and ulitimately unusable by your user) lists.

That said, your HTML is pretty inefficient. For example, embedded stlye tags can be factored out into externally applied stlyes. Also consider facotring out the behavior as well by binding event handlers after the fact (in window.onload).
 
reply
    Bookmark Topic Watch Topic
  • New Topic