Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sending custom data in External Screen and options

If required to read custom data inside the external screen, the custom data can be specified in the launchExternalScreen options.

...

Code Block
const ExternScreenOpts = {
	launchContainer: WindowName,
	baseLayoutObject: 'AkiomaDocviewerMainLayout',
	autostartObjects: 'mainDesktopDocViewerW',
	name: 'DocViewer',
	screenNamespace: WindowName,
	custom: {
		stamm_id: cStammId,
		id: oWin.opt.id
	},
	onBeforeScreenUnload: () => {
		// close the linked
		akioma.ExternalScreen.popups.forEach(popup => popup.close());
	},
	onBeforeScreenLoadClosed: () => {
		for (var i in akioma.oWindowsParentCell.childs) {

			var win = akioma.oWindowsParentCell.childs[i];

			if (win.opt.name === 'sStammDetailWindow') {
				var oRibbon = win.getDescendant('ribbon');
				oRibbon.enableItem('StammDossierExternalWindow');
				oRibbon.enableItem('StammDossierExternalDocumentWindow');
			}
		}

		akioma.VuexStore.dispatch('taskbar/clearAllExternalScreens'); // remove header color for all externalScreens opened from taskbar
	};
};

ExternScreenOpts.onBeforeScreenUnload = () => {
	// close the linked
	akioma.ExternalScreen.popups.forEach(popup => popup.close());
};
	

akioma.launchExternalScreen(ExternScreenOpts);


Above you can see an example of sending the custom data inside the "custom" property value of the params.

The user can also specify the "launchContainer" name. The screen that will be launched when the popup is already opened via websocket events.

It is also possible to specify the "onBeforeScreenUnload" callback, that will be called before the popup is unloaded or if the main opener window is unloaded.

The "onBeforeScreenLoadClosed" event callback is called before the screen loads if it has been closed.


Websocket Events on Docviewer:


Below we have the list of most recent Docviewer events that can be handled via callback by using the callback method setters from the ExternalScreen class.

launchContainer - event triggered from launchExternalScreen if already opened and launchContainer param is specified

refresh - event triggered to handle layout visibility in External Screen. (eg. clearing screens, expanding panels etc.)

activeWindow - event triggered on taskbar item selected or window in focus changed

closeExternalWindow - event triggered when a window is closed

refreshScheme - event for triggering refresh data in external screen