}
if(this.onload)
this.onload(this.widget, this);
+
+ if(this.dijitArgs && this.dijitArgs.required) {
+ // a required dijit is not given any styling to indicate the value
+ // is invalid until the user has focused the widget then left it with
+ // invalid data. This change tells dojo to pretend this focusing has
+ // already happened so we can style required widgets during page render.
+ this.widget._hasBeenBlurred = true;
+ this.widget.validate();
+ }
},
_buildOrgSelector : function() {
columnPickerPrefix : null,
displayLimit : 15,
displayOffset : 0,
+ requiredFields : null,
showPaginator : false,
showLoadFilter : false,
suppressLinkedFields : null, // list of fields whose linked display data should not be fetched from the server
overrideWidgetClass : this.overrideEditWidgetClass,
overrideWidgetArgs : this.overrideWidgetArgs,
disableWidgetTest : this.disableWidgetTest,
+ requiredFields : this.requiredFields,
onPostSubmit : function() {
for(var i in fmObject._fields) {
var field = fmObject._fields[i];
overrideWidgetClass : this.overrideEditWidgetClass,
overrideWidgetArgs : this.overrideWidgetArgs,
disableWidgetTest : this.disableWidgetTest,
+ requiredFields : this.requiredFields,
onPostSubmit : function(req, cudResults) {
var fmObject = cudResults[0];
if(grid.onPostCreate)
fieldDocs : null,
existingTable : null,
suppressFields : null,
+ requiredFields : null,
constructor : function(args) {
this.fieldList = [];
}
);
+ if(this.requiredFields && this.requiredFields.indexOf(field.name) >= 0) {
+ if(!args.dijitArgs) args.dijitArgs = {};
+ args.dijitArgs.required = true;
+ }
+
var widget = new openils.widget.AutoFieldWidget(args);
widget.build();