Determine which graphic is loaded in the onload event of workplace panel layout
Answers
Select the workplace panel layout your are going to modify or create a new one. In the workplace panel layout, XML tab, make an additional pane
<PANEL>
<PANE id="Panel"
Mode="base"
contentMode="panes"
paneLayout="columns">
<PANE
id="StartupPane"
name="BasePane"
Height="*"
width="80%"
startupdisplay="true"
ViewClass="GraphicDisplay"
scroll="No"
contentMode="aspectview"
Mode="pane"
src="">
</PANE>
<PANE
id="PFC"
name="PFCPane"
Height="*"
width="20%"
startupdisplay="true"
ViewClass="PFCView"
scroll="No"
contentMode="aspectview"
Mode="pane"
ChangeMode="locked"
src="">
</PANE>
</PANE>
</PANEL>
in the workplace panel layout, Panel XSL tab, add the function you want to run when the main panel loads:
function panelLoad()
{
try
{
var curAspect = document.getElementById("BasePane").ABBContent.Aspect.Name;
if(curAspect != null) {
switch (curAspect) {
case "AA100": {document.getElementById('Panel').setAttribute('cols', "80%,20%", 0); }
break;
default: {document.getElementById('Panel').setAttribute('cols', '100%,0%', 0); }
}
}
}
catch(x) { alert("panelLoad failed"); }
}
add the following to the existing function.window.onload():
<!--attach callback event to the main panel loading-->
var content = document.getElementById("BasePane").ABBContent;
if(content != null) { content.attachEvent("onViewLoadStateChange",myFunction); }
This will fire the panelLoad function every time the main panel reloads and resize the panels depending on the name of the currently loaded aspect.
Add new comment