Interface Form

    • Method Detail

      • displayScripts

        void displayScripts​(javax.servlet.jsp.JspWriter out,
                            PagesContext pagesContext)
        Prints the javascripts which will be used to control the new values given to the data record fields. The error messages may be adapted to a local language. The RecordTemplate gives the field type and constraints. The RecordTemplate gives the local label too. Never throws an Exception but log a silvertrace and writes an empty string when :
        • a field is unknown by the template.
        • a field has not the required type.
      • display

        void display​(javax.servlet.jsp.JspWriter out,
                     PagesContext pagesContext,
                     DataRecord record)
              throws FormException
        Prints the HTML layout of the dataRecord using the RecordTemplate to extract labels and extra informations. The value formats may be adapted to a local language. Never throws an Exception but log a silvertrace and writes an empty string when :
        • a field is unknown by the template.
        • a field has not the required type.
        Throws:
        FormException
      • updateWysiwyg

        List<String> updateWysiwyg​(List<org.apache.commons.fileupload.FileItem> items,
                                   DataRecord record,
                                   PagesContext pagesContext)
                            throws FormException
        Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request. this method treats only wysiwyg fields.
        Throws:
        FormException - if the field type is not a managed type or if the field doesn't accept the new value.
      • update

        List<String> update​(List<org.apache.commons.fileupload.FileItem> items,
                            DataRecord record,
                            PagesContext pagesContext)
                     throws FormException
        Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request.
        Throws:
        FormException - if the field type is not a managed type or if the field doesn't accept the new value.
      • update

        List<String> update​(List<org.apache.commons.fileupload.FileItem> items,
                            DataRecord record,
                            PagesContext pagesContext,
                            boolean updateWysiwyg)
                     throws FormException
        Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request.
        Throws:
        FormException - if the field type is not a managed type or if the field doesn't accept the new value.
      • getTitle

        String getTitle()
        Get the form title
      • getFieldTemplates

        List<FieldTemplate> getFieldTemplates()
        Gets the template of all fields that make this form
        Returns:
        a List of FieldTemplate
      • isEmpty

        boolean isEmpty​(List<org.apache.commons.fileupload.FileItem> items,
                        DataRecord record,
                        PagesContext pagesContext)
      • setFormName

        void setFormName​(String name)
      • setViewForm

        void setViewForm​(boolean viewForm)
        Defines if this form is a 'view' form (opposite to an 'update' form) A 'view' form may have some specific behaviors like to not display empty fields
        Parameters:
        viewForm - true if this form is a 'view' form
      • getFormName

        String getFormName()