PDA

View Full Version : HtmlContainer add method doesn't work



guys2008
8 Jul 2009, 2:29 AM
Hi Everyone !

I'm trying to add a widget I've written to a div.class element inside an HtmlContainer but it looks like it accepts only the pre-defined elements (e.g Button).

The widget I've written (I put here only the beginning.. ) :


public class LoginForm extends LayoutContainer{

private VerticalPanel vp;
public LoginForm(){
vp = new VerticalPanel();
vp.setSpacing(10);
}
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
createForm();
createLinks();
add(vp);
}
...
The Widget and HtmlContainer definitions and the add method invocation :


LoginForm login1 = new LoginForm();

HtmlContainer hc = new HtmlContainer(
"<table border=1 width=100%><tr><td><img src='res\\leftpanel.jpg'></td>" +
"<td><img src='res\\apple_iphone.jpg'></td>" +
"<td><div class=b1></div></td></tr></table>");
hc.add(login1, "div.b1");
Any Ideas ?? :-?

Thanks in advance,

guys2008
8 Jul 2009, 5:42 AM
Another call .... :
Any ideas reagrding the above described case ? Why HtmlContainer.add(Widget,div.class) is not working with widget that I have written ??