I’m trying to create my own compound button, using a div as the outer parent:
public class CompoundButton extends ButtonBase {
public CompoundButton() {
super(DOM.createDiv());
}
}
the constructor of ButtonBase wants an Element instance, though, so I’m using that DOM.createDiv() call. But how can I add child widgets now at this point?:
public CompoundButton() {
super(DOM.createDiv()); <-- we're just a div.
// ButtonBase has no "add()" method - but this class is really
// just a div instance, so shouldn't I be able to convert it to
// a FlowPanel for example to be able to add elements to it here?
this.add(new FlowPanel()); <-- not possible, "add()" not available here.
Thanks
Button base takes a cell, and flowpanel is not a cell and your code for compound button is wrong as it does not sends a cell to its parent.
Proper code is