persisting checkbox status - InfoPath Dev
in

InfoPath Dev

persisting checkbox status

Last post 01-13-2009 07:03 AM by maxpirate. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-11-2009 09:47 AM

    persisting checkbox status

     Hi, i'm a beginner in infopath 2007. I have a task of showing a list of checkboxes with corresponding labels from a secondary data source which i have done but once the users selects various checkboxes and submit the form to the share point, the form when opened in the sharepoint site does not have the selected check boxes since it again accesses the secondary data source while opened in the sharepoint site. To over come that ive used c# code to copy the contents of the secondary data source to main data source in the loadingevent of the form(this had overcome the previous problem), but when the form is opened again the secondary data source is copied again to the main data source.. To overcome this i used a simple if condition which will copy the contents only when the rows of the main data source is lesser than the rows in the secondary data source.. but when the form is opened again, even if the if condition fails, the datasource is copied.

    How can i overcome the problem???

  • 01-11-2009 01:45 PM In reply to

    Re: persisting checkbox status

    Do you have the controls in your view bound to the main data source now? I'm thinking from your description, that you initially had the controls bound to the secondary data source. If that is the case, the view will always show the secondary data source values instead of the main data source.

    If your 'if' condition is structured correctly, your code to copy the data from one source to another should not be running. If you believe it is, you could do something simple like pop up a message box in the code in the 'if' condition, and then open one of your submitted forms, see if the message box pops up....

    Hilary Stoupa

  • 01-12-2009 07:12 AM In reply to

    Re: persisting checkbox status

     now i have sorted out the 'if' condition and code works fine.. is there a way to persist the checkbox status without copying the source.. ??

  • 01-12-2009 08:59 AM In reply to

    Re: persisting checkbox status

    If your checkbox is associated with a secondary data source, it will display the current state of the records in the secondary data source each time it is queried. Since you most likely have set the query to run when the form opens, that means each time you open it, the form will display the most recent state of those secondary data source records, regardless of any activity taken by the user the last time the form was open. You see, secondary data source information isn't stored in the xml file that is created when we fill out the form -- only information in the main data source. So, unless you submit user changes in the form back to the secondary data source, the changes will not 'persist' unless you have copied the data into the main data source. Does that make sense?

    Hilary Stoupa

  • 01-13-2009 07:03 AM In reply to

    Re: persisting checkbox status

     yes i understand. Now i have written a c# code even for copying a repeating group within another repeating group which i get from a secondary sourec.

     

    Thanks for replying

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