Rizen
unread,May 28, 2010, 7:08:34 AM5/28/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Hello,
For my project, I would like to create a table in HTML by means of the
DOM tree.
For this, I'm just using the functions DOM.createTable(),
DOM.createTBody(), DOM.createTR()...
However the generated table is an Element type.
Except that I'm using the MVP as a pattern for my application. So I
have to init the main Widget with the function initWidget(), which
takes a Widget object as parameter. I was looking for a panel like the
HTMLPanel but no method can change or add an Element into a Widget.
Is there a method that I can use to cast the Element object in Widget
object ?
Here is an example of code :
public class View extends Composite {
public View() {
Element table = DOM.createTable();
Element tbody = DOM.createTBody();
Element tr = DOM.createTR();
Element td = DOM.createTD();
tr.appendChild(td);
tbody.appendChild(tr);
table.appendChild(tbody);
// Need a Widget as a type
initWidget(table);
}
}