Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page loading issue in Index page

 
Kannan BLR
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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,
 
K Kiran Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic