Custom Task Pane - InfoPath Dev
in

InfoPath Dev

Custom Task Pane

Last post 09-13-2005 08:48 PM by Mik. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-13-2005 08:48 PM

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16

    Custom Task Pane

    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
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.