Class FormBindableBase

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected WmEditView[] editViews
      Collection of all editViews for the PanelTabset.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDisallowedField​(org.springframework.web.bind.ServletRequestDataBinder binder, String field)
      Adds ad disallowed field to the list of allowed fields contained by the binder.
      void addEditView​(WmEditView editView)
      adds an EditView the the this.editViews[].
      void addValidator​(org.springframework.validation.Validator validator)
      Helper method to add a validator the the list of validators.
      Object formBackingObject​(javax.servlet.http.HttpServletRequest request)
      Returns the form backing object of this formbindable
      LinkedHashMap<DelegatedController,​FormBackingObject> getControllerDelegationMap()
      Return the map of delegated controllers of this controller.
      DelegatedController getDelegatedController()
      Returns the Spring controller to be used for this formbindable.
      EditView getEditView()
      Returns the default EditView that should be used for form display.
      EditView getEditViewByValue​(String value)
      Returns the indicated EditView that should be used for form(part) display.
      DelegatedController getParentController()  
      ArrayList<String> getResourceBaseNames()
      Return the resource base names for this controller
      org.springframework.validation.Validator[] getValidators()
      Returns array of validators for this controller.
      void initBinder​(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
      Callback for additional binder initialisations.
      void initialize​(javax.servlet.http.HttpServletRequest request)
      Called by the framework to initialize the controller
      void onBind​(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors)
      Callback for custom post-processing in terms of binding.
      void onBindAndValidate​(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.BindException errors)
      Callback for custom post-processing in terms of binding and validation.
      void onSubmit​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView)
      This is method is called by the Spring framework after binding posted form values onto the form backing object and invoking the onBind and onBindAndValidate callback methods.
      Map referenceData​(javax.servlet.http.HttpServletRequest request, Object command, org.springframework.validation.Errors errors)
      Callback to createa a reference data map for the given request and command.
      void setDelegatedController​(DelegatedController controller)
      Sets the Spring controller to be used for this formbindable.
      void setEditViews​(WmEditView[] editViews)
      set all editViews for this component.
      void setParentController​(DelegatedController parentController)  
      void setValidators​(org.springframework.validation.Validator[] validators)
      Sets the array of validators for this controller.
      org.springframework.web.servlet.ModelAndView showForm​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.validation.BindException errors, Map controlModel)
      Callback for returning the model and view for a GET request.
    • Field Detail

      • editViews

        protected WmEditView[] editViews
        Collection of all editViews for the PanelTabset.
    • Constructor Detail

      • FormBindableBase

        public FormBindableBase()
    • Method Detail

      • initialize

        public void initialize​(javax.servlet.http.HttpServletRequest request)
        Description copied from interface: DelegatedController
        Called by the framework to initialize the controller
        Specified by:
        initialize in interface DelegatedController
      • initBinder

        public void initBinder​(javax.servlet.http.HttpServletRequest request,
                               org.springframework.web.bind.ServletRequestDataBinder binder)
                        throws Exception
        Description copied from interface: DelegatedController
        Callback for additional binder initialisations. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.initBinder(); called before the databinding to the commandobject.
        Specified by:
        initBinder in interface DelegatedController
        Parameters:
        request - current HTTP request
        binder - binder instance
        Throws:
        Exception - in case of invalid state or arguments
      • addValidator

        public void addValidator​(org.springframework.validation.Validator validator)
        Helper method to add a validator the the list of validators.
        Specified by:
        addValidator in interface DelegatedController
        Parameters:
        validator - Validator to add
      • addDisallowedField

        public void addDisallowedField​(org.springframework.web.bind.ServletRequestDataBinder binder,
                                       String field)
        Adds ad disallowed field to the list of allowed fields contained by the binder.
        Parameters:
        binder - The binder to which the disallowed field should be added
        field - The field that should be disallowed
      • onBind

        public void onBind​(javax.servlet.http.HttpServletRequest request,
                           Object command,
                           org.springframework.validation.BindException errors)
                    throws Exception
        Description copied from interface: DelegatedController
        Callback for custom post-processing in terms of binding. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.onBind(); called after the databinding to the commandobject.
        Specified by:
        onBind in interface DelegatedController
        Parameters:
        request - current HTTP request
        command - the command object to perform further binding on
        errors - validation and binder errors holder, allowing for additional custom registration of binding errors
        Throws:
        Exception - in case of invalid state or arguments
      • onBindAndValidate

        public void onBindAndValidate​(javax.servlet.http.HttpServletRequest request,
                                      Object command,
                                      org.springframework.validation.BindException errors)
                               throws Exception
        Description copied from interface: DelegatedController
        Callback for custom post-processing in terms of binding and validation. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.onBindAndValidate(); called after the validate(), also in case of validation and/or bind errors
        Specified by:
        onBindAndValidate in interface DelegatedController
        Parameters:
        request - current HTTP request
        command - the command object, still allowing for further binding
        errors - errors holder, allowing for additional custom validation errors
        Throws:
        Exception - in case of invalid state or arguments
      • onSubmit

        public void onSubmit​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             Object command,
                             org.springframework.validation.BindException errors,
                             org.springframework.web.servlet.ModelAndView modelAndView)
                      throws Exception
        This is method is called by the Spring framework after binding posted form values onto the form backing object and invoking the onBind and onBindAndValidate callback methods. In this method values contained by the form backing object can be set to the data model and be persisted.
        Specified by:
        onSubmit in interface DelegatedController
        Parameters:
        request - current servlet request
        response - current servlet response
        command - form object with request parameters bound onto it
        errors - Errors instance without errors (subclass can add errors if it wants to)
        modelAndView - model and view of the original main spring controller which handles the request
        Throws:
        Exception - in case of errors
      • showForm

        public org.springframework.web.servlet.ModelAndView showForm​(javax.servlet.http.HttpServletRequest request,
                                                                     javax.servlet.http.HttpServletResponse response,
                                                                     org.springframework.validation.BindException errors,
                                                                     Map controlModel)
                                                              throws Exception
        Callback for returning the model and view for a GET request.
        Specified by:
        showForm in interface DelegatedController
        Parameters:
        request - current servlet request
        response - current servlet response
        errors - errors holder without errors (subclass can add errors if it wants to)
        controlModel - Current model of the controller
        Returns:
        The model and view to be rendered by this controller
        Throws:
        Exception - in case of errors
      • formBackingObject

        public Object formBackingObject​(javax.servlet.http.HttpServletRequest request)
                                 throws javax.servlet.ServletException
        Returns the form backing object of this formbindable
        Specified by:
        formBackingObject in interface DelegatedController
        Parameters:
        request - current servlet request
        Returns:
        the form backing object of this formbindable
        Throws:
        javax.servlet.ServletException - in case of errors
      • referenceData

        public Map referenceData​(javax.servlet.http.HttpServletRequest request,
                                 Object command,
                                 org.springframework.validation.Errors errors)
                          throws Exception
        Description copied from interface: DelegatedController
        Callback to createa a reference data map for the given request and command. consisting of bean name/bean instance pairs as expected by ModelAndView. called by the WebmanagerController at a GET equivalent to org.springframework.web.servlet.mvc.SimpleFormController.referenceData();
        Specified by:
        referenceData in interface DelegatedController
        Parameters:
        request - current HTTP request
        command - command object
        errors - Errors holder
        Returns:
        a Map with reference data entries, or null if none
        Throws:
        Exception - in case of invalid state or arguments
        See Also:
        ModelAndView
      • getEditView

        public EditView getEditView()
        Description copied from interface: DelegatedController
        Returns the default EditView that should be used for form display.
        Specified by:
        getEditView in interface DelegatedController
        Returns:
        the default EditView that should be used for form display.
      • getEditViewByValue

        public EditView getEditViewByValue​(String value)
        Description copied from interface: DelegatedController
        Returns the indicated EditView that should be used for form(part) display.
        Specified by:
        getEditViewByValue in interface DelegatedController
        Parameters:
        value - Value of the view that should be used
        Returns:
        the indicated view that should be used for form display.
      • setEditViews

        public void setEditViews​(WmEditView[] editViews)
        set all editViews for this component.
        Parameters:
        editViews - EditView[] holding the editViews for this component
      • addEditView

        public void addEditView​(WmEditView editView)
        adds an EditView the the this.editViews[].
        Parameters:
        editView - to be added
      • getValidators

        public org.springframework.validation.Validator[] getValidators()
        Returns array of validators for this controller.
        Specified by:
        getValidators in interface DelegatedController
        Returns:
        Array of validators
      • setValidators

        public void setValidators​(org.springframework.validation.Validator[] validators)
        Sets the array of validators for this controller.
      • setParentController

        public void setParentController​(DelegatedController parentController)