Populating repeating grid with database service response

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

Populating repeating grid with database service response

Paul Brigden
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?

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/d83baf6e-e8eb-4aeb-9747-ac934e7339d9%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Populating repeating grid with database service response

Alessandro  Vernet
Administrator
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/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1570491479171-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Populating repeating grid with database service response

Alessandro  Vernet
Administrator
Hi Paul, just curious: did you get a chance to try the actions syntax? If so,
did it work for your use case?

‑Alex

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1571163076163-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Populating repeating grid with database service response

Paul Brigden
In reply to this post by Paul Brigden
Hi Alessandro,

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

Paul

On Thursday, October 3, 2019 at 7:54:19 PM UTC+3, Paul Brigden wrote:
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: <a href="https://gist.github.com/avernet/dc3bcaefd1c1fd7df9022834a83767c4" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Favernet%2Fdc3bcaefd1c1fd7df9022834a83767c4\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfqSHI5aVQxUOdrJIXEu19Xur4dw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Favernet%2Fdc3bcaefd1c1fd7df9022834a83767c4\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfqSHI5aVQxUOdrJIXEu19Xur4dw&#39;;return true;">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?

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/5707811c-6782-4620-a6f4-10a51dcee1b5%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Populating repeating grid with database service response

Alessandro  Vernet
Administrator
Excellent Paul, and thank you for the confirmation!

‑Alex

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1571250593351-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet