While looking for a solution for infopath offline support, I came by the
DataInterop sample in the SDK (http://msdn.microsoft.com/library/en-
us/ipsdk/html/ipsdkRetrievingCreatingRecordsDataInt_HV01082955.asp?
frame=true#). Looking at the JS code in the form, it looked like it's
pretty straight forward. The sample has a group OfflineData in the main
data source that is supposed to cache the secondary data source when going
offline. What worried me right away is that this node is just a group, with
no fields inside, unlike the actual secondary datasource. However I stuck
with their solution, and after some customization for my own prototype, I
got the infamous exception "Element [long thing for dfs]:myFields is
unexpected accordint to the content model of parent element [long thing for
my]:nameOfMySecondaryDataSource" when attempting to go cache the secondary
DOM. This exception occurs on the following line:
objOfflineDataNode.parentNode.replaceChild(objNewOfflineDataNode,
objOfflineDataNode);
This problem has risen a few times on this forum, yet no solution has been
expressed. I have never even tested out the SDK, assuming what they post
there will work. However it is beyond me how they replace a node that
appears just as a group with nothing inside in the main connection with a
group that has tons of stuff inside in the secondary data source.
Anton L - 27 May 2005 18:19 GMT
If anybody is interested, I think I found a potential source for solving
this problem: http://www.mcse.ms/message505043.html
However, while applying their solution to my case doesn't throw the
exception anymore, it seems to freeze up Infopath. However this might be
just because the secondary datasource that I'm trying to cache is a few
MB...