success-message with control value

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

success-message with control value

vbr
Hello,

I would like to display a success-message with a control value like that :

Your dossier ${dossierIdControl} has been processeed.

Is-it possible and how?

Thank you for your help!

--
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: success-message with control value

Alessandro  Vernet
Administrator
Hi Vincent,

The `message` parameter supports XPath Value Templates (see link below), so
something like `success-message(message = "Your dossier {//dossierIdControl}
has been processed.")` should do the trick. You'll let me know if this works
for you.

https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#success-message-and-error-message

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

Re: success-message with control value

vbr
Hi Alessandro,

Thank you for the response, it works!

Another question, is it possible to define the message in a localized
property?

Also, in my process action I would like to send the form to an external
service and then read a response header from the service and display it in
the sucess message?

--
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: success-message with control value

Alessandro  Vernet
Administrator
Hi Vincent,

For localization, I imagine one possibility could be to use Form Runner
resources to define the properties (see 1st link below), like:

<property
    as="xs:string"
    name="oxf.fr.resource.*.*.en.acme.message"
    value="My message"/>
<property
    as="xs:string"
    name="oxf.fr.resource.*.*.fr.acme.message"
    value="Mon message"/>

Then in XPath use the `xxf:r()` function (see 2nd link below), as follows:

xxf:r(
    'acme.message',
    'fr-fr-resources'
)

I haven't tried this myself, so consider the above as pseudo-code ;).
Regarding your second question, unfortunately, you currently can't extract
the message from a response until we implement #1688 (see 3rd link below),
which we'll hopefully do sooner than later.

https://doc.orbeon.com/configuration/properties/form-runner#overriding-resources
https://doc.orbeon.com/xforms/xpath/extension-functions/extension-core#xxf-r
https://github.com/orbeon/orbeon-forms/issues/1688

‑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: success-message with control value

Alessandro  Vernet
Administrator
Hi Vincent, did you get a chance to try setting properties to define your own
resources to be localized, as suggested in my previous message? If so did
that work for you?

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

Re: success-message with control value

vbr
Yes it works!

I managed like this :

<property as="xs:string" name="oxf.fr.detail.submit.title.*.*"
value="submit-dialog-title"/>
    <property as="xs:string" name="oxf.fr.detail.submit.message.forem.*"
value="submit-dialog-message"/>
    <property as="xs:string" name
="oxf.fr.resource.*.*.fr.detail.messages.submit-dialog-title" value="Demande
envoyée"/>
    <property as="xs:string" name
="oxf.fr.resource.*.*.fr.detail.messages.submit-dialog-message" value="Votre
formulaire a bien été envoyé"/>

Thank you

--
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: success-message with control value

Alessandro  Vernet
Administrator
Excellent Vincent, I'm glad overriding the resources with properties worked
for you, 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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: success-message with control value

Jan Horký
In reply to this post by Alessandro Vernet
Hi Alessandro,
thank you for this thread, that helps me a lot. But I would like to ask you
how to do the same for error-message with custom message filled by
submission servlet response.

I have following in my properties-local.xml:


and my submitXform returns:



Is it possible to show servlet XML response in error dialog? I would like to
keep user on xform, not to replace its content by replace="all" option.

Thanks in advanced.
Jan.

--
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: success-message with control value

Jan Horký-2
In reply to this post by Alessandro Vernet
Hi Alessandro,
thanks for replies in this thread, it was very helpful to me. 
Is it possible use same concept for display error-message with custom error message prefilled from my custom servlet XML response that is used for xform send?
I'm struggling with this usecase (searching docs, forums, even source code), but I feel it should be simple as success-message.

I have in my properties-local.xml

<property as="xs:string" name="oxf.fr.detail.process.send.apcmu-v4.*">
require-uploads
then validate-all
then send(
        uri      = &quot;http://localhost:8080/apcmu/submitXform&quot;,
        replace  = &quot;instance&quot;,
instance = &quot;fr-send-submission-response&quot;,
method   = &quot;post&quot;,
        content  = &quot;xml&quot;,
        annotate = &quot;id&quot;,
        nonrelevant = &quot;keep&quot;
    )
recover error-message(message="Custom message: {//message} !!!")
</property>

and my submitXform servlet returns:

HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Server: apcmu
Content-Type: application/xml; charset=UTF-8
Content-Length: 71
Date: Wed, 17 Apr 2019 08:56:32 GMT

<exceptions><exception><message>error from backend application</message></exception></exceptions>

I would like to stay on xform and not to replace it by different page or content -> just let user close error dialog and try to send again.

Thanks in advanced. 
Kind Regards, Jan.

On Wednesday, November 21, 2018 at 8:26:47 AM UTC+1, Alessandro Vernet wrote:
Hi Vincent,

The `message` parameter supports XPath Value Templates (see link below), so
something like `success-message(message = "Your dossier {//dossierIdControl}
has been processed.")` should do the trick. You'll let me know if this works
for you.

<a href="https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#success-message-and-error-message" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdoc.orbeon.com%2Fform-runner%2Fadvanced%2Fbuttons-and-processes%2Factions-form-runner%23success-message-and-error-message\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGunN8tzrOAFnYGM2bkRiZ1lrICOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdoc.orbeon.com%2Fform-runner%2Fadvanced%2Fbuttons-and-processes%2Factions-form-runner%23success-message-and-error-message\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGunN8tzrOAFnYGM2bkRiZ1lrICOg&#39;;return true;">https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#success-message-and-error-message

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">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: success-message with control value

Alessandro  Vernet
Administrator
Hi Jan,

Unfortunately, for now this isn't possible. However, this is a top Request
for Enhancement, so we'll hopefully get to do this soon. And in the
meantime, I've added a +1 from you on issue #1688 linked below.

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

‑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: success-message with control value

Jan Horký
Hi Alessandro, thank you for your time. We'll go with some workaround. I'll
keep my eye on github issue you posted.
Jan.

--
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].