Pre-Process URL for an Editable Form Page

The preProcessURL parameter specifies the name of the JSP to call during pre-processing of the web form in Edit mode.

Examples to invoke the emxForm.jsp with preProcessURL:


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

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


  • The request parameters available for the emxForm.jsp, for example, objectId, relId, timeStamp, form, portalMode, suiteKey, etc.
  • The request parameter timeStamp gets the form field information stored in the form bean as a map.
  • To update or interact with any objects, obtain the context from the request using this code:
    context = (matrix.db.Context)request.getAttribute("context");
    

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:


  1. 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"/
    >
    
  2. After getting the timeStamp parameter value from the request, get the associated formMap containing the form field details:
    HashMap formMap = formEditBean.getFormData(timeStamp);   
    
  3. 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);
    
    }