troubleshooting Question

Infopath2003 and Repeating table

Avatar of madheeswar
madheeswarFlag for Singapore asked on
XMLJavaScript
5 Comments1 Solution985 ViewsLast Modified:
Hi Experts,
I am still understanding InfoPath 2003.

But as the time is limited to deliver, I do have a question.

Please consider this as urgent.

I have a repeating table and in that fields are vendor and vendorproduct.
If vendor is selected, products related to vendor need to be displayed in VendorProduct drop down list using .Net web service.

So I wrote onAfterChange code for Vendor...

Code:
function msoxd_my_Vendor::OnAfterChange(eventObj)
{
// Write code here to restore the global state.
var oNode = eventObj.Source;
var oNodeParent = oNode.parentNode;
if (eventObj.IsUndoRedo || eventObj.Operation != "Insert")
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}

// A field change has occurred and the DOM is writable. Write code here to respond to the changes.
var nodeDataSource = XDocument.DataObjects.Item("GetVendorProductSchema");
nodeDataSource.DOM.setProperty("SelectionNamespaces", "xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-25T07:59:20' xmlns:tns='http://slmt.abc.com' xmlns:dfs='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution' xmlns:xd='http://schemas.microsoft.com/office/infopath/2003'");
nodeDataSource.DOM.selectSingleNode("//dfs:myFields//dfs:queryFields//tns:GetVendorProductSchema//tns:strSelectedVendor").text = eventObj.Source.text;
XDocument.DataObjects.Item("GetVendorProductSchema").Query();
}

The above works fine if there is a single row. If I add another row while data entry, the value selected in Vendor Product in row 1 is lost. since the value for vendor is different in row2. it displays products related to row2.
I don't have any Rules for Vendor or VendorProduct.
But for VendorProduct I have List Box entries set to 'Lookup values in a data connection to a database, Web Service.....'
Data Connection name is "GetVendorProductSchema"
Entries: /dfs:myFields/dfs:dataFields/tns:GetVendorProductSchemaResponse/tns:GetVendorProductSchemaResult/NewDataSet/Table/PRODUCT_NAME
value: .
Display Name: .

I hope I made myself clear. if you have any queries on the above, do let me know.

Another question is how to display a html/.xsn file in a modal dialog box on click of a button.
PageEditor:
if I am posting this question in a wrong session, please move it to respective TA.
thanks in advance.
-maddy
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 5 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 5 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004