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

public class FileAttachmentUICustomWidget extends UISimpleCustomWidget
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 Details

    • FileAttachmentUICustomWidget

      public FileAttachmentUICustomWidget(WidgetFactoryContext context, String servletPath, String uploadDirectory)
      Constructs a new FileAttachmentUICustomWidget for the specified path within the provided context.
      Parameters:
      context - the widget factory context providing information for widget creation
      servletPath - the Path to the declared servlet in web.xml preceded by the Module Name
      uploadDirectory - the folder to which the files will be uploaded to
  • Method Details

    • write

      public void write(WidgetWriter widgetWriter, WidgetDisplayContext context)
      Renders the widget in the UI, setting the associated field to allow attachments.
      Specified by:
      write in class UISimpleCustomWidget
      Parameters:
      widgetWriter - the WidgetWriter used to output the widget in the UI
      context - the WidgetDisplayContext providing information about how the widget should be displayed
    • addForEdit

      public void addForEdit(WidgetWriter widgetWriter, WidgetDisplayContext context)
      Handles the rendering of the widget in edit mode.
      Parameters:
      widgetWriter - WidgetWriter used to output the widget in the UI
      context - WidgetDisplayContext providing information about how the widget should be displayed
    • setUploadDirectory

      public void setUploadDirectory(String uploadDirectory)
      Sets the variable for the path of the file upload directory in your project
      Parameters:
      uploadDirectory - String
    • setServletPath

      public void setServletPath(String servletPath)
      Sets the variable for the path of the FileUploadDownloadServlet in your project
      Parameters:
      servletPath - String