I am currently setting up a context-sensitive task pane in one of my forms using Jscript.
I have read and understood how to do this with div tags in the HTML and code on the On Context Change event (as per M$ lab 14)
Thats all working fine, but its not exactly what i require.
In my application of it, there is one help for one group, which may contain many groups.
Here is the script in my form:
var helpString = null;
function XDocument::OnContextChange(eventObj)
{
if (eventObj.Type == "ContextNode")
{
// Retrieve task pane object
var oTaskPane = XDocument.View.Window.TaskPanes.Item(0);
// Retrieve html object for task pane
var oHTMLDoc = oTaskPane.HTMLDocument.all;
// Clear previous help topic from task pane
if (helpString)
oHTMLDoc.item(helpString).style.display="none";
// Display DIV statement having same ID as the context node name
oHTMLDoc.item(eventObj.Context.nodeName).style.display="";
// Keep record of string displayed, so can later be cleared
helpString=eventObj.Context.nodeName;
return;
}
}
As I have worked out "eventObj.Context.nodeName" is the name of the node, which is referencing the id of the div statements in the html.
I have set each of the groups up, so if I could get the XPATH expression of the node (instead of just the name) I could find its location and display that associated div content.
Can anyone help me output the XPATH from eventObj.Context
And then does anyone know how I could strip the first group off the front of that (which i assume would be relatively easy with string functions, but cant hurt to help)
Thanks