Chance
Chance

Reputation: 43

How can I create repeated fields in Form Builder with Orbeon Forms 3.9?

Alex, I don't think I explained myself well enough (Although the information you provided was useful.) Lets say that I have an employment application that was created to collect information about a persons previous employers. Lets say that the grid for one employer was 15 fields deep. If i were going to allow the user to enter up to 10 past employers, I am going to have to manually create 150 individual fields...then....to make matters more complicated, if i were using validation rules for my form, I will have to modify the properties on each control one at a time. So my question is two fold: First, is there a way to quickly replicate whole grids within the form builder? Second, is there a way to modify visibility rules for a whole grid rather than right clicking on each control one at a time to add visibility rules (or change control names for that matter.)

Upvotes: 4

Views: 857

Answers (1)

avernet
avernet

Reputation: 31743

Orbeon is working on adding support for Form Builder to build a UI for what XForms refers to as "repeats". With repeat support built in Form Builder, you'll be able to create just one "line", i.e. the fields for one sibling, and say that this line can be repeated. But since this is not available yet, you can work around this by editing the source generated by Form Builder to use repeats. Let me expand on that idea:

Form Runner, the runtime, already supports repeats. It's just that Form Builder doesn't let you edit them. You can use a repeat by editing the code generated by Form Builder from Advanced / Edit Source. You can see what a repeat looks like in the Bookshelf example, and see what the code looks like in the source of the Bookshelf example (look for the <fr:repeat> on the <fr:grid>).

In your case, since you'd like to limit the number of possible siblings to 14, also add an attribute maxOccurs="14" on the <fr:repeat>.

Upvotes: 1

Related Questions