Copy row content for new row

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Copy row content for new row

Karthi
Hi,

I am using Orbeon form builder.

Is it possible to copy values in a row to next row when clicking on '+' or 'Insert' menu from a repeater?
Below is the sample screen. When 'Copy' is checked for a row then that particular row's content should be copied whenever a new row is inserted.



Thanks,
Karthi
Reply | Threaded
Open this post in threaded view
|

Re: Copy row content for new row

Alessandro  Vernet
Administrator
Hi Karthi,

You could do this by setting the initial value of the field to something like:

../preceding-sibling::children-iteration[1]/first-name

Which would give you:



And here is the source of a test form you can paste in Form Builder: take-previous-value.xml.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Copy row content for new row

Karthi
Hi Alex,

The example did not work.
I  think this works in latest version of Orbeon? Because it worked when I tried creating same form using Orbeon demo form builder (http://demo.orbeon.com/)

I am not sure which version the demo site hosts.
We are using version 4.9. Does this solution work in v 4.9 or are there any alternatives ?

Thanks,
Karthi
Reply | Threaded
Open this post in threaded view
|

Re: Copy row content for new row

Karthi
Hi Alex,

I upgraded to latest version and it works as expected for the '+' button, but still it does not work for 'Insert Above' or 'Insert Below' actions, same issue is exists for 'Repeated Section' as well.

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Copy row content for new row

Alessandro  Vernet
Administrator
Hi Karthi,

Having and insert before / insert after seems to "conflict" with this behavior you're describing. Would in your case using the minimal appearance for the repeated grid make sense? I.e. setting the oxf.xforms.xbl.fr.grid.repeat.appearance.*.* property to minimal. Then it would be simpler for users to understand what data is copied: data on the last row is copied to the new row, alway added at the end.

http://doc.orbeon.com/configuration/properties/form-runner.html#appearance-of-repeated-grids

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet