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/
> Hi,
>
[quoted text clipped - 3 lines]
>
> vbdev
gareth@ke.co.za - 02 Dec 2004 12:47 GMT
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!!
vbdev - 02 Dec 2004 14:18 GMT
Thanks for the detailed example......
vbdev
G. Tarazi - 02 Dec 2004 20:44 GMT
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.
> Thanks for the detailed example......
>
> vbdev