Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

table is not refreshing  RSS feed

 
Vinotha laxra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
function enableTextBox()
{
<%
if(session.getAttribute("adaptorTable") != null || request.getAttribute("adaptorTable") != null)
{

Hashtable adaptorTable = new Hashtable();

Vector dbType = (Vector)adaptorTable.get("db");
Vector javaType = (Vector)adaptorTable.get("java");
Vector fileType=(Vector)adaptorTable.get("file");
if(dbType.size() > 0)
dbSize = dbType.size()/2;

if(javaType.size() > 0)
javaSize = javaType.size()/2;

if(fileType.size() > 0 )
fileSize = fileType.size()/2;
%>
var dbSizevalue = <%=dbSize%>;
var javaSizevalue= <%=javaSize%>;
var fileSizevalue = <%=fileSize%>;
if( dbSizevalue > 0)
dbAdaptorsArray = new Array(<%=dbSize%> ;
else
dbAdaptorsArray = new Array(0);

Array(<%=fileSize%> ;


if( javaSizevalue > 0)
javaAdaptorsArray = new Array(<%=javaSize%> ;
else
javaAdaptorsArray = new Array(0);

if(fileSizevalue > 0)
fileAdaptorsArray = new Array(<%=fileSize%> ;
else
fileAdaptorsArray = new Array(0);
<%
int dbArrayIndex = 0;
for(int index=0;index<dbType.size();index++)
{
int count = index +1;

%>
dbAdaptorsArray[<%=dbArrayIndex%>] = new adaptorsInfo("<%=dbType.elementAt(index)%>","<%=dbType.elementAt(count)%>");
<%
dbArrayIndex++;
index++;
}
int javaArrayIndex = 0;

for(int index=0;index<javaType.size();index++)
{
int count = index +1;
%>
javaAdaptorsArray[<%=javaArrayIndex%>] = new adaptorsInfo("<%=javaType.elementAt(index)%>","<%=javaType.elementAt(count)%>");
<%
javaArrayIndex++;
index++;
}
int fileArrayIndex = 0;
for(int index=0;index<fileType.size();index++)
{
int count = index +1;
%>
fileAdaptorsArray[<%=fileArrayIndex%>] = new adaptorsInfo("<%=fileType.elementAt(index)%>","<%=fileType.elementAt(count)%>");
<%
fileArrayIndex++;
index++;
}
}
%>

type = document.adaptorForm.adaptorType.value;
var optionIndex = document.adaptorForm.adaptorId.length;
var index = 1;

if(type=="0")
{
<%
count=1;
%>
table=document.getElementById("dhtmltable");
str="<select name='adaptorId' class='formfftxt' style='HEIGHT:22px;WIDTH:70px' onChange='getAdaptorInfo()'>";
str=str+"<option value='New'>New</option>";
for(var a=0;a<(<%=count%> ;a++)
{
str=str+"<option></option>";
}
str=str+"<input name='adaptorName' type='text' class='formfftxt' maxlength='30'>";
table.innerHTML=str;

}
else if(type=="db")
{
<%
count=dbSize;
%>
table=document.getElementById("dhtmltable");
str="<select name='adaptorId' class='formfftxt' style='HEIGHT:22px;WIDTH:70px' onChange='getAdaptorInfo()'>";
str=str+"<option value='New'>New</option>";
for(var a=0;a<(<%=count%> ;a++)
{
str=str+"<option></option>";
}
str=str+"<input name='adaptorName' type='text' class='formfftxt' maxlength='30'>";
table.innerHTML=str;
newfield();
arrRecords= new Array();
createDivTable();
if(arrRecords.length==0)
document.all.div1.style.visibility="hidden";
}
else if(type="file")
{
<%
count=javaSize+fileSize;
%>
table=document.getElementById("dhtmltable");
str="<select name='adaptorId' class='formfftxt' style='HEIGHT:22px;WIDTH:70px' onChange='getAdaptorInfo()'>";
str=str+"<option value='New'>New</option>";
for(var a=0;a<(<%=count%> ;a++)
{
str=str+"<option></option>";
}
str=str+"<input name='adaptorName' type='text' class='formfftxt' maxlength='30'>";
table.innerHTML=str;

newfield();
//document.adaptorForm.filetype.disabled=false;




}

if(type=="0")
{
MM_showHideLayers('ad','','hide','jd','','hide','bttn','','hide','jdx','','hide','jdxx','','hide','divAdd','','hide');

}

else if(type == "db")
{
MM_showHideLayers('ad','','show','jd','','hide','bttn','','show','jdx','','hide','jdxx','','hide','divAdd','','hide');
document.adaptorForm.driver.selecetedIndex=0;
document.adaptorForm.dburl.value="";
document.adaptorForm.username.value="";
document.adaptorForm.password.value="";
document.adaptorForm.sqlstring.value="";
if(dbAdaptorsArray.length>=1)
{
for(var count=0;count<dbAdaptorsArray.length;count++)
{
document.adaptorForm.adaptorId.options[index].value = dbAdaptorsArray[count].adaptorId;
document.adaptorForm.adaptorId.options[index].text = dbAdaptorsArray[count].adaptorName;
index++;
}
}
}
else if(type == "file" || type=="java")
{

MM_showHideLayers('ad','','hide','jd','','show','bttn','','show','jdx','','show','jdxx','','hide');
document.adaptorForm.filetype.options[0].selected=true;
document.adaptorForm.filepath.disabled=false;
document.adaptorForm.filepath.value="";
document.adaptorForm.filepath.disabled=true;
document.adaptorForm.searchfor.value="";
document.adaptorForm.descfile.value="";
document.adaptorForm.classname.value="";
document.adaptorForm.methodname.value="";
document.adaptorForm.desc.value="";

if(javaAdaptorsArray.length>=1 )
{

for(var count=0;count<javaAdaptorsArray.length;count++)
{
document.adaptorForm.adaptorId.options[index].value = "java "+javaAdaptorsArray[count].adaptorId;
document.adaptorForm.adaptorId.options[index].text = javaAdaptorsArray[count].adaptorName;
index++;
}
}
if(fileAdaptorsArray.length>=1)
{
for(var count=0;count<fileAdaptorsArray.length;count++)
{
document.adaptorForm.adaptorId.options[index].value = "file "+fileAdaptorsArray[count].adaptorId;
document.adaptorForm.adaptorId.options[index].text = fileAdaptorsArray[count].adaptorName;
index++;
}
}
}



}

When i am trying to delete all the field the select box, It produced error , like javaadaptorarray.index is null or not an object.
I don't know how to solve? pls help me.
If i am trying to delete the last value, request scope isnot refreshed.
Regards
vinotha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!