Creating a TOC or Index - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » Creating a TOC or Index Creating a TOC or Index Last post 05-01-2007 09:30 AM by Greg Collins. 7 replies. Page 1 of 1 (8 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 03-05-2007 02:49 PM mvpeterson Joined on 03-05-2007 Australia Posts 4 Creating a TOC or Index Reply Contact As the title suggests, what is the easiest way I can go about creating an index or table of contents at the beginning?I tried using hyperlinks, it works but if I add a new record;a) I cannot get the hyperlink to add an extra link for the new recordb) When I add an extra hyperlink manually, it will only refer to the first record.Does this make sense? Cheers. 03-05-2007 03:58 PM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact You are using the hyperlink control in a repeating section/table? The hyperlink control allows you to bind the href and display text to different fields so that you should be able to accomplish this... if you are already doing this, verify the fields you are binding these attributes to actually have values in them. Please Visit:BraintroveGreg's Paintings 03-05-2007 04:24 PM In reply to mvpeterson Joined on 03-05-2007 Australia Posts 4 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact Q. You are using the hyperlink control in a repeating section/table?Yes, precisely. As you mentioned, I have binded the datasource & display text of the hyperlink to point to a field of section where it returns the text from that field.So this works fine if I have 1 entry. However, when I goto add a new entry in the form (as part of a repeating section), I am able to enter the name of the new section, however;a) the hyperlink I have in the TOC still remains as one entry, and;b) the hyperlink will only pickup the name from the first entry.So following this I thought hmm, obviously a new TOC entry will have to be made, so I added a new TOC entry which automatically contains the new hyperlink, however both hyperlinks still point to the first/original field name in the section below.So currently, what this means is I may have many repeated sections each with thier individual indentifer field names that begin each repeated section, however only the first field name is returned to the hyperlink, or hyperlinks. I'm trying to understand how to make each hyperlink reference each new section created. I am aware that java script may be written as part of an action event to facilitate the creation of a new TOC entry whenver a new repeating section is created, but;a) I have limited JS programming skillsb) It would still pose the same problem as only referencing the first repeated section field name and not each new one created.Hope i'm making sense.Cheers,Mark. 03-06-2007 11:43 AM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact Okay, from what you've said, it sounds like you actually have TWO repeating sections... one that contains the hyperlink and a TOC section that contains the display/value pairs. This is where your problem is coming from.Is it possible to have all this in the same repeating group in your schema? If so, then it should be a simple matter of having each row's hyperlink pick up that same row's display/value pairs.If not, then you need some kind of a link between the two tables (an ID or something) so that you can maybe use a filter (which I haven't verified that you can even use a filter in your hyperlinks). Even so, you still have the problem of inserting a new TOC row for every hyperlink row you insert. This will require code.The best way is to have them all in the same repating group in your schema--it makes things much more simple in designing your views. Please Visit:BraintroveGreg's Paintings 03-06-2007 02:38 PM In reply to mvpeterson Joined on 03-05-2007 Australia Posts 4 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact Greg, First I would like to thank you for devoting some of your time to my problem. Going from what you mentioned above, I think I understand what you mean, however I think I may have already done what you have suggested. My TOC section is a section that contains a repeating table where I have replaced the default text box control with a hyperlink. My main form section is also a repeating section with further sections contained within. Both the TOC and the main form sections are both contained within a larger section. I have attached some screenshots below; *** LINKS HAVE BEEN REMOVED FOR SECURITY REASONS ***As you can see from the form, in preview mode I have added an extra entry in the TOC & the main form, I have named the cubes on the main form as Cube1 & Cube2, however the TOC only picks up on 'Cube1' even though I have manually added an extra TOC entry. If I can get this working even though it's a manual process of assigning TOC hyperlinks to form headings, it would serve my cause well. Cheers, Mark. 03-07-2007 10:35 AM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact More questions to help me understand...What exactly is stored in TOC/toc_repeating_table/field1 ?? The reason I ask, is I'm wondering if your TOC can/should just be another repeating table in the view, bound to the same cube node. The TOC *SHOULD* be based off your existing structure, not off a secondary structure.So you have a repeating group bound to cube that allows you to enter all your data, and another repeating table bound to cube that has a hyperlink control with its 2 values being supplied by field under cube.I don't understand the requirement to keep TOC separate... seems like the data is already available under cube. ((IF)) this were me doing it, unless required otherwise, the TOC would be strictly virtual, based on values in the cube repeating group. Please Visit:BraintroveGreg's Paintings 04-30-2007 10:09 PM In reply to mvpeterson Joined on 03-05-2007 Australia Posts 4 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact Greg, Once again thank you for your assistance on this issue. I have now resolved this somewhat; I have been able to automatically generate a table of contents, with each TOC entry automatically referencing a repeated section's heading. However, now I want to be able to use the TOC's entries as hyperlinks so that when it is clicked, it goes straight to the appropriate section below, which is on the same form. 1) Is this possible, and;2) How do I go about doing this? Thanks again. 05-01-2007 09:30 AM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Creating a TOC or Index Mark as Not AnswerMark as Answer... Reply Contact This is much more difficult. There is no concept of named anchor points as in HTML.In InfoPath, hyperlinks only do one thing... link to a URL or URN. They don't get any fancier than that. However, you can format a button to look like a hyperlink by removing the border and background color and making the text underlined, etc. Then in the click hander you can attempt to set focus on a particular control in the section you want scroll into view. This might not even be possible depending on your design.I know some people have experimented with attempting to create named achors in the views manually by editing the XSL. I don't know if, or how well those worked out.Good luck! Please Visit:BraintroveGreg's Paintings Page 1 of 1 (8 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Greg, First I would like to thank you for devoting some of your time to my problem. Going from what you mentioned above, I think I understand what you mean, however I think I may have already done what you have suggested. My TOC section is a section that contains a repeating table where I have replaced the default text box control with a hyperlink. My main form section is also a repeating section with further sections contained within. Both the TOC and the main form sections are both contained within a larger section. I have attached some screenshots below;
As you can see from the form, in preview mode I have added an extra entry in the TOC & the main form, I have named the cubes on the main form as Cube1 & Cube2, however the TOC only picks up on 'Cube1' even though I have manually added an extra TOC entry. If I can get this working even though it's a manual process of assigning TOC hyperlinks to form headings, it would serve my cause well. Cheers, Mark.
Greg,
Once again thank you for your assistance on this issue. I have now resolved this somewhat; I have been able to automatically generate a table of contents, with each TOC entry automatically referencing a repeated section's heading.
However, now I want to be able to use the TOC's entries as hyperlinks so that when it is clicked, it goes straight to the appropriate section below, which is on the same form.
1) Is this possible, and;
2) How do I go about doing this?
Thanks again.
This is much more difficult. There is no concept of named anchor points as in HTML.
In InfoPath, hyperlinks only do one thing... link to a URL or URN. They don't get any fancier than that. However, you can format a button to look like a hyperlink by removing the border and background color and making the text underlined, etc. Then in the click hander you can attempt to set focus on a particular control in the section you want scroll into view. This might not even be possible depending on your design.
I know some people have experimented with attempting to create named achors in the views manually by editing the XSL. I don't know if, or how well those worked out.
Good luck!