Hi,
Scenario:
I have an InfoPath form containing drop-down list box, bound to webservice -
InfoPath tries to populate the drop-down on startup. When the user goes
offline, webservice becomes unavailable, so I don't want InfoPath to
populate the drop-down list box automatically as the form opens. Instead,
the user should be able to fill the other data on the form and save it -
when online again, the rest of the data based on the drop-down list box
selection should be appended.
Question:
Is it possible to populate drop-down list box on demand via code (when
button is pushed), not automatically on startup?
Thanks in advance,
mac
S.Y.M. Wong-A-Ton - 25 Sep 2006 08:08 GMT
Yes. When creating the secondary data source to populate the drop-down list
box, deselect the checkbox "Automatically retrieve data when form is opened".
Then add a button and a rule on the button that queries the data connection
for populating the drop-down list box ("Query using data connection" rule).
Of course you could query the data connection through code too if you wanted
to by using something like (in JScript)
XDocument.DataObjects["<your_data_connection>"].Query();
which will populate the drop-down list box.
---
S.Y.M. Wong-A-Ton
> Hi,
>
[quoted text clipped - 13 lines]
> Thanks in advance,
> mac
mac - 25 Sep 2006 08:31 GMT
Thanks again, that's what I was looking for!
mac
> Yes. When creating the secondary data source to populate the drop-down
> list
[quoted text clipped - 32 lines]
>> Thanks in advance,
>> mac
S.Y.M. Wong-A-Ton - 25 Sep 2006 09:07 GMT
No worries. :)
---
S.Y.M. Wong-A-Ton
> Thanks again, that's what I was looking for!
>
[quoted text clipped - 36 lines]
> >> Thanks in advance,
> >> mac