Problem Hiding Image Control in Optional Section - InfoPath Dev
in

InfoPath Dev

Problem Hiding Image Control in Optional Section

Last post 05-04-2011 05:28 AM by nollaig. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-03-2011 09:33 AM

    Problem Hiding Image Control in Optional Section

    I have an Ink Picture Control that sits in a Optional Section and I have a button and a hidden textbox that I use to show/hide the section that the ink picture sits in. When the button is pressed I set the value of the hidden field to either 1 or 0 and depending on this value in the hidden textbox I hide the section. It seems to work fine for showing & hiding a textbox control but not an Ink Picture control.

    Also, If I manually type in 1 or 0 into the hidden field and click out of the field it seems to work fine.

    Does anyone know if this is a bug in Infopath??

     

    Cheers.

  • 05-03-2011 09:48 AM In reply to

    Re: Problem Hiding Image Control in Optional Section

    Do you need the button to do this? I went with a checkbox control. If false hide, if true so and I placed it into a section as opposed to an optional control.

    Kind regards,
    Larry
  • 05-03-2011 11:57 PM In reply to

    Re: Problem Hiding Image Control in Optional Section

    Yea need a button because want to show either "+" or "-" depending if the section is hidden or showing.

    Also, it needs to sit in an optional section as the data collected is optional.

    Any ideas?

  • 05-04-2011 04:27 AM In reply to

    Re: Problem Hiding Image Control in Optional Section

    can you post a sample of what u have? i'll take a look and see if anything was missed.

    Kind regards,
    Larry
  • 05-04-2011 05:28 AM In reply to

    Re: Problem Hiding Image Control in Optional Section

    Larry,

     Managed to find the problem.

    I have an Optional Section that contains some textbox controls and I also had a Ink Picture control. I wanted the Ink Picture to be quite large so I put it and a textbox into a new Section inside the Optional Section and placed a button and hidden textbox just outside the new Section (but still in the Optional Section). I put some rules in place on the button click to set the value of the hidden textbox and rules on the new Section to show or hide depending on the hidden textbox value.

    When the form loads initially I have a link to add a new "Optional Section" and when this is clicked the Optional Section is added along with its controls, including the button and new Section with the Ink Picture and textbox.

    If I click the button to hide the new Section with the Ink Picture and textbox it hides fine.

    If I click the button again the new Section shows and textbox is shown but the Ink Picture doesn't show. It looks as if the Ink Picture is not being loaded correctly as the Ink Picture toolbar option is displayed.

    If I change the Optional Section to a normal Section the functionality works fine but as I need to have the Optional Section the only way around this is to move the button and hidden textbox outside the Optional Section.

    As a result of this I have to hide the button if the Optional Section is not present.

    Anyway this is my work-around. If you understand what the initial problem is and know of a better way to solve this please let me know.

     

    Cheers.

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