Task Pane issues - InfoPath Dev
in

InfoPath Dev

Task Pane issues

Last post 09-25-2005 04:59 PM by Mik. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-15-2005 06:24 PM

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

    Task Pane issues

    I am still battling with this task pane, but I have a new problem.
    At the moment, only half of the fields are availible on the form, so I can use specific node names for now on each section (which puts my other problem on hold) my current problem is that the code used references an ID of a html element in the task pane that is the same as the node name, but there is no div id associated with my section names, or my labels.
    Is there a way to provide an error checking on this to say "if that id does exist" so that i may put it in than if statement to avoid errors on the form.

    here is the code again (yes its a copy-paste from an MS lab):

       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;
       }


    note that "helpString" is a global variable
  • 09-16-2005 01:01 PM In reply to

    Have you tried using the HTML DOM method: getElementById()

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 09-20-2005 04:20 PM In reply to

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16
    Yes, but thats the other side of the problem.
    I can reference HTML elements by their id, thats no problem, but I had multiple nodes of the same name in different locations (groups) so i was looking for a way to gather the xpath expression of a node so that i may use that to reference the html element id, rather than use the node name (as there were multiple)

    The other place this would come in handy is if you have 20 fields all refering to the same help id. If they were in the same group, and you could get the xpath expression, you could simply use the xpath structure as the html ids.

    I have done a workaround for now, but it has repeating information in the html and i would like to clean it up.

    Thanks
  • 09-25-2005 04:59 PM In reply to

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16
    I cannot believe the object model has no way of outputting the xpath of a node.
    Thats all I am asking for, if anyone knows of how to do that.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.