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)
    1. File Attachment (uses link to download the file by using p:fileDownload JSFs' component and a function named getAttachementsFile(attachment), implemented in GlobalView.
    2. 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)

Edit Mode

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

NameRequiredTypeDefaultDescription
idfalseStringnullUnique identifier of the component.
managedBeanfalseStringnullThe name of the Java managed bean class that will be used for retrieving the component values.
oncompletefalseStringnull

Defines the function call triggered when upload ends.

refreshfalseString@formComponent(s) to update with ajax.
uploadMethodfalseStringhandleAttachmentFileUpload(Defines the function call triggered when a file is uploaded (implemented in DataEntryView).
disableAddLinkButtonfalseBooleanfalseDefines 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.