crm:attachment
Overview
The <crm:attachment> tag is used to display a file attachment component on the page. A generic composite component was implemented in order to been used in various jsf pages. Furthermore the defined component, contains a crm:dataTable with three columns (attachment, classification and notes).
During read mode, the three columns are important to us and need to been explained as follow:
- Attachment (two different kinds)
- File Attachment (uses link to download the file by using p:fileDownload JSFs' component and a function named getAttachementsFile(attachment), implemented in GlobalView.
- Url Attachment (a simple crm:inputText component is used to define a certain url)
- Classification (crm:selectOneMenu component is used to produce the attachment classification options of the system by call a method named getAttachmentClassifications(), which is implemented in DataEntryView)
- Notes (a simple crm:inputText is used to define any further notes for the specified attachments)
During edit mode two actions are demonstrated as follow:
- Upload a file (using another composite component named crm:uploadFile in order to upload a file as an attachment)
- Add URL (using another composite component named crm:inputText, that let you define your url)
Attributes
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | false | String | null | Unique identifier of the component. |
managedBean | false | String | null | The name of the Java managed bean class that will be used for retrieving the component values. |
oncomplete | false | String | null | Defines the function call triggered when upload ends. |
refresh | false | String | @form | Component(s) to update with ajax. |
uploadMethod | false | String | handleAttachmentFileUpload( | Defines the function call triggered when a file is uploaded (implemented in DataEntryView). |
disableAddLinkButton | false | Boolean | false | Defines if the 'Add URL' action will be visible. |
Getting Started
The following example shows an attachment component both in view as well as edit mode.