The Case Information widget has an option for its Case Document view where you can specify whether to view documents in the Viewer widget or always view them in a popup window and don't send the document event to the viewer.
In this use case, we want to support both; a normal view displays the document in the Viewer widget, but an alternate "open in popup" command from the More Actions menu or right-click menu allows the user to pop up a new window and leave it around for reference.
The first step for this is adding a custom menu to the Case Information Documents panel.
- Go into Edit Page mode
- Edit the Case Information widget's setting by selecting the Edit Settings item from the widget's menu.
- Click to the Documents tab
- Add a custom menu item like "Open in Popup" and give it an event name like "doOpenDoc"
- Add a hidden Script Adapter widget and wire its inbound event to your new doOpenDoc event which now shows up as an available wiring option
- Enter the following JavaScript into the Script Adapter, replacing the "myServer" and "TOS01" with you server name and target object store name (note: you can prevent hard-coding of this by using some of the client Javasript APIs
var url = "https://myServer/WorkplaceXT/getContent?objectStoreName=" + ecmwdgt.getBean("spaceConfig").getTargetOS() + "&id={" + payload.systemProperties.id+"}&objectType=document"; url = url.replace("idd_", ""); newwindow=window.open(url,payload.systemProperties.docName,'height=500,width=600');