Need to reorder repeating sections - note: NOT rows in a repeating table - InfoPath Dev
in

InfoPath Dev

Need to reorder repeating sections - note: NOT rows in a repeating table

Last post 09-01-2010 07:31 PM by Jimmy. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 09-01-2010 06:10 AM

    Need to reorder repeating sections - note: NOT rows in a repeating table

    Hi - I found a great utility on this site re: reordering rows in a repeating table using the cool up/down arrows.  While I do like that it isn't exactly what I am looking for.

    •  I have 10 repeating sections in row on a form
    • Each repeating section has a few fields on them
    • These fields have hard coded text values re: new staff orientation activities
    • Users select the activities that apply to the new candidate and switch views to generate a 'new hire schedule' (i.e. 9:00 Do This, 9:30 Meet with Security, 10:30 Meet w/ John...etc.)
    • I need a way to REORDER independent sections (i.e. move repeating section #4 to be on top of repeating section #2...etc.)
    • A repeating table will not work for me because I need distinct activities hard-coded into the repeating sections related to each orientation activity.

    Can someone help!  Anyone that REALLY helps me gets a $100 AMEX gift card!!!!

     

  • 09-01-2010 07:11 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    It's a bit rough, but I think the attached form might do what you're looking for.  The key points are:

    • An editable repeating node (my:Activity) to describe the order of the sections.
    • Another non-editable repeating section bound to the same node.
    • Individual non-repeating sections bound to the same node, with conditional formatting to hide them unless the value of the current node equals the corresponding value (i.e. "Section1", "Section2", etc).
    • Filtering on the dropdown to prevent duplicate selections.

    Normally the data in the ActivityTypes nodes would be stored in a secondary XML data source since it doesn't need to be stored in the main XML, but I've left it in the main data source for simplicity.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 07:22 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Another approach is to use an outer repeating group with the nodes in it generalized to be able to represent the data in any type of section, like in the attached form.  One benefit of this approach is that you can have more than one of the same type of section (which you may want).

     Under this design, you could use the Up and Down arrows you described in your post to reorder the sections as needed.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 08:31 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Thanks Jimmy.

    I think a bit more detail might help...

    The folks that use this form are responsible for building the Day 1-2 orientation schedule for new hires.  They have to schedule the new hires for a bunch of stuff and then use this form to track the various dates of these meetings ad ultimately also use the form to print and email the final schedule to the new hire.  Based on the type of employee, some orientation activities are needed and others are not.  They opted for wanting to see ALL activities and they would select the ones they wanted.

    They see something like this:

    Time                                    Orientation Activity                               Include?

    _____                                  Meet w/ Security                                  Checkbox Control (Y/N)

    _____                                  Get badge photo taken                          Checkbox Control (Y/N)

    _____                                  Safety Session                                    Checkbox Control (Y/N)

    _____                                  RN Licensing                                      Checkbox Control (Y/N)

    _____                                  Lunch w/ Team                                    Checkbox Control (Y/N)

    _____________________________________________________________________________________

    Notes:

    • Users enter in the scheduled Date/Time into the left column
    • The middle column are hard coded view only text controls
    • There is a button at the end of the list that creates the final print/email view - not showing any rows that are uncheccked (far right column)
    • I need a way to change/alter the final ordering of the resulting structure which is basically a long list of different repeating sections - each section has the same 3 fields in it
    • I am ok with a 'sort order' field being added - anything...
  • 09-01-2010 09:18 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Might this be more like it?  The sort order number is automatically determined using the default value formula on the Sort Order field, based on the times and whether the Include checkbox is checked.

     If that's still not what you're going for, might you attach a mockup of what you want this final view to look like?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 09:28 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    I do like that, but how do I get the resulting table to "respin" and reorder by the sort order values once everything is complete/filled in?

  • 09-01-2010 09:40 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    I'm not sure what you're asking.  The sections should automatically be ordered based on the order of their respective start times.  Are you asking me to explain the mechanism that I used to order the sections based on their sort order, or do you want a way to change the sort order to something other than the order of the start times?  Perhaps a little more detail of the thinking behind the way your process works would help me out.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 09:57 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Unless I am missing something, I can navigate the UI and add times and click include which nicely drives the sort order, BUT I am left with a 4-5 row table that is out of order.  The sort order from top to bottom reads 2,1,4,3,5.  Things might get entered out of order so I like the ability to re-sort.  How do I get from the table that is out of order to a clean table that lists rows on sort order: 1,2,3,4,5?  Make Sense?

  • 09-01-2010 10:18 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Would the second table in the attached form do the trick?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 10:36 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Perfect.  Now the important question....how do I do it?

  • 09-01-2010 11:44 AM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Hi  - Where does the "Activity Type" text come from.  Does that have to be the same?  Could you show me the same exmaple but w/ 4 Activity types hard coded as:

    Schedule Meeting with MGH Security

    Surgical Rotation Review w/ Wilton

    Lunch w/ Laura

    Parking Pass Distribution

     

  • 09-01-2010 03:30 PM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Here's a form that does what you describe.  But the way your categories have people's names in them suggests that these categories might be modified quite often.  Is that the case?  If so, I think a more general approach may be in order.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-01-2010 04:47 PM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Hi Jimmy - Thanks!  (And yes, I tried to council them against the references to people but they wanted to go that route anyway.)  I am going to play with this a bit.  I am still not 100% sure where the descriptions are pullling from but they appear to mapped to the repating values in 'Activities'.

  • 09-01-2010 07:31 PM In reply to

    Re: Need to reorder repeating sections - note: NOT rows in a repeating table

    Yes, the descriptions are coming from the my:Activities group, which, along with my:Code, I set up using InfoPath's Default Values dialog.

    The logic in the form comes from:

    • All three repeating fields being bound to the same my:Activies group
    • Section controls inside the third repeating section, all also bound to the my:Activities group
    • The conditional formatting on these section controls
    • The default value formula on the my:SortOrder field
    • The conditional formatting on the second repeating section
    • The formulas in the expression boxes in the second repeating section
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.