• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP-Refresh

 
Arundhathi Menon
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am dynamically creating table rows through a javascript function..evertime i give a page refresh the added rows disppear...how can i rectify the problem??
regards
Menon
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please paste some relevent piece of code. that would help in getting the real problem.
 
Arundhathi Menon
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this makes sense




--------------------------------------------------

<table id="TimeTable" border="1" width="100%" cellpadding="2" >
<tr>

<th><bean:message key="USR_FORM_PROJNAME"/></th>
<th><bean:message key="USR_FORM_TASKNAME"/></th>
<th>Activity Name</th>
<th><bean:message key="USR_FORM_STARTTIME"/></th>
<th><bean:message key="USR_FORM_ENDTIME"/></th>

</tr>

On clicking an add button i add the rows dynamically as follows
var row = tbl.insertRow(lastRow);

var tbl = document.getElementById('TimeTable');
var lastRow = tbl.rows.length;


var cellRightProjName = row.insertCell(0);
var elProj = document.createElement('select');
elProj.setAttribute('name','projName');
elProj.onchange= function() {selectTask(document.TimeEntryAddForm,lastRow-1);};
for(var k=0;k<ProjLength;k++)
{
var optProj = new Option(ProjArray[k],ProjArray[k]);
elProj.options[elProj.length] = optProj;
}

cellRightProjName.appendChild(elProj);
-----------------------------------------------------



The rows which are dynaimaclly created get lost on refreshing...
Cld u pls tell me why
regards
Menon
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to loose them since they are in memory, you refresh the browser you loose the memory..

How to fix it? Track it server side with post backs or store it in a cookie...

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!