views:

37

answers:

1

We have a proprietry system where we can configure fields on indiviual forms. However these fields have a global tab order (we cannot specify for a specific form).
We have a bunch of forms (35 in total) which share a lot of different fields.

Each form has a specific tab/edit order that needs to be configured.

Example:
Form 1 has fields A,B,C,D in that order.
Form 2 has fields E,F,G,A in that order.
Form 3 has fields E,B,H,I in that order.

The global tab orders would be E,F,G,A,B,C,D,H,I
Notice how A needs to come before B yet after G.

Is there any easy way to work this out using the tab order lists for each form?
I need to merge this tab order information into a single global tab order list.
I have over 200 fields in total and it is near impossible to do by hand.

+1  A: 

I believe a topological sort ( http://en.wikipedia.org/wiki/Topological_sorting ) will fit the bill. Make a graph whose vertices are the fields and for each form, say, A,B,C,D, put edges A->B, B->C, C->D.

I believe you're right about the topological sort, but the remaining description seems truncated?
Kaleb Pederson