Customize a document field
Customize a document field
Technologies/User Interface Add-Ins/Parts for Forms/Document Fields -- Direct Check In and Listeners
Direct Document Check-in
By default, the standard document field’s Check In action displays the Document Check-in dialog. Sometimes users need a simpler way to add a document to the field. Add-in managers can replace the standard Document Check-in dialog by a Browse button that acts as a simple document file selector:
<field name="doc" table="ls" showCheckInDialog="false"/>
Example:
schema/ab-products/solutions/parts/form/ab-ex-form-panel-doc-fields-3-ways.axvw
schema/ab-products/solutions/parts/form/ab-ex-form-panel-doc-fields-3-ways.js
Java Script Event Listeners for Standard Document Actions
Some application views need to perform custom actions when the document field content changes – for example, when the user checks in a document or deletes the document. Add-in managers can register Java Script event listeners that the form will call after the document action is performed:
afterViewLoad: function() {
…
// add listener function by name
this.leaseFormListened.addFieldEventListener('ls.doc', Ab.form.Form.DOC_EVENT_CHECKIN,
'myCheckinHandler');
// add listener function by reference
this.leaseFormListened.addFieldEventListener('ls.doc', Ab.form.Form.DOC_EVENT_CHECKIN,
this.myCheckinHandler, this);
…
},
myCheckinHandler: function (panel, fieldName, parameters) {
…
},
Example:
http://localhost:8080/archibus/schema/ab-products/solutions/parts/form/ab-ex-form-panel-doc-fields-3-ways.axvw