When you launch the form by passing the form manager to CBXFORMCONTAINER.getWindowByFormObj(), the following factors are to be noted:
- Even if the request model ID is mapped to the self-designed form (EMP_DETAILS_FORM), you must provide the container ID in the code. If you are providing the custom container ID (EMP_DETAILS_FORM_CONT), you will have to wire the form container actions to the Request Modeler actions, if required. If you want the model container to display, then provide the model container ID.
- If the request model ID is not mapped to the self-designed form, you can provide the model ID at runtime.
Code Block |
---|
|
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK, function(config)
{
CBXDOWNLOADMGR.requestScripts(ctcanvas.downloadProvider.getMergedArray([
"FORM_CONTAINER", "WSPACE_PREF_FORMS"]), function()
{
var fm = new ctcanvas.form.FormManager(
{
formId: "EMP_DETAILS_FORM",
});
CBXFORMCONTAINER.getWindowByFormObj(fm, "EMP_DETAILS_FORM_CONT", null);
});
});
/* Here, EMP_FORM is the workspace menu. EMP_DETAILS_FORM is launched from the menu
* by passing the form manager object.*/
//* Sample code to provide the model ID in runtime is as follows:*/
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK ,function(config)
{
CBXDOWNLOADMGR.requestScripts(ctcanvas.downloadProvider.getMergedArray([
"FORM_CONTAINER", "WSPACE_PREF_FORMS"]), function()
{
var fm = new ctcanvas.form.FormManager(
{
formId: "EMP_DETAILS_FORM",
modelId: "REQ01"
});
CBXFORMCONTAINER.getWindowByFormObj(fm, "EMP_DETAILS_FORM_CONT", null);
});
}); |