• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Page loading issue in Index page

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In Index.jsp, Iam retrieving the datas from Database & put them to combo box. taking more time to load the page because of retrieving those data from DB. that is problem now.

Code is,
<TD width="120" class="text">
<input type="radio" name="find" value="ip"/>Industry Partner
</TD>
<td width="200">
<select style="width:266px" class="text" name="ipopt">

<option value="">--Select One--</option>
<%

UserMaster um1=new UserMaster();
ArrayList a2=new ArrayList();
a2=um1.getIPCodes();

for(int i=0;i<a2.size();i++)
{
String ipcode=(String)a2.get(i);
Industry ip=new Industry();
ip=ip.getIPName(ipcode);

%>
<OPTION value="<%=ipcode%>">
<%=ip.getIname()%></OPTION>

<%}}%>
</select></td>

what is my question is, Data should fetch from DB when i click radio button else combo box should be showing only ---Select One---.
If it's happened, load performane is good.
Please give the suggestion to me.
Thanks,
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can call a javascript using onclick() or onchange() or selected() methods by passing some variable(like getFromDB=y). After calling your JS method, call the same page and check for the variable that you have set. Then you can connect to dbase...
Regards,
Kiran.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic