Hi, Can you call managed code from the taskpane? If yes how? Thanks vbdev
V vb6dev2003 Dec 1, 2004 #1 Hi, Can you call managed code from the taskpane? If yes how? Thanks vbdev
M Matthew Blain \(Serriform\) Dec 1, 2004 #2 The "extension" object lets you do this. However, your solution needs to be fully trusted. --Matthew Blain http://tips.serriform.com/ http://www.developingsolutionswithinfopath.com/
The "extension" object lets you do this. However, your solution needs to be fully trusted. --Matthew Blain http://tips.serriform.com/ http://www.developingsolutionswithinfopath.com/
G gareth Dec 2, 2004 #3 Yep, This example (in C#) inserts data from the taskpane (a selected table row) into the InfoPath document: 1) Create this function in your FormCode.cs file: public void InsertLoanSchedule(double TotalMonthlyPay, double TotalLoanAd) { //Add your code here to update xml nodes in xDocument } 2) In your taskpane htm file add the following function (in the script tag): function InsertLoanData(objLoan) { window.external.Window.XDocument.Extension.InsertLoanSchedule(objLoan.TotalMonthlyPay, objLoan.TotalLoanAd); } 3) Call the function from your html item (eg table row) - a double click event in this example: <tr id="item6" TotalLoanAd="3500.00" TotalMonthlyPay="169.7" AnnualRate="15" onDblClick="InsertLoanData(this)"> <td unselectable="on" width="109">3500.00</td> <td unselectable="on" width="412">169.7</td> </tr> Voila!!
Yep, This example (in C#) inserts data from the taskpane (a selected table row) into the InfoPath document: 1) Create this function in your FormCode.cs file: public void InsertLoanSchedule(double TotalMonthlyPay, double TotalLoanAd) { //Add your code here to update xml nodes in xDocument } 2) In your taskpane htm file add the following function (in the script tag): function InsertLoanData(objLoan) { window.external.Window.XDocument.Extension.InsertLoanSchedule(objLoan.TotalMonthlyPay, objLoan.TotalLoanAd); } 3) Call the function from your html item (eg table row) - a double click event in this example: <tr id="item6" TotalLoanAd="3500.00" TotalMonthlyPay="169.7" AnnualRate="15" onDblClick="InsertLoanData(this)"> <td unselectable="on" width="109">3500.00</td> <td unselectable="on" width="412">169.7</td> </tr> Voila!!
G G. Tarazi Dec 2, 2004 #5 Another way, if you can't have the form fully trusted, create an event handler on a node inside InfoPath (managed code), and change the value of the node from the task pane (the script), that will trigger the managed code in the event handler.
Another way, if you can't have the form fully trusted, create an event handler on a node inside InfoPath (managed code), and change the value of the node from the task pane (the script), that will trigger the managed code in the event handler.