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:
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:
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. |