rich text boxes in a repeating section between views - InfoPath Dev
in

InfoPath Dev

rich text boxes in a repeating section between views

Last post 03-01-2012 08:20 AM by Garrett. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-29-2012 12:40 PM

    rich text boxes in a repeating section between views

    I have a Rich Text Box inside of a Repeating Section, and the Repeating Section is inside of an Optional Section. There is a submit button at the bottom of the form and a back button at the top of the form to get back to the main form. If I go into the form and create a section and enter text into the rich text box and press submit, everything works as expected. If I then go back to the main form and then back into the sub-form, create another section, enter data, and press submit, the newly entered text will disappear. I will be left with a blank Rich Text Box. I did the process of going back to the main form, going to the sub-form, entering another section, entering text, and pressing submit 20 times. Each time the newly entered text disappeared, and I was left with a blank Rich Text Box. I have elimated anything that has to do with the submit process because I wrote debugging code right after the submit button is pressed that iterates through each section and gets the entered text. If i entered "1" into the first Rich Text Box and then tried to enter "2" into the second text box, The output would read "Rich Text = 1" "Rich Text = ". So InfoPath knows that there are 2 sections but doesn't record the text of the second Rich Text Box. The thing I found odd and the reason I'm posting this here is that it worked perfectly in the InfoPath debug. I only see the problem after the form has been published to SharePoint 2010. Any help would be greatly appreciated. Thanks!

  • 02-29-2012 01:30 PM In reply to

    Re: rich text boxes in a repeating section between views

    I have a few follow up questions so that I understand your scenario correctly:

    • You say go back to the "main form" after submit.  So does that mean these rich text boxes are on separate templates (XSNs)?  Or is this one form template with multiple views?
    • This problem only exists in the browser after you publish?  It works fine when you preview the form on the client?
    • Is the expected behaviour that the rich text box after you submit should contain the data that was submitted and not be blank?
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-01-2012 05:24 AM In reply to

    Re: rich text boxes in a repeating section between views

    • This is one XSN with multiple views.
    • The problem only exists when viewing the form in SharePoint after it has been published.
    • The expected behavior would be for the rich text box to retain the text typed in by the user after a submit. No matter how many rich text boxes the user creates, they should all retain the text entered by the user.

    Thank you for your help. I would be happy to supply any other information that may be helpful. Thanks!

  • 03-01-2012 07:14 AM In reply to

    Re: rich text boxes in a repeating section between views

    Double check that your second rich text box is submitting to the correct field.  If the value is simply disappearing, there also may be some on submit rules that are clearing the value inadvertently.  Typically on submit, if the form doesn't automatically close then all the data will stay where it is, so there might be something happening in the rules.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-01-2012 08:20 AM In reply to

    Re: rich text boxes in a repeating section between views

    I have created another view in the XSN that doesn't have a submit button. The only thing it has on it is a back button at the top that goes to the main form, a Rich Text Box inside of a repeating section in the middle, and a button at the bottom that writes output to the windows log. I duplicated the same failure procedure (entering text and pressing the button, back to main form, going to sub-form, creating another section, entering text, and pressing the button). Around the 6th or 7th time, the text in the newly created rich text box disappears. Here is the only code that is on the button at the bottom of the form. It iterates through the group that the Rich Text or XHTML field is in, and prints all of the values to the windows log. On the one that disappears, there is an entry into the event log that reads "rich text = ". This tells me that the count in "group2" is accurate. "group2" is the folder that is associated with the repeating section that the Rich Text Box is in. It knows that there is a newly created section in the repeating section, but the value of "testingRichTextStuffs" is "".

                try
                {
                    XPathNavigator nav1 = MainDataSource.CreateNavigator();

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

                    while (iterator.MoveNext())
                    {
                        XPathNavigator node = iterator.Current;
                        node.MoveToChild("testingRichTextStuffs", node.NamespaceURI);
                        EventLog.WriteEntry(ERROR_SOURCE, "rich text = " + node.Value);
                    }
                }
                catch (Exception exce)
                {
                   
                    WriteToLog("there has been an error");
                }

     

    Thank you for your help

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