How can I switch views based on combo box value? - InfoPath Dev
in

InfoPath Dev

How can I switch views based on combo box value?

Last post 09-01-2011 09:11 AM by Jimmy. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-01-2011 05:13 AM

    How can I switch views based on combo box value?

    I have a view with a combo box. When a value is selected from that combo box I need a particular view to load. so if value 1 then load view1 if value 2 then load view2 etc I tried using rules, but switch view is not available for a combo box. I assume some code is needed. Pls advise Thanks
  • 09-01-2011 07:11 AM In reply to

    Re: How can I switch views based on combo box value?

    Even with code, you can't switch views on a field Changed event.  Why not provide a button next to your dropdown to switch the view accordingly?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2011 07:17 AM In reply to

    Re: How can I switch views based on combo box value?

    Thanks for the reply. Yes I managed to do that. I use the combo to set a value in a text box (1,2) and then the button shows the view depending (via rule and condition) on the choice. Another problem arises when I submit the view to Sharepoint - it seems to pick up the original view - one with the combo and not the view I am currently on.
  • 09-01-2011 07:50 AM In reply to

    Re: How can I switch views based on combo box value?

    So you know - you aren't submitting a view, but the form data. And the form is going to open with its default view unless you have rules in place to do otherwise. In your form loading rules you can set a rule to switch views - and have conditions to switch to the correct view based on your combo box value.

    Hilary Stoupa

  • 09-01-2011 08:18 AM In reply to

    Re: How can I switch views based on combo box value?

    Thanks Hilary - that seems to work. The only issue is that one cannot seem to a different data connection for each view. My sharepoint has two document libraries and I wanted each view to go to the relevant one. I notice when I set a data connection on one view it is replicated on the other view and is not changeable.
  • 09-01-2011 08:25 AM In reply to

    Re: How can I switch views based on combo box value?

    You'll need two data connections - show the results of one in one view and the results of the other in the other view. If that's what you are trying to do? Just display some secondary data in each view?

    Hilary Stoupa

  • 09-01-2011 08:40 AM In reply to

    Re: How can I switch views based on combo box value?

    Hello,

    just an additional note...you can switch view based on a combo box value...

    Please look here for the way to accomplish this:

    http://basquang.wordpress.com/2009/06/15/infopath-drop-down-list-changed-switch-view/

    Regards,

    Karsten
  • 09-01-2011 09:11 AM In reply to

    Re: How can I switch views based on combo box value?

    It's true that that approach is able to change the view without the use of a button, but the ContextChanged event (and resultingly, the view change) will not happen until the user tabs away from the dropdown or clicks another control.  You're better off using a button than having the form exhibit that kind of strange behavior.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.