353 * constructor's argumemts are the same that BaseSuggestField widget |
353 * constructor's argumemts are the same that BaseSuggestField widget |
354 */ |
354 */ |
355 Widgets.SuggestForm = defclass("SuggestForm", null, { |
355 Widgets.SuggestForm = defclass("SuggestForm", null, { |
356 |
356 |
357 __init__: function(inputid, initfunc, varargs, validatefunc, options) { |
357 __init__: function(inputid, initfunc, varargs, validatefunc, options) { |
358 this.validatefunc = validatefunc || noop; |
358 this.validatefunc = validatefunc || $.noop; |
359 this.sgfield = new Widgets.BaseSuggestField(inputid, initfunc, varargs, options); |
359 this.sgfield = new Widgets.BaseSuggestField(inputid, initfunc, varargs, options); |
360 this.oklabel = options.oklabel || 'ok'; |
360 this.oklabel = options.oklabel || 'ok'; |
361 this.cancellabel = options.cancellabel || 'cancel'; |
361 this.cancellabel = options.cancellabel || 'cancel'; |
362 bindMethods(this); |
362 bindMethods(this); |
363 connect(this.sgfield, 'validate', this, this.entryValidated); |
363 connect(this.sgfield, 'validate', this, this.entryValidated); |
367 var sgnode = this.sgfield.builddom(); |
367 var sgnode = this.sgfield.builddom(); |
368 var buttons = DIV({ |
368 var buttons = DIV({ |
369 'class': "sgformbuttons" |
369 'class': "sgformbuttons" |
370 }, |
370 }, |
371 [A({ |
371 [A({ |
372 'href': "javascript: noop();", |
372 'href': "javascript: $.noop();", |
373 'onclick': this.onValidateClicked |
373 'onclick': this.onValidateClicked |
374 }, |
374 }, |
375 this.oklabel), ' / ', A({ |
375 this.oklabel), ' / ', A({ |
376 'href': "javascript: noop();", |
376 'href': "javascript: $.noop();", |
377 'onclick': this.destroy |
377 'onclick': this.destroy |
378 }, |
378 }, |
379 escapeHTML(this.cancellabel))]); |
379 escapeHTML(this.cancellabel))]); |
380 var formnode = DIV({ |
380 var formnode = DIV({ |
381 'class': "sgform" |
381 'class': "sgform" |