View | Details | Raw Unified | Return to bug 26214 | Differences between
and this patch

Collapse All | Expand All

(-)a/ucs/management/univention-management-console-frontend/umc/widgets/Form.js (+2 lines)
 Lines 218-227   dojo.declare("umc.widgets.Form", [ Link Here 
218
				// widget values have not been loaded completely so far
218
				// widget values have not been loaded completely so far
219
				//console.log('iwidget:', iwidget.name);
219
				//console.log('iwidget:', iwidget.name);
220
				++this._initializingElements;
220
				++this._initializingElements;
221
				console.log("Form Init: " + iwidget.id);
221
				var handle = this.connect(iwidget, 'onValuesLoaded', dojo.hitch(this, function() {
222
				var handle = this.connect(iwidget, 'onValuesLoaded', dojo.hitch(this, function() {
222
					//console.log('onValuesLoaded:', iwidget.name, iwidget.get('value'));
223
					//console.log('onValuesLoaded:', iwidget.name, iwidget.get('value'));
223
					// disconnect from the signal
224
					// disconnect from the signal
224
					this.disconnect(handle);
225
					this.disconnect(handle);
226
					console.log("Form Callback: " + iwidget.id);
225
227
226
					// decrement the internal counter
228
					// decrement the internal counter
227
					--this._initializingElements;
229
					--this._initializingElements;
(-)a/ucs/management/univention-management-console-frontend/umc/widgets/MultiInput.js (-9 / +46 lines)
 Lines 82-87   dojo.declare("umc.widgets.MultiInput", [ Link Here 
82
82
83
	_lastDepends: null,
83
	_lastDepends: null,
84
84
85
	_initializingElements: 0,
86
85
	_createHandler: function(ifunc) {
87
	_createHandler: function(ifunc) {
86
		// This handler will be called by all subwidgets of the MultiInput widget.
88
		// This handler will be called by all subwidgets of the MultiInput widget.
87
		// When the first request comes in, we will execute the function to compute
89
		// When the first request comes in, we will execute the function to compute
 Lines 149-162   dojo.declare("umc.widgets.MultiInput", [ Link Here 
149
151
150
	_loadValues: function(depends) {
152
	_loadValues: function(depends) {
151
		// delegate the call to _loadValues to all widgets
153
		// delegate the call to _loadValues to all widgets
154
		console.log('MultiInput: _loadValues: ' + this.id);
152
		this._lastDepends = depends;
155
		this._lastDepends = depends;
153
		dojo.forEach(this._widgets, function(iwidgets) {
156
		this._initializingElements = 0;
157
		dojo.forEach(this._widgets, dojo.hitch(this, function(iwidgets) {
158
159
			dojo.forEach(iwidgets, dojo.hitch(this, function(jwidget) {
160
				if ('onValuesLoaded' in jwidget  && !(jwidget._valuesLoaded && !jwidget._deferredOrValues)) {
161
					++this._initializingElements;
162
					console.log("MultiInput Init: " + jwidget.id);
163
					var handle = this.connect(jwidget, 'onValuesLoaded', dojo.hitch(this, function() {
164
						console.log("MultiInput Callback: " + jwidget.id);
165
						// disconnect from the signal
166
						this.disconnect(handle);
167
		
168
						// decrement the internal counter
169
						--this._initializingElements;
170
		
171
						// send event when the last element has been initialized
172
						if (0 === this._initializingElements) {
173
							console.log('MultiInput: top: _initializingElements == 0 ==> calling onValuesLoaded');
174
							this.onValuesLoaded();
175
						}
176
					}));
177
				}
178
			}));
179
154
			dojo.forEach(iwidgets, function(jwidget) {
180
			dojo.forEach(iwidgets, function(jwidget) {
155
				if ('_loadValues' in jwidget) {
181
				if ('_loadValues' in jwidget) {
156
					jwidget._loadValues(depends);
182
					jwidget._loadValues(depends);
157
				}
183
				}
158
			});
184
			});
159
		});
185
		}));
186
187
		// maybe all elements are already initialized
188
		if (!this._initializingElements) {
189
			console.log('MultiInput: bottom: _initializingElements == 0 ==> calling onValuesLoaded');
190
			this.onValuesLoaded();
191
		}
192
	},
193
194
	onValuesLoaded: function() {
195
		// event stub
160
	},
196
	},
161
197
162
	_setAllValues: function(_valList) {
198
	_setAllValues: function(_valList) {
 Lines 400-412   dojo.declare("umc.widgets.MultiInput", [ Link Here 
400
			rowContainer.startup();
436
			rowContainer.startup();
401
			this.addChild(rowContainer);
437
			this.addChild(rowContainer);
402
438
403
			// call the _loadValues method by hand
439
// 			// call the _loadValues method by hand
404
			dojo.forEach(order, function(iname) {
440
// 			dojo.forEach(order, function(iname) {
405
				var iwidget = widgets[iname];
441
// 				var iwidget = widgets[iname];
406
				if ('_loadValues' in iwidget) {
442
// 				if ('_loadValues' in iwidget) {
407
					iwidget._loadValues(this._lastDepends);
443
// 					iwidget._loadValues(this._lastDepends);
408
				}
444
// 				}
409
			}, this);
445
// 			}, this);
446
			this._loadValues(this._lastDepends);
410
		}
447
		}
411
448
412
		// add the new button 
449
		// add the new button 
(-)a/ucs/management/univention-management-console-module-udm/umc/js/_udm/DetailPage.js (+7 lines)
 Lines 688-696   dojo.declare("umc.modules._udm.DetailPage", [ dijit.layout.ContentPane, umc.widg Link Here 
688
				this._form.getWidget( '$objecttype$' ).set( 'content', this._( 'Type: <i>%(type)s</i>', { type: vals.$labelObjectType$ } ) );
688
				this._form.getWidget( '$objecttype$' ).set( 'content', this._( 'Type: <i>%(type)s</i>', { type: vals.$labelObjectType$ } ) );
689
				this._form.getWidget( '$location$' ).set( 'content', this._( 'Position: <i>%(path)s</i>', { path: path } ) );
689
				this._form.getWidget( '$location$' ).set( 'content', this._( 'Position: <i>%(path)s</i>', { path: path } ) );
690
690
691
				this._receivedObjFormData = this.getValues();
692
				this._receivedObjFormData.$policies$ = this._receivedObjOrigData.$policies$;
693
			}));
694
695
			var handle = this.connect(this._form, 'onValuesInitialized', dojo.hitch(this, function() {
696
				this.disconnect(handle);
691
				// save the original form data
697
				// save the original form data
692
				this._receivedObjFormData = this.getValues();
698
				this._receivedObjFormData = this.getValues();
693
				this._receivedObjFormData.$policies$ = this._receivedObjOrigData.$policies$;
699
				this._receivedObjFormData.$policies$ = this._receivedObjOrigData.$policies$;
700
				console.warn("ONVALUESINIT: 3b");
694
			}));
701
			}));
695
		}
702
		}
696
		else {
703
		else {

Return to bug 26214