Page tree

Versions Compared

Key

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

...

Code Block
akioma.launchExternalScreen({
      autostartObjects: 'DocViewerFrame',
      baseLayoutObject: 'AkiomaMainLayout',
      screen: {
           width: 900,
           height: 700 
      }
});


The most important basic attributes are the baseLayoutObject and autostartObjects, the name of the layout and the initial auto starting object in layout(desktop). 

The baseLayoutObject default is read from the sessionData.baseLayoutObject property if it hasn't been specified in the attributes.

Besides the baseLayoutObject and autostartObjects, there is an option to specify the initial size and position of the popup using the "screen option as parameter to the method" object parameter.

Note: When using the method to launchExternalScreen if the popup is already opened it will emit a "launchContainer" socket event, that means it will not open a new popup but try to use the existing one for launching.

...

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


Websocket 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.

...

refreshScheme - event for triggering refresh data in external screen


Prompting the HasChanges Dialog in ExternalScreens

External screens can also have changes that are bound to a secondary external screen.

In this use-case it is possible to programmatically prompt the user with the has changes dialog by adding an EventBeforeSelect on the corresponding Grid object.

In the EventBeforeSelect it is required to return a payload object with the setting "promptCursorChange" set to true. This will block the record selection and prompt the user with the Has Changes dialog.

The getExternalPopup method from the ExternalScreen class can be used to retrieve the ExternalScreen window object based on provided screenNamespace used when launching the External Screen Popup.

Example:

Code Block
titleEventBeforeSelect on DataGrid to display HasChanges Prompt
linenumberstrue
/**
* Method to execute before row selecting to display ExternalScreen hasChanges prompt 
* @param grid 
*/
export function onBeforeGridRowSelect(grid: akioma.swat.Grid) {
    const payload:any = {};
    const DocviewerExternalScreen = akioma.ExternalScreen.getExternalPopup('sDocViewerExternalWindow');
    const hasChangesExternal:boolean = DocviewerExternalScreen.akioma.swat.Root.getFirstChildByType('businessEntity').hasChanges();
        
    if(hasChangesExternal) {
        payload.promptCursorChange = true;
    }

    return payload;
}