Dynamically change logo on form

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

Dynamically change logo on form

mbojja
Hi Alex - I have an API which returns logo/images based on the request parameter. How do I place this logo on the form?

For ex ; If you pass a code 5012 - > it returns a cat image
                                   code 5013 - > it returns a dog image and so on....

how do I place an image on the form returned by this rest api?


Thanks

--
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/fef94206-ed37-434f-83c5-d5324be3e9c0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically change logo on form

Alessandro  Vernet
Administrator
Hi Manish,

Quick question: does the API return the actual image, or an URL to the image
(e.g. in the body of a JSON or XML response)?

‑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/1574702107291-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically change logo on form

Alessandro  Vernet
Administrator
Also, where does the code come from (request parameter, field value,
somewhere else…)?

‑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/1574703846838-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically change logo on form

mbojja
Code come from a request parameter and an actual image is returned

On Tue, 26 Nov. 2019, 01:39 Alessandro Vernet, <[hidden email]> wrote:
Also, where does the code come from (request parameter, field value,
somewhere else…)?

‑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/1574703846838-0.post%40n4.nabble.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/CAN39TsO-4F6VDf83HR6OcKVCrTScg8xt6wbgeW1%2By46s2pjcSA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically change logo on form

Alessandro  Vernet
Administrator
Hi Manish,

Got it, so try the following:

1. Insert a Calculated Value control where you want the image to show. Have
it calculated as something like `concat(' <https://server/image-',
encode-for-uri(xxf:get-request-parameter('code')), '.png> ')`. Note the use
of `encode-for-uri()` to avoid XSS.
2. Check that when you run the form, the markup for the image shows
correctly.
3. Edit the source of the form to add on the `<xf:output>` that corresponds
to your control an attribute `mediatype="text/html"`.

You'll let me know if this works 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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574791797119-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically change logo on form

Alessandro  Vernet
Administrator
Hi Manish, did you get a change to try adding a `mediatype="text/html"` on
`<xf:output>`? Is so, did it 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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1575420072401-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet