PDA

View Full Version : MessageBox Alert Min Width not working



eamonnlawlor
29 Dec 2011, 3:48 PM
Hi there,
I am currently stuck on an issue that I have seen existed in GXT 1.x bugs. There was a workaround for that issue and version, I am now experiencing the same issue in GXT 2.2.4 using GWT 2.4, however the workaround does not help. Currently my code is

MessageBox box = MessageBox.alert(messageBoxTitle, messageBoxMessage, new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent mbe) {
Button btn = mbe.getButtonClicked();
serviceAsync.setAcknowledgementDate(token, new GenericAsyncCallback(){
public void onError(MessageBoxEvent event) {
event.getMessageBox().close();
}
@Override
public void onSuccess(Object arg0) {
redirect(SiteUtil.getInstance().getBaseURL()+ urlPath) ;
}
});}});
box.setMinWidth(500);
box.setMaxWidth(600);
box.getDialog().center();

The previous workaround from GXT 1.x version was to set the width on the dialog rather than the message box and to center the dialog as my code shows above. But both these workarounds do not work nor does setting the min width on the messageBox object itself. I want my message box to contain a long message, so i want the width to be greater than the default. Am I doing something wrong? Any help would be much appreciated.
Note I have also tried setting the widths before invoking the alert message on message box to no avail either.:(

smiletolead
30 Dec 2011, 3:00 AM
Hi
I find this minWidth working with GXT 2.2.5. Check if you are using Quirks mode. I am using Standard mode, that is, Strict DOCTYPE.

Ganesh

eamonnlawlor
3 Jan 2012, 6:42 PM
Hi Ganesh,
Thanks for your response.
We are using transitional DOCTYPE. Is there a workaround for this particular DocType?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">

Regards,
Eamonn

smiletolead
3 Jan 2012, 6:51 PM
I am not aware of any!