Question

I want to design an infopath form in which there is a repeating table. This table gets data loaded into it on form load using a web service (to receive data). the thing is that user must be able to modify this data and send it back to the server on form submit using another web service (to submit data).

Now I need something like multiple bindings so that the control is bound to to the web service data source to receive data, and also to the form data source in order for the other web service (submit) to send the form data to the server.

I tried to do this with a single value control (not repeating value) and I managed to do that by binding the control to a form data source field and setting the default value of the field to my web service (receive) field. But I can not do that for a repeating table because each time the form loads, I get a table with one row (no matter how many rows the web service returns), filled with the data of the first row returned by the web service, and clicking add row button would result in another row with the same data of the first row.

please help me. thanks.

Était-ce utile?

La solution

I found the solution myself. I have to put a repeating table on the form and bind it to a form field. With the web service data source to pull data, I add some code behind to the form load event to set value of the field (which is bound to repeating table) with the data I pulled from web service data source. The code is pretty simple and you can find a lot of threads demonstrating that.

In my case, it was a sharepoint site which I wanted to deploy the form to. There are difficulties to deploy an infopath form with code behind to a sharepoint site. "Nader" has a really useful post with an step by step procedure for doing this: http://nader.elshehabi.com/2011/08/how-to-really-deploy-infopath-2010-forms-with-code-behind-as-a-feature/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top