All Implemented Interfaces:
TagBase, EventAttribute, AAttributable, Serializable, Cloneable

public class OnSubmit extends AbstractEventAttribute implements AAttributable
onsubmit attribute for the element. This attribute is supported by multiple tags.
Since:
2.0.0
See Also:
  • Constructor Details

    • OnSubmit

      public OnSubmit()
    • OnSubmit

      public OnSubmit(ServerAsyncMethod serverAsyncMethod)
      Parameters:
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
    • OnSubmit

      public OnSubmit(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody)
      Parameters:
      jsPreFunctionBody - the body part JavaScript function (without function declaration). It must return true/false. This function will invoke at client side before serverAsyncMethod. If the jsPrefunction returns true then only serverAsyncMethod method will invoke (if it is implemented). It has implicit objects like event and source which gives the reference of the current tag.
      Eg:-
                                                                          if (source.type == 'button') {
                                                                             return true;
                                                                          }
                                                                          return false;
                                   
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      jsFilterFunctionBody - The body part of a JavaScript function (without function declaration). It can return a JavaScript object so that it will be available at server side in serverAsyncMethod as wffBMObject parameter. There are implicit objects event and source in the scope.
      Eg:-
                                                                          var bName = source.name;
                                                                          return {buttonName: bName, author:'wff', dateOfYear: 2014};
                                   
      jsPostFunctionBody - The body part of a JavaScript function (without function declaration). The wffBMObject returned by serverAsyncMethod will be available as an implicit object jsObject in the scope. There are common implicit objects event and source in the scope.
    • OnSubmit

      public OnSubmit(String value)
    • OnSubmit

      public OnSubmit(ServerAsyncMethod serverAsyncMethod, Object serverSideData)
      Parameters:
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      serverSideData - this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.
      Since:
      3.0.2
    • OnSubmit

      public OnSubmit(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData)
      Parameters:
      jsPreFunctionBody - the body part JavaScript function (without function declaration). It must return true/false. This function will invoke at client side before serverAsyncMethod. If the jsPrefunction returns true then only serverAsyncMethod method will invoke (if it is implemented). It has implicit objects like event and source which gives the reference of the current tag.
      Eg:-
                                                                          if (source.type == 'button') {
                                                                             return true;
                                                                          }
                                                                          return false;
                                   
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      jsFilterFunctionBody - The body part of a JavaScript function (without function declaration). It can return a JavaScript object so that it will be available at server side in serverAsyncMethod as wffBMObject parameter. There are implicit objects event and source in the scope.
      Eg:-
                                                                          var bName = source.name;
                                                                          return {buttonName: bName, author:'wff', dateOfYear: 2014};
                                   
      jsPostFunctionBody - The body part of a JavaScript function (without function declaration). The wffBMObject returned by serverAsyncMethod will be available as an implicit object jsObject in the scope. There are common implicit objects event and source in the scope.
      serverSideData - this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.
      Since:
      3.0.2
    • OnSubmit

      public OnSubmit(boolean preventDefault, ServerAsyncMethod serverAsyncMethod)
      Parameters:
      preventDefault - true to call event.preventDefault(); on event
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      Since:
      3.0.15
    • OnSubmit

      public OnSubmit(boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody)
      Parameters:
      preventDefault - true to call event.preventDefault(); on event
      jsPreFunctionBody - the body part JavaScript function (without function declaration). It must return true/false. This function will invoke at client side before serverAsyncMethod. If the jsPrefunction returns true then only serverAsyncMethod method will invoke (if it is implemented). It has implicit objects like event and source which gives the reference of the current tag.
      Eg:-
                                                                          if (source.type == 'button') {
                                                                             return true;
                                                                          }
                                                                          return false;
                                   
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      jsFilterFunctionBody - The body part of a JavaScript function (without function declaration). It can return a JavaScript object so that it will be available at server side in serverAsyncMethod as wffBMObject parameter. There are implicit objects event and source in the scope.
      Eg:-
                                                                          var bName = source.name;
                                                                          return {buttonName: bName, author:'wff', dateOfYear: 2014};
                                   
      jsPostFunctionBody - The body part of a JavaScript function (without function declaration). The wffBMObject returned by serverAsyncMethod will be available as an implicit object jsObject in the scope. There are common implicit objects event and source in the scope.
      Since:
      3.0.15
    • OnSubmit

      public OnSubmit(boolean preventDefault, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody)
      Parameters:
      preventDefault - true to call event.preventDefault(); on event
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      jsFilterFunctionBody - The body part of a JavaScript function (without function declaration). It can return a JavaScript object so that it will be available at server side in serverAsyncMethod as wffBMObject parameter. There are implicit objects event and source in the scope.
      Eg:-
                                                                          var bName = source.name;
                                                                          return {buttonName: bName, author:'wff', dateOfYear: 2014};
                                   
      jsPostFunctionBody - The body part of a JavaScript function (without function declaration). The wffBMObject returned by serverAsyncMethod will be available as an implicit object jsObject in the scope. There are common implicit objects event and source in the scope.
      Since:
      3.0.15
    • OnSubmit

      public OnSubmit(boolean preventDefault, ServerAsyncMethod serverAsyncMethod, Object serverSideData)
      Parameters:
      preventDefault - true to call event.preventDefault(); on event
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      serverSideData - this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.
      Since:
      3.0.15
    • OnSubmit

      public OnSubmit(boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData)
      Parameters:
      preventDefault - true to call event.preventDefault(); on event
      jsPreFunctionBody - the body part JavaScript function (without function declaration). It must return true/false. This function will invoke at client side before serverAsyncMethod. If the jsPrefunction returns true then only serverAsyncMethod method will invoke (if it is implemented). It has implicit objects like event and source which gives the reference of the current tag.
      Eg:-
                                                                          if (source.type == 'button') {
                                                                             return true;
                                                                          }
                                                                          return false;
                                   
      serverAsyncMethod - This method will invoke at server side with an argument wffBMObject. The wffBMObject is the representational JavaScript object returned by jsFilterFunctionBody.
      jsFilterFunctionBody - The body part of a JavaScript function (without function declaration). It can return a JavaScript object so that it will be available at server side in serverAsyncMethod as wffBMObject parameter. There are implicit objects event and source in the scope.
      Eg:-
                                                                          var bName = source.name;
                                                                          return {buttonName: bName, author:'wff', dateOfYear: 2014};
                                   
      jsPostFunctionBody - The body part of a JavaScript function (without function declaration). The wffBMObject returned by serverAsyncMethod will be available as an implicit object jsObject in the scope. There are common implicit objects event and source in the scope.
      serverSideData - this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.
      Since:
      3.0.15
  • Method Details

    • isPreventDefault

      public boolean isPreventDefault()
      Description copied from class: AbstractEventAttribute
      This is applicable for some special attributes like OnSubmit.
      Overrides:
      isPreventDefault in class AbstractEventAttribute
      Returns:
      true or false. true means to call event.preventDefault() on event otherwise false.
    • setPreventDefault

      public void setPreventDefault(boolean preventDefault)
      true to call event.preventDefault(); on event, it will prevent form submission to action url if it is added on form. It will set only if there is ServerAsyncMethod.
      Overrides:
      setPreventDefault in class AbstractEventAttribute
      Parameters:
      preventDefault - true to call event.preventDefault(); on event otherwise false.
      Since:
      3.0.15
    • init

      protected void init()
      invokes only once per object
      Overrides:
      init in class AbstractEventAttribute
      Since:
      2.0.0