Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Adding an <img src> to an existing table cell dynamically

843833Jul 18 2001 — edited Jul 18 2001
Hi All-

I am currently developing a jsp that displays dynamic information from a database and allows the end user to alter that data. I am displaying this data through a dynamically created table in a jsp.

I would like for an <img> tag to be placed into a preset cell on this dynamic table once the user has made a change to the cooresponding record.

I have attempted to use a javascript function attached to the input tag event handler to update the <td> tag (which I have given a unique ID to) so that the image is added to the cell.

However I have continually gotten errors in trying this. Attached is the relative code. Any help would be greatly appreciated .. and rewarded w/ Duke dollars.

Javascript Function ------------------------
function changedStatus(tdObj){
tdObj.add(<img src="../images/pin_or.gif" class=changeLogo>);
}

JSP Code----------------------------------
while(returnRows.hasNext()){
LineItem currentLine = (LineItem)(returnRows.next());
Iterator lineIterator = currentLine.iterator();
rowCount++;
%>

<tr class=<%=(rowCount%2 == 0)?"primary":"secondary"%>>
<td id='changed<%=rowCount%>'>&nbsp;</td>
<td><div align="center"><%=currentLine.getOrderId()%></div></td>

<td><div align="center"><select name="selectStatus" onclick="changedStatus('changed<%=rowCount%>')">
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2001
Added on Jul 18 2001
1 comment
458 views