Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


When you create a request, Request Modeler creates a menu in the specified workspace for you to access the form. The auto generated form gets launched from this menu through ct.modeler.launch API. You cannot launch the form created by you in the place of the auto generated form from this workspace menu. However, you can launch the self-designed form created by you with or without container by clicking a context menu or a button in an app, from a link or from a custom workspace menu. The following sections explain the various ways to launch the form from a workspace menu as an example.

Using Canvas Launch API


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.

By Passing the Form Manager to CBXFORMCONTAINER.getWindowByFormObj()


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.


CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK, function(config) {
CBXDOWNLOADMGR.requestScripts(ct.downloadProvider.getMergedArray(["FORM_CONTAINER", "WSPACE_PREF_FORMS"]), function() {
var fm = new ct.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(ct.downloadProvider.getMergedArray(["FORM_CONTAINER", "WSPACE_PREF_FORMS"]), function() {
var fm = new ct.form.FormManager({
formId: "EMP_DETAILS_FORM",
modelId: "REQ01"
});
CBXFORMCONTAINER.getWindowByFormObj(fm, "EMP_DETAILS_FORM_CONT", null);
});
});

By Passing the Form ID to CBXFORMCONTAINER.getWindowByFormId()


When you launch the form by passing the form ID to CBXFORMCONTAINER.getWindowByFormId, the request model ID cannot be provided at runtime and therefore, ensure to map the request model ID 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.
CWMH.registerHandler("EMP_FORM", CWMC.EVENT_CLICK, function(config) {
 
CBXDOWNLOADMGR.requestScripts(ct.downloadProvider.getMergedArray(["FORM_CONTAINER", "WSPACE_PREF_FORMS"]), function() {
CBXFORMCONTAINER.getWindowByFormId("EMP_DETAILS_FORM", "EMP_DETAILS_FORM_CONT");
});
});
/* Here, EMP_FORM is the workspace menu. EMP_DETAILS_FORM is passed as the form ID to launch it from the menu in the custom container.*/

  • No labels