I need a custom widget height. I tried using this
Integer.toString(yourWidget.getElement().getOffsetHeight())
but,
onLoad
method, it returns the widget height before the style is appliedSo, when should I use it to get the widget height after the style is applied?
Thanks a lot!
I don't known if you've solved your problem already, but an option to use JSNI would be making sure that the widget creation is finished.
A way of achieving that is with the Deferred command:
DeferredCommand.addCommand(new Command() {
public void execute() {
// Ask here for the height
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With