Examples to invoke the emxIndentedTable.jsp with preProcessURL: Set the href of any command object using macros where appropriate: ${COMMON_DIR}/emxIndentedTable.jsp?mode=Edit&table=<IndentedTable_name> &preProcessURL=${SUITE_DIR}/emxCustomPreProcess.jsp or Invoke emxIndentedTable.jsp with custom JSP pages using the relative path (macros are not supported): ../common/emxIndentedTable.jsp?mode=Edit&table=<IndentedTable_name> &preProcessURL=../<Application Directory>/emxCustomPreProcess.jsp If both a preProcessURL and preProcessJPO are specified, the preProcessURL will be processed first, then the preProcessJPO will be processed. The pre process JSP has the following input parameters available:
context = (matrix.db.Context)request.getAttribute("context"); The following code sample shows how a custom processing page can read values from the requestMap: <% // get the timeStamp from the incoming HttpRequest String timeStamp = (String) emxGetParameter(request,"timeStamp"); // define the indented table bean %> <jsp:useBean id="indentedTableBean" class="com.matrixone.apps.framework.ui.UITableIndented" scope="session"/> <% // get the tableDataMap and the requestMap from the indented table bean HashMap tableDataMap = (HashMap) indentedTableBean.getTableData(timeStamp); HashMap requestMap = (HashMap) indentedTableBean.getRequestMap(tableDataMap); // get specific values from the requestMap String languageStr = (String) requestMap.get("languageStr"); String timeZone = (String) requestMap.get("timeZone"); String charSet = (String) requestMap.get("charSet"); String suiteKey = (String) requestMap.get("suiteKey"); String stringResourceFile = (String) requestMap.get("StringResourceFileId"); %> The following code sample shows how a custom processing page can iterate through the table objectIds. This example 'reserves' all objects in the objectList (as would likely be done in a pre processing custom JSP page). Note that custom processing JSP pages do not return anything to the component. <% // get the timeStamp from the incoming HttpRequest String timeStamp = (String) emxGetParameter(request,"timeStamp"); // define the indented table bean %> <jsp:useBean id="indentedTableBean" class="com.matrixone.apps.framework.ui.UITableIndented" scope="session"/> <% // get the tableDataMap and the objectList from the indented table bean HashMap tableDataMap = (HashMap) indentedTableBean.getTableData(timeStamp); MapList objectList = (MapList) indentedTableBean.getObjectList(tableDataMap); // loop through the objectList's list of object Maps Iterator objectListItr = objectList.iterator(); while(objectListItr.hasNext()){ // get the current object Map Map curObjectMap = (Map) objectListItr.next(); // get the current object's objectId from the current object Map String curObjectId = (String) curObjectMap.get("id"); // a comment to pass along with the object reserve operation String reserveComment = "This object is Reserved"; // create a BusinessObject, open the object, reserve the object, close the object BusinessObject curBusObject = new BusinessObject(curObjectId); curBusObject.open(context); curBusObject.reserve(context,reserveComment); curBusObject.close(context); } %> |