共用方式為


Custom Control support in InfoPath (Part III - Node Binding)

Continuing (from Part II) on, we will discuss the third type of binding available to ActiveX controls within InfoPath. This one is called “Node Binding” (which corresponds to the “Field or Group (any data type)“ in the drop down of the custom control wizard).

What happens if you want your ActiveX control to interact with data that other parts of your form will interact with? For example, you want your ActiveX control to get and set data which a repeating table elsewhere also sets and gets from. Stream binding writes to a seperate namespace, so no part of the InfoPath solution will be able to interact with that data. Node binding in the solution for this. Node binding, as the name indicates, allows the ActiveX control to connect directly to the DOM. The ActiveX is passed in an IXMLDOMNode pointer and anything done by the ActiveX control gets reflected in the InfoPath form DOM. So this type of binding allows you to bind to any part of the DOM whether it be a leaf node, the root node, or anything in between.

As an example, let's say that you had a repeating table which has different values which you would like to graph. With a graphing ActiveX control, you could bind it to the same node as the repeating table. Then the chart control could pull the data and create a graph appropriately. Any changes to the repeating table would then get reflected in the graphs.

The only down side to this type of binding is that you will most likely have to write these type of controls yourself. With simple binding and stream binding, you may be able to find controls you can use out of the box, but controls that have a property for an IXMLDOMNode are very few.

This ends the three part series on the types of binding for custom controls in InfoPath. I hope this has been helpful. Please use the comment thing below if you have any questions or need any clarifications.

Comments