Class FileAttachmentUICustomWidget
java.lang.Object
com.orchestranetworks.ui.form.widget.UICustomWidget
com.orchestranetworks.ui.form.widget.UISimpleCustomWidget
com.apgar.common.lib.ui.widget.fileattachmentwidget.FileAttachmentUICustomWidget
- All Implemented Interfaces:
UIWidget
Custom widget for handling the display and editing of an attached file.
This widget extends UISimpleCustomWidget and is designed to be used as a placeholder for an attachment field where documents can
be uploaded.
- Author:
- APGAR Consulting
-
Constructor Summary
ConstructorsConstructorDescriptionFileAttachmentUICustomWidget(WidgetFactoryContext context, String servletPath, String uploadDirectory) Constructs a newFileAttachmentUICustomWidgetfor the specified path within the provided context. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddForEdit(WidgetWriter widgetWriter, WidgetDisplayContext context) Handles the rendering of the widget in edit mode.voidsetServletPath(String servletPath) Sets the variable for the path of theFileUploadDownloadServletin your projectvoidsetUploadDirectory(String uploadDirectory) Sets the variable for the path of the file upload directory in your projectvoidwrite(WidgetWriter widgetWriter, WidgetDisplayContext context) Renders the widget in the UI, setting the associated field to allow attachments.Methods inherited from class com.orchestranetworks.ui.form.widget.UISimpleCustomWidget
validateMethods inherited from class com.orchestranetworks.ui.form.widget.UICustomWidget
isDisplayingCustomWidgetValidationMessage, isEditorDisabled, setEditorDisabled, zza, zza, zzb
-
Constructor Details
-
FileAttachmentUICustomWidget
public FileAttachmentUICustomWidget(WidgetFactoryContext context, String servletPath, String uploadDirectory) Constructs a newFileAttachmentUICustomWidgetfor the specified path within the provided context.- Parameters:
context- the widget factory context providing information for widget creationservletPath- the Path to the declared servlet in web.xml preceded by the Module NameuploadDirectory- the folder to which the files will be uploaded to
-
-
Method Details
-
write
Renders the widget in the UI, setting the associated field to allow attachments.- Specified by:
writein classUISimpleCustomWidget- Parameters:
widgetWriter- theWidgetWriterused to output the widget in the UIcontext- theWidgetDisplayContextproviding information about how the widget should be displayed
-
addForEdit
Handles the rendering of the widget in edit mode.- Parameters:
widgetWriter-WidgetWriterused to output the widget in the UIcontext-WidgetDisplayContextproviding information about how the widget should be displayed
-
setUploadDirectory
Sets the variable for the path of the file upload directory in your project- Parameters:
uploadDirectory- String
-
setServletPath
Sets the variable for the path of theFileUploadDownloadServletin your project- Parameters:
servletPath- String
-