Business Console 10.7 | webMethods Business Console Documentation | Developing Gadgets for Business Console | Programming Gadgets | Loading a Gadget or an AppSpace in a Modal Dialog Box | Loading an AppSpace in a Modal Dialog Box
 
Loading an AppSpace in a Modal Dialog Box
1. Inject AppspaceUtilityService into the controller or service.
2. Use the service to load the gadget.
You can use the following code:

appspaceUtilityService

.newAppspaceModal() //to ensure a new modal instance
//is opened by closing any exisiting one
.showHeader(false) //true or false depending on whether
//you want to show the header
.showRefreshIcons(true)//true or false depending on whether
//you want to show the refresh icon
.setRefreshEvent("<REFRESH_EVENT_NAME>") //Event to fire when
//the refresh icon is clicked
.params(params)//Optional. If you want to pass parameters to
//the gadget, you can do so as shown below
.scope(this.$scope) //To pass the scope
.appspaceAlias("<APPSPACE_ALIAS>") // The alias of the appspace to launch
.launchAppspace();

If you want to pass parameters, create a variable as shown below before
calling the launchGadget method.
var params = {"KEY1":"VALUE1","KEY2":"VALUE2"};