Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Exception on dataChooser.getCancelButton();

$
0
0
final DateChooser smartGwtDateChooser = new DateChooser();
this.smartGwtDateChooser.setShowCancelButton(Boolean.TRUE);

cancelButton = this.smartGwtDateChooser.getCancelButton();
todayButton = this.smartGwtDateChooser.getTodayButton();

okButton = new IButton();
okButton.setTitle("OK");

HLayout buttonBar = this.smartGwtDateChooser.getButtonLayout();

cancelButton = this.smartGwtDateChooser.getCancelButton();
todayButton = this.smartGwtDateChooser.getTodayButton();

buttonBar.removeMembers(cancelButton, todayButton);

buttonBar.addMember(todayButton);
buttonBar.addMember(okButton);
buttonBar.addMember(cancelButton);


I get an exception on the line: cancelButton = this.smartGwtDateChooser.getCancelButton();

java.lang.IllegalStateException: Cannot access property cancelButton before the widget has been created.

How to I get around this? What am I doing wrong?

Viewing all articles
Browse latest Browse all 4756

Trending Articles