Display a document in a document field as an image in a form
Display a document in a document field as an image in a form
Technologies > User Interface Add-Ins > Assemblies with Multiple Panes > Find-Manage with Document Field
The image control field can be used as a part of a form panel to display either image files from the server file system, or images stored in the database and referenced as document fields. A document field declared in the data source will appear in a form panel as a document form field with document action buttons to Show, Check In, Check Out, Lock, or Delete the document.
By default, when the user presses the document field's Show action, the document displays in a pop-up window. By setting the document field's
displayField
attribute, the document may be displayed within an inline image display field instead. The image display field, or image control, is defined as a form field in the AXVW and given a
controlType
of
image
:
<panel type="form" id="exFindManageDoc_leaseForm" dataSource="exFindManageDoc_ds">
<field name="doc" table="ls"
displayField="ls_doc_image"
/>
<field id="ls_doc_image"
controlType="image"
colspan
="2" width="600" height="400"/>
The
rowspan
and
colspan
properties define how many form layout cells the control occupies. The
width
and
height
properties define the control size in pixels, as if defined in CSS.
To display the document as an inline image using JavaScript, such as from a panel button, call
showImageDoc()
, specifying
- The image control ID
- The ID of a form field that contains the document primary key value (possibly hidden field)
- The ID of a form field that contains the document file name (possibly hidden field).
form.showImageDoc('ls_doc_image', 'ls.ls_id', 'ls.doc');
To clear the image, call
clearImage()
:
form.clearImage('ls_doc_image');