Java Embedding API Styling Issue

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

Java Embedding API Styling Issue

kiskandar
Trying to embed a form in a JSP page as per the example given in the Java embedding API documentation and the resulting form which is displayed has some elements which aren't there when the form is displayed normally. This happens even after we've excluded all of our custom CSS. Attached are screenshots comparing the form when it's displayed normally and when it's displayed through the embedding API





The API call inside the JSP:

API.embedFormJava(
                request,      // HttpServletRequest: incoming HttpServletRequest
                out,          // Writer: where the embedded form is written
                "CPF",     // String: Form Runner form name
                "123",  // String: Form Runner app name
                "view",        // String: Form Runner action name (at least new, edit and view are valid)
                "a9d0e90435cd47be20dc942624a5103d144ee3ca",         // String: Form Runner document id (optional)
                "draft=true",         // String: query string (optional)
                requestHeaders          // Map<String, String>: custom HTTP headers (optional)
 );

Any help is appreciated.

Thanks
Kris
Reply | Threaded
Open this post in threaded view
|

Re: Java Embedding API Styling Issue

Alessandro  Vernet
Administrator
Hi Kris,

Could you try adding a class="orbeon" on the <body> of your form, or the container in which you're doing the inclusion. You'll let us know if this solves your problem.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Java Embedding API Styling Issue

kiskandar
Thanks for your reply Alex. I tried adding class="orbeon" to the containing div but it didn't work. The first element of the HTML fragment returned by the embedding API actually is <div class="orbeon orbeon-portlet-div xforms-disable-hint-as-tooltip xforms-disable-alert-as-tooltip">

I figured my issue is because of the id of the form element differs when it's returned through the embedding API. When displayed through the embedding API the id of the form element is o0xforms-form and when it's displayed normally the id of the form element is xforms-form. This breaks some of Orbeon's built in styling which relies on the id.

Kind regards
Kris
Reply | Threaded
Open this post in threaded view
|

Re: Java Embedding API Styling Issue

Alessandro  Vernet
Administrator
Hi Kris,

OK, so let's try this: could you check that you're using combined resources? This is the default, but you might have set oxf.xforms.combine-resources to false in your properties-local.xml. Currently, ids in the CSS don't get rewritten if the resources are not combines, which is a problem when using the embedding API.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Java Embedding API Styling Issue

kiskandar
That fixed it. I forgot we had disabled this property during development. Thanks for your help Alex.
Reply | Threaded
Open this post in threaded view
|

Re: Java Embedding API Styling Issue

Alessandro  Vernet
Administrator
Hi Kris,

OK, great; thank you for confirming. And we'll have to fix this on our side, so, even if uncommon, this works even if you're not using combined resources.

Alex
On Mon, Apr 4, 2016 at 8:07 PM kiskandar <[hidden email]> wrote:
That fixed it. I forgot we had disabled this property during development.
Thanks for your help Alex.

--
View this message in context: http://discuss.orbeon.com/Java-Embedding-API-Styling-Issue-tp4661337p4661357.html
Sent from the Orbeon Forms community mailing list mailing list archive at 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 post to this group, send email to [hidden email].

--
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: Java Embedding API Styling Issue

Alessandro  Vernet
Administrator
Kris & al,

And for reference, I've created an issue to track the problem happening when using the embedding API with non-combined resources:

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

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet