Examples to invoke the emxForm.jsp with preProcessURL:
- Set the href of any command object using macros where appropriate:
${COMMON_DIR}/emxForm.jsp?mode=Edit&form=<form_name>
&preProcessURL=${SUITE_DIR}/emxCustomPreProcess.jsp
or
- Invoke emxForm.jsp with custom JSP pages using the relative path (macros
are not supported):
../common/emxForm.jsp?mode=Edit&form=<form_name>
&preProcessURL=../<Application Directory>/emxCustomPreProcess.jsp
If you specify both a preProcessURL and preProcessJPO,
the preProcessURL executes first, followed by the preProcessJPO.
The pre-process JSP has these input parameters:
You can read the request parameters in the pre-process
JSP page using this code:
<%
// get the timeStamp and objectId from the incoming
HttpRequest
String timeStamp = (String)
emxGetParameter(request,"timeStamp");
String objectId = (String)
emxGetParameter(request,"objectId");
String relId = emxGetParameter(request, "relId");
%>
To read the form field information in the pre-process
JSP page:
- Define the JSP usebean tag for the formEditBean in the pre-process
JSP:
<jsp:useBean id="formEditBean"
class="com.matrixone.apps.framework.ui.UIForm" scope="session"/
>
- After getting the timeStamp parameter
value from the request, get the associated formMap containing the form
field details:
HashMap formMap = formEditBean.getFormData(timeStamp);
- Retrieve the individual form field information by iterating
for each field:
MapList formFieldList = (MapList) formMap.get("fields");
for(int i=0; i<formFieldList.length(); i++)
{
HashMap fieldMap = (HashMap) formFieldList.get(i);
}