简体   繁体   English

如何异步将项目加载到InfoPath表单中?

[英]How to load items into InfoPath form asynchronously?

In my Infopath 2013 form I have a drop-down list, which is populated from code. 在我的Infopath 2013表单中,我有一个下拉列表,该列表由代码填充。 Data is downloaded from WCF service. 数据是从WCF服务下载的。 The problem is, that service is so slow, loading of form takes too long (over 30 seconds). 问题是服务太慢,表格加载时间太长(超过30秒)。 My code is currently in FormEvents_Loading event. 我的代码当前在FormEvents_Loading事件中。 I was wondering, if there is any way to load data asynchronously after the form is loaded and shown. 我想知道,是否有任何方法可以在加载并显示表单后异步加载数据。

First try was to simply create a Task , but it seems to be not available in Infopath. 最初的尝试是简单地创建一个Task ,但它似乎在Infopath中不可用。

So, the problem is: what can I do, except from creating a "click to load" button, to improve loading time of form? 因此,问题是:除了创建“单击以加载”按钮外,我还能做什么,以缩短表单的加载时间?

As far as I know, You cannot do this. 据我所知,您不能这样做。 I have tried doing this myself, also to address long load times. 我自己尝试过这样做,也解决了较长的加载时间。

Any data source that is providing the items for a UI item (a drop-down, in your example) must be loaded in the FormEvents_Loading method. 提供UI项目(在您的示例中为下拉菜单)的项目的任何数据源都必须加载到FormEvents_Loading方法中。

This was the case for InfoPath 2007, and I have no reason to suspect it has changed since, though I have not checked. InfoPath 2007就是这种情况,尽管我没有检查,但我没有理由怀疑它已经更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM