When you map the request model ID to the self-designed forms, the forms are launched in the Request Modeler container. However, Canvas provides you the option to launch the form in a custom form container or without any form container also.
- Sample code for launching the form with the request model container
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK ,function(config) { canvas.launch ({ formId : "EMP_DETAILS_FORM" }); }); /* Here, EMP_FORM is the custom workspace menu. * The request model ID is mapped to the EMP_DETAILS_FORM in form designer. * When the menu is clicked, the form is launched through the canvas launch API * in the Request Modeler container.*/
The following is a sample screen shot of the form with the model container.
- Sample code for launching the form with the custom container
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK ,function(config) { canvas.launch ({ formId : "EMP_DETAILS_FORM", containerId : "EMP_DETAILS_FORM_CONT" }); }); /* Here, EMP_FORM is the custom workspace menu. * The request model ID is mapped to the EMP_DETAILS_FORM in form designer. * When the menu is clicked, the form is launched through the canvas launch API * in the custom container (EMP_DETAILS_FORM_CONT).*/ /* If you have not mapped the model ID to the self-designed form in form designer, * the model ID can be provided at runtime. Sample code is as follows:*/ CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK ,function(config) { canvas.launch ({ formId : "EMP_DETAILS_FORM", containerId : "EMP_DETAILS_FORM_CONT", modelId:"REQ01" }); });
The following is a sample screen shot of the form with the custom container.
- Sample code for launching the form without any container
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK ,function(config) { canvas.launch ({ formId :"EMP_DETAILS_FORM", modContReqd: "N" }); }); /* Here, EMP_FORM is the custom workspace menu. * The request model ID is mapped to the EMP_DETAILS_FORM in form designer. * When the menu is clicked, the form is launched through the canvas launch API without any container. * The parameter modContReqd: "N" has been passed to launch the form without any container.*/ /* If you have not mapped the model ID to the self-designed form in form designer, * the model ID can be provided at runtime. Sample code is as follows:*/ CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK, function(config) { canvas.launch ({ formId :"EMP_DETAILS_FORM", modContReqd: "N", modelId: "REQ01" }); });
The following is a sample screen shot of the form without container.