Post Process JPO for an Editable Table

The postProcessJPO parameter specifies the name of the JPO program and method to invoke during post processing.

If the table is loaded directly into edit mode using emxTableEdit.jsp, note the following behavior. When a user clicks Done on an editable table page, the custom preprocessing methods are re-executed because the page is refreshed. As a result, if a post processing method has been defined for the table page that unreserves an object (or objects), the re-execution of the preprocessing method will most likely reserve the object(s) again. For customizations that reserve objects in the preprocessing JPO, use a Cancel processing method to unreserve objects instead of a Post processing method.

This example shows how to invoke the emxTable.jsp with postProcessJPO:

${COMMON_DIR}/emxTable.jsp?mode=Edit&table=<table_name>
&postProcessJPO=<JPO Name>:<Method Name>

If both a postProcessURL and postProcessJPO are specified, the postProcessURL executes first followed by the postProcessJPO.

The post process JPO specifies the programMap as an argument for post processing. The programMap contains the following HashMaps:


  • requestMap contains all the request parameters
  • paramMap contains key parameters like objectId, relId, languageStr
    Parameter Description

    objectId

    Object ID

    relId

    Relationship ID of the object

    EditAction

    Assigned to this value:

    DONE - Default value; edit dialog to be closed

  • tableData contains all the column information

The above maps are packed using the packArgs method supported by JPO and passed to the post process JPO being invoked. The post process JPO can unpack this input parameter, and it can be used by the post process for custom coding.

You can read the arguments passed for the pre process JPO as given below

HashMap programMap = (HashMap) JPO.unpackArgs(args);
HashMap paramMap = (HashMap) programMap.get("paramMap");
HashMap requestMap = (HashMap) programMap.get("requestMap");
HashMap tableMap = (HashMap) programMap.get("tableMap");

The requestMap contains the languageStr. You can read these parameter values as shown below:

String languageStr = requestMap.get("languageStr");

The code sample in Preprocess JPO for an Editable Table shows you how to read values from the requestMap and iterate through the ObjectList for the objectIds.

The post process JPO returns a HashMap or returns nothing. The HashMap contains the keys defined in this table:

Key Value

Action

Assigned to one of these values:

CONTINUE - the transaction is committed

STOP - the transaction is aborted.

Default = CONTINUE.

Message

Either a string resource key or an original text message to be displayed to the user. The string must use proper JavaScript format for escape characters such as single quote, double quote, and new lines.

If the Message key contains any value, it displays to the user as an alert.

If the value of the Action key is Continue, the system commits the entire transaction of the edit process, post process JSP, and post process JPO.

If the value of the Action key is Stop, the system aborts the entire transaction, including the edit process.

If the post Process JPO does not need to communicate to the table, it can return nothing (void) or an empty HashMap. In this case, the process proceeds with the default behavior of Continue and No message.