How to Show/Hide a section? - working variable? - InfoPath Dev
in

InfoPath Dev

How to Show/Hide a section? - working variable?

Last post 12-07-2009 10:30 PM by glogan. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-07-2009 07:46 PM

    • glogan
    • Not Ranked
    • Joined on 11-24-2009
    • Posts 6

    How to Show/Hide a section? - working variable?

    I want to use a checkbox to show or hide section on a form.  I have tested this by adding a field 'showDetails' to my datasource and setting it to True or False via a Checkbox located just above the Section. Then for the Section I created a rule which hides the section when showDetails = FALSE.  The problem is that in production, my main Datasource will be a Web Service to which will NOT be able to really add this working variable 'showDetails'.

    Is there some way (without resorting to scripting or programming, since this will be a browser form) that I can make a 'showDetails' variable available to my form (and not within my Web Service data source)?

    I tried defining it within a secondary XML data source, but XML appears to only allow retrieving data, and does not allow controls to update the data. So I can't check the checkbox if it is bound to an XML data source.

    Other appoaches to show/hide a section would also be welcome.  I'm not 'deleting' the section though, just hiding it.

     TIA. Gary.

  • 12-07-2009 08:14 PM In reply to

    Re: How to Show/Hide a section? - working variable?

     XML data sources are great for storing values that you don't want stored in the main data source and they certainly do allow controls to modify their values. Are you saying that a checkbox bound to a field in the secondary source is unclickable?  I'm not experiencing this behavior, though I am previewing my form in the InfoPath client and not in a browser.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-07-2009 09:31 PM In reply to

    Re: How to Show/Hide a section? - working variable?

    Hi Gary,

    Qdabra's free Hide-Show XTP uses secondary data sources to set data. Check it out: http://www.infopathdev.com/blogs/mel_balsamo/archive/2009/01/14/hide-show-section-template-part.aspx 

    Patrick Halstead
    Project Manager at Qdabra
  • 12-07-2009 10:24 PM In reply to

    • glogan
    • Not Ranked
    • Joined on 11-24-2009
    • Posts 6

    Re: How to Show/Hide a section? - working variable?

    Jimmy:

    ... Are you saying that a checkbox bound to a field in the secondary source is unclickable?  I'm not experiencing this behavior, though I am previewing my form in the InfoPath client and not in a browser.

    Yes, my checkbox is unclickable.  I'm an designing using the InfoPath Client 2007. I added the secondary data source as a "Create a New Connection to" ... "Receive data" of type "XML Document". For any field in my XML data source, if I put it on a form. It is disabled. Perhaps there is something wrong with my XML or how I defined the data source?

    Regards, Gary.

  • 12-07-2009 10:30 PM In reply to

    • glogan
    • Not Ranked
    • Joined on 11-24-2009
    • Posts 6

    Re: How to Show/Hide a section? - working variable?

    Ahhh !!!     It works now.

    I had stored my XML as empty tags.  When I added some dummy data to the stored XML, then the controls work properly. (My checkbox is now clickable.)

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.