performing two SwitchViews

R

Roland

hi all

i have an IP form containing several views. i also have a custom
taskpane that provides the user navigation around all these views.
upon completion, the user then submits the form to a web service for
processing.

the consumption of the form data by the web service can take a long
time, particularly with large amounts of data. in order to make this
process friendlier for the user, i want to temporarily switch to a
simple "Please Wait" view for the duration of the long operation, then
switch back to the previous view.

however, if two SwitchView command are issued in succession, IP throws
the "InfoPath cannot execute any view-related object model calls. The
view is not ready." error.

i have tried using a deferred switching method, whereby the user's
submit action first sets a global boolean variable to true, then
switches to the "Please Wait" view. then in the OnSwitchView event,
the global variable is checked and if true, performs the submits to
the web service, then attempts to switch back to the previous view.

i figured that isolating the two SwitchView calls this way may have
worked, but it causes exactly the same error.

i'd really like to be able to provide this UI enhancement.

is there any way at all that i can achieve calling SwitchView,
performing a long operation, and then calling SwitchView again?

thanks
roland
 
B

Brian Teutsch [MSFT]

You can't call SwitchView twice within the same business logic call. What is
the reason you're trying to do two switches, instead of just having logic to
go directly to the final view? Perhaps we can help you rework your scenario
to get the end goal without using two SwitchView calls.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top