Hi there,
I am fairly new to GWT and have been trying out the examples as given.
I have been facing a problem with the TableElement.getInnerHTML()
method.
The code I have is
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TableElement table = Document.get().createTableElement();
TableSectionElement tbody = Document.get().createTBodyElement();
table.appendChild(tbody);
for(T t: recentSearchList){
TableRowElement row = tbody.insertRow(-1);
TableCellElement cell = row.insertCell(-1);
StringBuilder cellHTML = new StringBuilder();
cellHTML.append("<a >");
cellHTML.append(t.toString()+ "</a>");
cell.setInnerHTML(cellHTML.toString());
cell = row.insertCell(-1);
cellHTML = new StringBuilder();
cellHTML.append("<a >");
cellHTML.append("test"+ "</a>");
cell.setInnerHTML(cellHTML.toString());
}
recentSearches.setHTML(table.getInnerHTML());
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is similar to the example given in Contacts example in the
tutorial: 'Large scale application development and MVP - Part II'
However the result i am getting is: <div
class="recentSearchTbl"><a>tank</a><a>test</a></div>
instead of getting: <div
class="recentSearchTbl"><table><tbody><tr><td><a>tank</a></
td><td><a>test</a></td></tr></tbody></table></div>
I get this above string using table.getString()...
Could you please tell me where I have gone wrong? Or what I should do
differently?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.