OnContextChange Code - InfoPath Dev
in

InfoPath Dev

OnContextChange Code

Last post 01-03-2008 06:53 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-02-2008 10:03 PM

    • tarmon
    • Not Ranked
    • Joined on 01-03-2008
    • Posts 1

    OnContextChange Code

    Hey Everyone,

     

    I am wanting to write something that will allow me to change an image within my form depending on what text box control they have selected.  I want to have my picture control be a link also. I am not really sure how to do this at all and if some one could at least get me started it would be much appreciated.

    Thank you,

    Tarmon
     

  • 01-03-2008 06:53 AM In reply to

    Hi Tarmon and welcome to the forums!

    Here's how I would do it:

    1. Create a repeating structure (probably in a 2DS) with a Base64 node for each image, and a text node for the URL of the location that you want to go to when it is clicked.

    2. Create another node called "CurrentContext" in a 2DS.

    3. Mentally number all of your textboxes from 1 to n.

    4. In OnContextChange() update the value of CurrentContext to be the designated integer value that you have establised.

    5. Place the repeating structure that has the pictures in it on the view as a repeating section.  Then, add conditional formatting that only displays the row where position() = CurrentContext.  Also, be sure to enable your image as a hyperlink pointing to the node with the URL in it.

    Hope this helps, good luck!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.