InfoPath disappearing data - InfoPath Dev
in

InfoPath Dev

InfoPath disappearing data

Last post 02-21-2012 08:29 AM by Garrett. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-16-2012 09:50 AM

    InfoPath disappearing data

    Hi, I am new to InfoPath, and I am having an issue with a web-based form. I have a Rich Text Box that is in a repeating section that is
    bound to an XHTML field. This is not in the main/default view, and the user can submit the form from the main/default view and from the
    sub-view with this control in it. When the user adds more than one of these Rich Text Boxes to the form, the data that has been entered into
    the field isn't always saved. I have, however, never seen the first time not be saved.

    Scenario 1:
    user enters text into the Rich Text Box. Then clicks the submit button. The text in the first Rich Text Box keeps the user entered text as
    expected. The user then adds another field, enters text, and clicks submit. The form then saves, however, the newly entered text in the
    Rich Text Box sometimes changes to "", and sometimes the text in the Rich Text Box stays as the newly entered text as expected

    Scenario 2:
    After clicking submit and the data stays as expected, the user then wants to change the value that is in the Rich Text Box. The user enters
    new data in the Rich Text Box and presses submit. The form then saves, however, sometimes the text in the Rich Text Box changes back to
    the data that was there previous to the user's changes, and sometimes the text stays as the newly entered text as expected.

    This seems to be a random error. It sometimes happens on the second entered Rich Text Box and sometimes doesn't happen until the
    4th or 5th. This error doesn't happen when debugging the form in infopath. The code I am using to debug this issue is on the submit
    button clicked event.

    XPathNavigator domNav = MainDataSource.CreateNavigator();
    XPathNodeIterator rows = domNav.Select("/my:myTipLead/fxintakerequest:IntakeRequest/fusionx:AnalystNotes/fusionx:AnalystNote/fusionx:NoteText", NamespaceManager);
    while (rows.MoveNext())
    {
          EventLog.WriteEntry(ERROR_SOURCE, "node value = " + rows.Current.Value);

    }

    The event log show all of the times it acted as expected. When it fails to save the text entered, the event log has all of the previously entered Rich Text Box data and the newly entered Rich Text Box entry says "not value = ". I'm assuming that the text is never getting into the field. Any help would be much appreciated. Thank you!!

  • 02-17-2012 04:44 AM In reply to

    Re: InfoPath disappearing data

    If there is any other information that would help, I will be happy to provide it. I'm completely stuck on this problem. Thanks for your help

  • 02-17-2012 07:58 AM In reply to

    Re: InfoPath disappearing data

    I have now changed the Postback setting on the Rich Text Box to Always. With this new setting, here is what happens: The user enters text into the Rich Text Box and clicks submit. The Rich Text Boxes flashes off and then back onto the screen (I'm guessing because it's sending data to the server) but the submit doesn't happen. The user must press the submit button again for the submit to actually happen. I'm guessing that the data is only being sent to the server when the Rich Text Box loses focus. The interesting thing that happened was sometimes when the user would enter text into the Rich Text Box and press submit, the Rich Text Box would not flash and the submit would happen on the first click. The data would not be saved when this happens, and the newly created Rich Text Box would be empty no matter what the user entered. If anyone can help with this, I would really appreciate it. Thank you

  • 02-17-2012 08:23 AM In reply to

    Re: InfoPath disappearing data

    I'm sorry no one seems to be able to offer you any advice here - what you are describing seems to be odd (as well as somewhat complex).

    How is your form submitting? Via code or rules?

    If this were my form, I'd assume the issue was somewhere in the form logic - perhaps the code you've added for debugging is causing your new submit issue somehow. Is there other code in the form? What about rules that may be affecting the rich text box? Right click the field the rich text box is bound to, and look at the logic (rule) inspector. Anything there?

    Finally, what if you simply set up a test form with the basic scenario you are experiencing problems with? Don't add any code, and be careful of what rules you add - aim for the simplest structure that could allow you reproduce your issue. Does the issue reproduce?

    Hopefully this will help you troubleshoot.

    Hilary Stoupa

  • 02-17-2012 09:23 AM In reply to

    Re: InfoPath disappearing data

    Thank you for the reply. The form is submitting via code, but I believe the error occurs before the submit takes place. I put my debug code as the first line of the submit button being pressed in order to rule out any other code having an effect. I checked the windows log and sure enough it iterated through all of the successful ones and the last one said "node value = ". I'm confused as to why sometimes when iterating through, it gives me everything i've typed in, and other times the last one entered is blank.

    When I checked for rules on the Rich Text Box, there were none.

  • 02-21-2012 05:41 AM In reply to

    Re: InfoPath disappearing data

    I have now created a new view with a Repeating Section that allows the user to create duplicates of that section. This section has only a Rich Text Box in it. At the bottom of this form there is a button that writes the contents of the Rich Text Boxes to the windows log.

    Here is the code for this:

                XPathNavigator nav1 = MainDataSource.CreateNavigator();

                XPathNodeIterator iterator = nav1.Select("/my:myTipLead/my:TestingGroup/my:group4", NamespaceManager);

                while (iterator.MoveNext())
                {
                    XPathNavigator node = iterator.Current;

                    if (node.HasChildren)
                    {
                        node.MoveToFirstChild();

                        do
                        {
                            if (node.Name == "my:TestingRichTextBox")
                            {
                                EventLog.WriteEntry(ERROR_SOURCE, "node = " + node.Value);
                            }

                        } while (node.MoveToNext());
                    }
                }

    These are the only things on this form. After uploading the form to SharePoint and testing it, it failed on the 8th try.

    The output to the event log looked like this:

    node = 1...node = 1 node = 2...node = 1 node = 2 node = 3...node = 1 node = 2 node = 3 node = 4...node = 1 node = 2 node = 3 node = 4 node = 5...node = 1 node = 2 node = 3 node = 4 node = 5 node = 6...node = 1 node = 2 node = 3 node = 4 node = 5 node = 6 node = 7...node = 1 node = 2 node = 3 node = 4 node = 5 node = 6 node = 7 node =

    I underlined and bolded the last one where it failed. Every one of these is a seperate log entry as the code suggests, but I put it in this format as to not take up a huge ammount of space. I seperated each set with "...". This is the most simple form I could create that duplicated the problem. Again, this works perfectly in debugging, so I wrote to the event long to debug the code while in SharePoint. Thank you for your help

  • 02-21-2012 08:29 AM In reply to

    Re: InfoPath disappearing data

    I have changed the Rich Text Box to a regular Text Box, and the problem has gone away. It always updates correctly, however, the user wants the controls offered by the Rich Text Box. Any help is appreciated. Thank you!!

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