Populating repeating grid with database service response

8 views
Skip to first unread message

Paul Brigden

unread,
Oct 3, 2019, 12:54:19 PM10/3/19
to Orbeon Forms
Hi,
 
Using Orbeon PE version 2018.2
 
We're trying to populate a repeating grid from a database service response. We have seen a few examples of how this can be done. This seemed like the most promising one, however it did not work: https://gist.github.com/avernet/dc3bcaefd1c1fd7df9022834a83767c4
 
We are storing the response of the db call in a dataset. I know the dataset is populating because I am putting a count(fr:dataset('my-test-dataset')//poitemdesc) value in a text field and I see the number updating. However the repeating grid just stays with 1 empty item, as if nothing happened.
 
<raw>
<xf:action iterate="fr:dataset('my-test-dataset')//poitemdesc">
    <xf:insert context="xxf:instance('fr-form-instance')/section-1/polines-grid" ref="polines-grid-iteration"
 origin="xxf:element(
            'polines-grid-iteration',
               (
                  xxf:element('po-description', '')
               )
            )"
   />
</xf:action>
</raw>
 
Any ideas?

Alessandro Vernet

unread,
Oct 7, 2019, 7:38:00 PM10/7/19
to orb...@googlegroups.com
Hi Paul,

Since 2018.2, Orbeon Forms has an XML syntax you can use to call a service
and populate a repeat based on the result from the service, and the plan is
to have an UI for this in future versions. For now, see the doc on the page
linked below, and I think the example there does precisely what you want.
You'll let me know if this helps.

https://doc.orbeon.com/form-builder/advanced/services-and-actions/actions-syntax

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Alessandro Vernet

unread,
Oct 15, 2019, 2:11:17 PM10/15/19
to orb...@googlegroups.com
Hi Paul, just curious: did you get a chance to try the actions syntax? If so,
did it work for your use case?

Paul Brigden

unread,
Oct 16, 2019, 2:13:16 PM10/16/19
to Orbeon Forms
Hi Alessandro,

Sorry for not responding earlier. It did work thank you!

Paul

Alessandro Vernet

unread,
Oct 16, 2019, 2:29:55 PM10/16/19
to orb...@googlegroups.com
Excellent Paul, and thank you for the confirmation!
Reply all
Reply to author
Forward
0 new messages