• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I struts tag library with in javascript ?

 
Srinivas Kasani
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create a table dynamically using javascript(onClick). The table needs to have a drop down values. I need to populate the dropdown list with struts tag library, Is this possible ?.
Here is the code snippet of javascript.

function addRow(id)
{
var tbody = document.getElementById(id).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
S1 = document.createElement("select");
var oOption = document.createElement("option");
var t = document.createTextNode("");
....
....
}
How can I insert struts tag library
<html ptions collection="availableprofilesources" property="name" labelProperty="name"/> in the javascript above.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, nope. As with all JSP custom actions, Struts tags are executed on the server in order to produce HTML markup to send to the browser. Once at the browser, no JSP activity can take place in JavaScript.

It's be easiest just to deal with straight-forward HTML, but if you need to get clever you could probably piece together an Ajax solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic