Harness and Section forms — Adding an Attach Content control
|
|
About the Attach Content control
The Attach Content control assists with attaching and uploading media files for Pega 7 applications, including (but not limited to):
- Image files (.jpg, .png, etc.)
- Photos taken using a mobile device or desktop camera
Mobile Browsers
When in a mobile web browser, this control is limited to attaching image files only. When a user takes any action on a mobile device with this control enabled, a dialog box will be launched in the application with selections for the user, which differ based on the device's operating system.
- On iOS devices, the dialog box allows users to take a new picture using the camera or to select an existing picture from the device's camera roll.
- On Android devices, the dialog box allows users to choose an image file from a tiled list of applications, including the device camera, Google Drive, Dropbox, etc. (selection varies based on what applications have been installed on the device).
Desktop Browsers
Using a desktop browser with this control enabled launches the file browser, allowing users to select a type of capture mechanism and/or utilize an "attach file(s)" file selection prompt directly from their desktop. Desktop browser users are not limited to image files when using this control, and may attach other file types. This control also provides support for multiple file selection when attaching files.
Adding an Attach Content control
- In the section editor in Designer Studio, create a new layout where the Attach Content button will be positioned.
- On the Design tab, click the down-arrow at the right end of the Basic control group. Click and drag any of the controls from this list into the layout.
If you are using a cell-based layout and you drag the control into a cell that is not empty, then the dropped control replaces the current contents of the cell.
-
Click the icon for the control to display the Cell Properties dialog.
- Click change next to the control name, then click Attach Content under the "Advanced" column. The control name will now read pxAttachContent.
- On the General tab of the Cell Properties dialog, use the Content Type dropdown to select Image.
- Make any additional desired changes using the fields provided, then click OK to apply these changes. An Attach Content button will now appear in the layout.
Customizing control actions
Map the new control to display output of the pzControlButtonReadOnly in the design view.
On-click actions are executed after selected photo/file is uploaded. If the upload fails or if the user cancels the capture and upload process, the configured OnClick actions will not be executed.
Other events can be configured on the OnClick action for this control (such as "refresh section"). These events are executed after the inherited behavior.
About Flow Actions
About Harnesses
About Sections