I need to reference a Java varaible within an HTML tag in order to display the string variable contents as the HTML "title" tag value for a tool tip. I have been trying for a day and a half now and my google searches have not yielded any help yet either.
I am storing the Java variables in a table per the requirements of this app, and the below code is the closest I can get to correct but it shows the exact text 'block_type_desc' for the tool tip/on mouse over result that I need to show the value within the table column 'block_type_desc' when you move your mouse over the "block_code" value. I have tried : sb.append(""+block_type_desc'); sb.append(""); sb.append(""); sb.append(""); //this one no matter how I differentiate the syntax round t.getValue etc. it won't compile
Can someone please advise how to correct my syntax to call the variable string data corectly to display it? thank you so much in advance for your time and help!! I am copying the whole display function as I think that will help paint a complete picture of my needs and situation.
private StringBuffer displayUserMenuItems(Table t) {
StringBuffer sb = new StringBuffer(20000);
sb.append("<table>");
sb.append("<tr>");
sb.append("<td><strong>Code</strong></td>");
sb.append("<td><strong>Menu Item Description</strong></td>");
sb.append("<td><strong>Block Type</strong></td>");
sb.append("</tr>");
t.reset();
String css;
int i = 0;
while (t.next()) {
if (i % 2 == 0) {
css = "even";
} else {
css = "odd";
}
sb.append("<tr class=\"" + css + "\">");
sb.append("<td>");
sb.append(t.getValue("menu_code"));
sb.append("</td>");
sb.append("<td>");
sb.append(t.getValue("menu_desc"));
sb.append("</td>");
// this next line below displays "block_type_desc" for title
**sb.append("<td title='block_type_desc'>");**
sb.append(t.getValue("block_type"));
sb.append("</td>");
sb.append("</tr>");
i ++;
}
sb.append("</table>");
return sb;
}