ProcessCommand

Top  Previous  Next

ProcessCommand element defines a command to submit the enclosing ProcessForm. The element can be defined using an HTML INPUT element either with type button or hidden.

  <input name="__pcommand" type="button" value="DeleteProductCommand" 
         onclick="if (PMgr.submitProcessForm('ProductsForm','DeleteProduct' ,'' ) == false) return false;" 
         mo:name="DeleteProduct" mo:type="ProcessCommand" 
         mo:props="requiredBlocks:'ProductsBlock,', validateInput:true, 
                   confirmMessage:'Are you sure?', beforeSubmitFunc:CallMeBeforeSubmit "
  /> 

 
The name attribute of the input element must be "__pcommand". If a hidden element is preferred instead of a button element then the PMgr.submitProcessForm() call definition that is provided in the onclick attribute should defined else where in the page.

See PMgr.submitProcessForm() in  MoreMotion Face API.

 
The Properties

requiredBlocks

This property should contain the names of the ProcessBlocks (separated with commas) existing in the ProcessForm that needs to be validated before the submission. During the ProcessBlock validation, the ProcessFields existing in the blocks are validated according to their validation settings.

beforeSubmitFunc

In this property you can define the name of a Javascript function to be called just before the submitting the Process Form. The function receives the form object as the parameter can perform last minute tasks such as validation the input and it can cancel the submission of the form by returning false as the result.

validateInput

Select "true" if you want that the input fields are validated before submitting the ProcessForm. The validation is performed only for the fields that are located in the ProcessBlocks specified with requiredBlocks attribute.

confirmMessage

For some cases it is necessary to ask the user's confirmation before submitting the Process Form; .e.g. before deleting a record. If a value is given into this property, it will be displayed to the user in a confirmation request dialog and the Process Form will be submitted only if the user confirms.

 

See Process Command Configuration

See ProcessCommand Function Class in MoreMotion Face API.