I am looking for a way to reposition all Ext.MessageBox.alert() messages throughout our application without directly altering the code in our JSP pages. I can, however, include a JavaScript file.
Option 1: I have found that I can reposition a message alert by following the steps outlined here: . However, this would require modifying all of the JSP pages and adding:
msgBox=Ext.MessageBox.alert(jsonData.responseMessage);
msgBox.getPositionEl().setTop(50);
Option 2: Extend the message box: still requires changing all JSP pages
Option 3: Use CSS: I'm not sure how?
If anyone has any other solutions or if a CSS solution is feasible, please provide guidance.
Below is a snippet of my code:
Ext.Ajax.request({
url : 'submitAddZone.htm',
params : {
zoneName : Ext.getCmp('zoneNameId').getValue(),
emailParam : Ext.getCmp('emailId').getValue(),
requestTypeParam : Ext.getCmp('requestTypeId').getValue(),
level : selectedLevel + 1,
parentZoneName : selectedParentZone,
currency : currencyValue,
startDate : Ext.getCmp('startDateId').getValue(),
startTime : Ext.getCmp('startTimeId').getValue()
},
method : 'POST',
success : function(response,request) {
toggleAddZoneElements();
var jsonData = Ext.decode(response.responseText);
if(jsonData.isSuccess){
msgBox= Ext.MessageBox.alert(jsonData.responseMessage);
msgBox.getPositionEl().setTop(50);
addZoneWin.close();
toggleAddZoneButtons();
tree.getStore().load({url: 'loadCustomerStructure.htm'});
}else{
Ext.getCmp('sendRequest').setIcon();
Ext.getCmp('errorMessage1').setText(Encoder.htmlDecode(jsonData.errorMessage));
Ext.getCmp('errorMessage1').show();
}
},
failure : function(
response) {
toggleAddZoneElements();
msgBox= Ext.MessageBox.alert(notCreatedLabel);
addZoneWin.close();
msgBox.getPositionEl().setTop(50);
}
});