mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
putting the alert text next to the source of the error - looks absolutely horrific but more useful than what was there before. i'll work on the presentation more tomorrow.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4028 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,11 +48,13 @@ dojo.declare("alfresco.xforms.Widget",
|
||||
{
|
||||
this.modified = b;
|
||||
this._updateDisplay();
|
||||
this.hideAlert();
|
||||
},
|
||||
setValid: function(b)
|
||||
{
|
||||
this.valid = b;
|
||||
this._updateDisplay();
|
||||
this.hideAlert();
|
||||
},
|
||||
setRequired: function(b)
|
||||
{
|
||||
@@ -144,6 +146,24 @@ dojo.declare("alfresco.xforms.Widget",
|
||||
var node = this._getAlertNode();
|
||||
return node ? dojo.dom.textContent(node) : "";
|
||||
},
|
||||
showAlert: function()
|
||||
{
|
||||
if (this.alertDiv)
|
||||
return;
|
||||
this.alertDiv = document.createElement("div");
|
||||
this.alertDiv.setAttribute("id", this.id + "-alert");
|
||||
this.alertDiv.appendChild(document.createTextNode(this.getAlert()));
|
||||
this.domContainer.parentNode.insertBefore(this.alertDiv, this.domContainer);
|
||||
this.alertDiv.setAttribute("style", "color:red; position: relative; top: 0px; left: 0px;");
|
||||
},
|
||||
hideAlert: function()
|
||||
{
|
||||
if (this.alertDiv)
|
||||
{
|
||||
dojo.dom.removeNode(this.alertDiv);
|
||||
this.alertDiv = null;
|
||||
}
|
||||
},
|
||||
_updateDisplay: function()
|
||||
{
|
||||
// this.domContainer.style.backgroundColor =
|
||||
@@ -1220,12 +1240,13 @@ dojo.declare("alfresco.xforms.XForm",
|
||||
case "xforms-submit-error":
|
||||
var invalid = this.rootWidget.getWidgetsInvalidForSubmit();
|
||||
var msg = "Please provide values for all required fields.";
|
||||
msg += "<br/><ul>";
|
||||
// msg += "<br/><ul>";
|
||||
for (var j = 0; j < invalid.length; j++)
|
||||
{
|
||||
msg += "<li>" + invalid[j].getAlert() + "</li>";
|
||||
invalid[j].showAlert();
|
||||
// msg += "<li>" + invalid[j].getAlert() + "</li>";
|
||||
}
|
||||
msg += "</ul>";
|
||||
// msg += "</ul>";
|
||||
_show_error(msg);
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user