0

I've got a slightly complex InfoPath 2007 form that will act as a web page for my users.

The customer has set a requirement that there be a basic form of a "comments" section in the page, such that when necessary someone can enter a comment, hit save, and this will be stored for viewing by other users. My goal was to use a text field on the main page with a dedicated save button, and pushing these values into a repeating section of this structure:

Comments (Repeating section) - CommentText (plaintext) - CommentDate (date) - Commenter (plaintext) [the username command populates this section]

My issue is I need to display ALL submitted comments in a vertical column. Currently I've set up a separate view with the repeating section present. I've set it up to use an expression box to show the content of the repeated variables, but as of now only the most recent comment appears and nothing else will show.

How can I display ALL stored comments in this form view without user interaction?

0

is it possible to show code? without code I don't know where your going wrong! sounds like your not repeating the code within the repeater? if that makes sense lol.

I can point you to here and here as it shows a repeater in action using code populating a data table and the repeater is bound to that.

the key part from the links is:

               Repeater Repeater1 = new Repeater1();
                    web = SPContext.Current.Web;
                    list = web.Lists[_ListName];
                    Dt = list.Items.GetDataTable();
                    Repeater1 = new Repeater();
                    Repeater1.ItemDataBound += new RepeaterItemEventHandler(Repeater1_ItemDataBound);

                    Repeater1.DataSource = Dt;
                    Repeater1.DataBind();
                    Controls.Add(Repeater1);

its creating the repeater, getting the list items, putting the list items into a data table and attaching that to the repeater.... you can then create a new event called ItemDataBound.... this is user for every loop of every item being added to the repeater table! by that I mean every list item if you want to amend it and wrap it with code or what ever you like than that's the place to do it, look in the first example in what I'm doing within that event!

  • Thanks for your response! This might be a factor in this issue: I am not utilizing any custom code. Unfortunately I have not (And will not) be furnished with the tools necessary to do so, unless there is some way to do so within InfoPath itself that I'm not aware of, which is likely given my limited experience with InfoPath form templates. *edit to add since I'm not sure if it's clear: I need to display all the comments with author and timestamp in a separate view within the InfoPath form, not on a SharePoint page. – Miguet Schwab Jul 22 '14 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.