I am experimenting with what I can do with widgets.
If I build a widget which has the default constructor it displays when I load it in the designer.
If I provide 2 constructors the designer shows unknown window type.
Is there anything I can do to avoid this (use the default constructor for instance)?
Below is an example (note the example is oversimplied, both versions are identical rather than the 2nd being dynamic based on the input parameters. The default constructor alone works, having 2 different constructors with the same code doesn't).
... Rich
- Code: Select all
package com.uptodate.utdadmin.client.widget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.uptodate.utdadmin.client.widget.HtmlWidget;
public class RfBlock extends Composite {
public RfBlock() {
final Grid grid = new Grid(2,1);
initWidget(grid);
grid.setBorderWidth(2);
final HtmlWidget htmlWidget = new HtmlWidget();
for (int i=0; i< 1; i++) {
grid.setWidget(i, 0, htmlWidget);
}
}
public RfBlock(int row, int col) {
final Grid grid = new Grid(2,1);
initWidget(grid);
grid.setBorderWidth(2);
final HtmlWidget htmlWidget = new HtmlWidget();
for (int i=0; i< 1; i++) {
grid.setWidget(i, 0, htmlWidget);
}
}
}