3

I'm beginner to GWT and MGWT. In my project I've a requirement that I have to enable and disable the MGWT Botton. direct method is not given in current version of MGWT. I've seen it in GWT button.

com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button();
b.setEnable(boolean);

But it is not given in MGWT. Please help me,How can we achieve above functionality using CSS/something else

Ashok
  • 587
  • 1
  • 4
  • 5

1 Answers1

0

I am not a MGWT guy. And there must be some better solution. You can try low level element manipulation:

Button mgwtButton;
mgwtButton.getElement().setAttribute("disabled", "disabled");

If you take this solution it will be better to prepare later your CustomButton that extends MGWT Button with additional setEnabled(boolean enabled) method to have better API.

Maksym Demidas
  • 7,707
  • 1
  • 29
  • 36
  • the above is working only for GWT button .I tried it for MGWT button, but it is not working – Ashok May 03 '13 at 10:08
  • It's true, MGWT button is a plain div, not input, sot you need to do some CSS adjustements and then disable corresponding click action... – Maksym Demidas May 03 '13 at 10:39