Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2006

Tip: Looking for answers? Try searching our database.

Populate Drop-Down List Box on Demand (via code)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mac - 25 Sep 2006 07:45 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.