Changing Views - InfoPath Dev
in

InfoPath Dev

Changing Views

Last post 03-29-2005 03:44 PM by Greg Collins. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-16-2005 10:53 AM

    Changing Views

    I am trying to change views twice. The first change view occurs at when the user clicks on a print button. The view switches to the particular print view and then through jscript(using.PrintOut()) the form prints. Then I try to change the view in the script using the .SwitchView("") and I get an error: InfoPath cannot execute any view-related object model calls. The view is not ready.

    I imagine I have forgotten to add something but for the life of me...

    Please provide insight to what I need to do to have the view return to the default once the form has printed?

    "One Line at a Time" - anonymous codeaholic
    Greg McAllister
  • 03-16-2005 12:46 PM In reply to

    I think what you are doing is
    1. First switch to the print view as a rule on the button
    2. Then in the onclick function PrintOut() happens
    3. At the end of the onClick function you are doing a switch view back to the main view

    This problems seems to be solved when when the first switchView() is also called in the code instead of calling it as a rule.

    Do i have the issue correctly? or are you doing something different?

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 03-17-2005 02:57 PM In reply to

    You are correct but I have tried the combination you suggested and get the same error when it tries to switch back. Thanks fo trying - any other possibilities?

    "One Line at a Time" - anonymous codeaholic
    Greg McAllister
  • 03-28-2005 10:05 AM In reply to

    Did this problem get solved? If not, can you paste your code in here. This code is being run onClick of a button correct?

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 03-29-2005 03:44 PM In reply to

    InfoPath does not allow you to switch views, during a view switch. You may not think you are doing that, but you likely are (so far as InfoPath is concerned).

    Greg Collins [InfoPath MVP]
    InfoPathDev
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.