Section template with an HTTP service and an action

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

Section template with an HTTP service and an action

bwallis42
I have a section template (shown below) that has a single http service and an
action that is set to run always, when the form loads and before initial
data values are calculated. This action calls the service and populates a
dataset called userprofile.

In the (only) section in the form I have two text controls that are
populated from the dataset using something like this


This tests fine in the builder and as a standalone form. The service is
called and the controls are populated as expected.

When I publish this as a library and then create a new form and use it from
the Section Templates toolbox the form displays its controls OK but the
action is not run and the controls are not populated. I suspect the event
'fr-run-form-load-action-before-data' is not occurring for the form when it
is an included library section. I've tried other combinations of settings in
the action control but i don't think I really understand the events in forms
and when they occur.





--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Section template with an HTTP service and an action

Alessandro  Vernet
Administrator
Hi Brian,

Yes, unfortunately I think that you've hit a known problem. I've included
the link the relevant issue below. Is this a blocker for you at this point,
or were you for now just experimenting with this?

https://github.com/orbeon/orbeon-forms/issues/3132

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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Section template with an HTTP service and an action

bwallis42
Hi Alex,
  Apologies for not answering this a year ago :-) Yes, it was just
experimentation at the time and certainly not a blocker even now.

That said it would be quite useful if this worked. I am again experimenting
with this with a view of documenting how this feature (library templates)
can be used by our customers.

I have a sample form with a library template that directly populates some
controls from the results of a service call and that works when used in
other forms (but does have a different issue I will post about separately).
But if I use a dataset instead of direct control population, that does not
work.

The reason I would like to use the dataset from the control would be to make
that dataset globally accessible to other controls in the form so that the
rest call to populate the dataset is only issued once.

thanks,
brian...


--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Section template with an HTTP service and an action

Alessandro  Vernet
Administrator
Hi Brian,

The issue is still there, but I'm unsure that fixing it would allow you to
do what you have in mind: if it were to be fixed, you'd be able to access
the dataset from a control inside the section template, but you wouldn't be
able to access the dataset or the control value from anything outside of the
template. Or am I misunderstanding what you had in mind?

-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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Section template with an HTTP service and an action

bwallis42
Hi Alex,
  It would be good if the dataset worked from within the section template.

But I would also like to be able to create a set of services and actions
that could be inserted into a form once and then have the results of the
calls to the services available to all controls in the form. That way I can
code a standard set of services that are used in a number of forms but that
I can maintain in a single place.

At the moment, if I need to use the value from a service call in two section
templates I would end up calling that service twice.

thanks
brian...


--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Section template with an HTTP service and an action

Alessandro  Vernet
Administrator
Hi Brian,

I agree: it would certainly be nice to be able to create HTTP Services and Actions that can be reused across forms. We've come across this in the past, and though we had an RFE, but maybe not, so I just went ahead and created one:


-Alex

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet