-1

how can i customize the buttons in gxt MessageBox. so instead of Ok and cancel i can have different lables

Adi Mor
  • 2,145
  • 5
  • 25
  • 44

2 Answers2

4
((Button)box.getDialog().getButtonBar().getItem(0)).setText("changed");
tartak
  • 485
  • 3
  • 17
  • sorry i got a better answer from sencha http://www.sencha.com/forum/showthread.php?177584-Customize-MessageBox&p=723266#post723266 – Adi Mor Jan 30 '12 at 10:46
0

MessageBox is just a helper class for creating common Dialogs with, for example, YESOK buttons and others. MessageBox.show() is:

public void show() {
    dialog = getDialog();
    dialog.show();
}

getDialog() - creates dialog with your predefined parameters.

If you want to really customize your buttons - set icons, change text, add more buttons like "print, export..." - extend Dialog, call setButtons(""); in constructor and add your buttons addButton(new MyCustomButton);

Also, you are free to get details in MessageBox source.

Ivan Bochko
  • 117
  • 6