Service and Actions on Repeatable Sections

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

Service and Actions on Repeatable Sections

bruno.buzzi
Hi,

The form has an HTTP service that take an argument from a Orbeon Form
component (a combo box) and then display the result in another component.

So far for god ! no problems here...

But inside a Repeatable Section the value passed to the service is always of
the first combo box iteration.

It is possible by hand to set the iteration of the argument and the
component to set ?
<xf:action class="fr-set-control-value-action">
    <xf:var name="control-name" value="'myComboField'"/>
   <xf:var name="control-value" value="/conversion/tepValue"/>
</xf:action>

"myComboField" is inside a repeatable section so i need to pass the value of
the corresponding iteration.
The same goes to the receptor of the service response.

Maybe this is relate to:
https://github.com/orbeon/orbeon-forms/issues/1298

I'm not try to fill a repeat with the result of a service but take the
correct value (iteration) from a repeatable section to call a service and
the set the corresponding values with the service result.

regards,
bruno



--
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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557232172861-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bruno,

What triggers the service to run? If something inside a "row" (e.g. a button
inside that row, or value change for a control in that row), then the value
of the control on the "current row" should be sent to the service.

‑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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557270017208-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

bruno.buzzi
Alex,

A value change trigger the call to the service.

But the field that trigger the call is inside a Repeatable Section.

So the service is called always with the value of the first section
iteration.

The resource url of the service is:
http://myIP:8787/orbeon-gemstone-api/conversionfuenteenergia?fuente={fr:control-string-value('field-1')}&precio={fr:control-string-value('field-2')}&consumo={fr:control-string-value('field-3')}

I think the problem is here, {fr:control-string-value('field-1')} always is
set with the value of the first iteration of 'field-1'.

After solving this i'm not sure how to tell the Action the index of the
field to set ...

regards,
bruno

--
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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557518723016-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bruno,

Is this a GET request you're doing to that URL? If so, I'd recommend you
have the action pass the values to the service, instead of putting them on
the URL manually as part of the service declaration. This way, the action
will automatically take care of passing the value of the control on the
"current row". Also see the "Passing URL parameters to GET and DELETE
methods" section on the page linked below. You'll let me know if this works
for you.

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

‑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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557858011931-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

bruno.buzzi
Alex,

FIXED after:
1- Changing my service to be POST
2- Setting "Passing parameters to the service's XML request" in Orbeon
3- Put XPath in actions to point to 2)

Thanks for the pointer !

regards,
bruno

--
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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1558386127553-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Perfect Bruno, I'm glad it worked and you were able to pass the values of the
"current iteration". And thank you for the update.

‑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 post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1558464080953-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet