I have tried to put a section label as HTML.
Here is the config of section:
When I apply changes, this what appears on builder.
And then when I execute it on runner this is the result:
It is scaping HTML and by that is being treated as plain text.
I am using Orbeon 2018.1.2.201810050007 PE.
Maybe I am not taking in account something or missing any configuration.
This issue is fixed in Orbeon Forms 2018.2.3 and Orbeon Forms 2019.1. See #3671 for details. There is no backport of this fix to the Orbeon Forms 2018.1 series as of yet but if you have commercial support, please contact Orbeon directly about this.
Related
We are trying use Orbeon Form runner with server-side embedding.
The form renders properly on form runner, however in our java web application the form is not rendered properly i.e. CSS issues.
All the /orbeon/* resources are retrieved from orbeon application, but the CSS is not applied properly. I suspect it could be because of the extra div that are added for the embedded/portlet.
In Form Runner
Full Size Image
In Java Web Application
Full Size Image
Also, if we use the wizard view, it works in form runner, but does not work in embedded java web application. The sections are shown on the same screen.
When Orbeon Forms produces the whole page, it adds an orbeon class on the body, and then pretty much all the CSS that comes with Orbeon Forms is "prefixed" with .orbeon …. This is done to minimize the risk of Orbeon Forms' CSS conflicting with your own CSS.
I can't be sure that this is the problem, but if the CSS doesn't apply when embedding, you might need to add a class="orbeon" on the element that contains the content you're embedding.
Thanks for your guidance. I was able to resolve the problem.
When embedding forms, as you said orbeon regenerates the CSS, and also appends "o0" (#o0xforms-form) to each control's id. However, the xforms.css still refers to control with (id #xforms-form), hence styles are not applied correctly.
Overwritten the xforms.css with custom app-xforms.css which uses (#o0xforms-form) which fixes the problem.
I am very familiar with web technologies (HTML, JavaScript, CSS), but not with XBL and XForms. I would like to package a "widget" inside an XBL component, so it can be exposed to Form Builder, and used by form authors creating forms with Form Builder. What would be a good place to start learning how to do this? Do you have recommendation on the tools to use to edit XBL/XForms?
Getting started
This answer provides a good overview of what needs to be added to your XBL control so it can be used in Form Builder.
For more information on how to provide Form Builder specific metadata for your XBL control, see the documentation on <fb:metadata>.
Looking at examples always helps: the source of all the build-in XBL controls is available on GitHub.
If you want Form Builder to reload the component, all you need to do is click on the green icon with 2 arrows at the top of the Form Builder left bar (no need to restart your app server, or even reload Form Builder).
Tools and debugging
When editing XML, it helps to have a decent editor that would at least make sure what you type is well-formed XML, and maybe help you indent things properly. At Orbeon, we use IntelliJ because in addition to XML it also has good support for Scala, Java, JavaScript, CSS, LESS, which we use in Orbeon Forms.
For debugging, you can enable the XForms inspector. The inspector helps you see live what the state of all the instances is, including those inside XBL components. Make sure the property is set to false when you first load Form Builder (the inspector doesn't show properly with Form Builder), then set it to true, and hit the test button on your forms: the inspector will show at the bottom of your form.
Specific questions
If you have specific questions about programming with XBL in Orbeon Forms, I would encourage you to use Stack Overflow and ask them with the tags orbeon and xbl, so they can then be found more easily.
I am relatively new to Rails, having recently completed Hartl's Rails Tutorial, and am now embarking on my first full fledged project. What I am interested in adding to my web app is something similar to the text input feature in SO, where you could type, and see directly how your text will turn out. After some digging around on SO, I have decided on using the gem bluecloth, which is Markdown implemented in Ruby, but now have the following questions:
I am unsure about how to tie what bluecloth outputs to the form_for helper. My understanding was that you could convert to strings via the function html = BlueCloth.new(str).to_html(), but I am unsure what to do when you have a text field as part of form_for, where I should plug in the bluecloth part? In other words, I am still a bit confused about the magic of typing in one box and seeing the item show elsewhere on the page.
Are the WMD bar button items and functions included Markdown editors (such as bluecloth), or would this be something I have to build manually? If so, how would I get something like the bold button to show "** **" in the editor as you type?
Thanks for your help!
As comments have noted, Markdown is a markup language like HTML, so its not easy to do WYSIWYG.
There are probably two approaches to getting this kind of functionality.
Server side
Post your markdown text to a server and get the server to return HTML. I've done this a lot in Python, but for Ruby this SO answer suggests maruku. The disadvantage of this approach is that it requires a server request every time you want to view the preview, and then some way to integrate that back into your UI without disrupting the user. Stackoverflow uses this approach with the WMD editor and some C# on the server.
Client side
Another option is to use a client side library to take your markdown "code" and generate html which you can then integrate into your page using javascript. An example of this is dillinger. This uses a textarea and something like showdown to render the HTML in the browser. I'm taking this approach one step further in a WYSIWYG Markdown editor I'm developing called demarcate.js
Or... ditch Markdown
The comments have already suggested alternative WYSIWYG editors... most of these are not markdown editors but rich text editors which produce HTML at the end. TinyMCE and wysihtml5 are good options and I've also used CKeditor before with some success - it has a cool "in-place" feature in the latest version which inspired my Markdown editor above.
I tried the approach of using Form-Builder-Generated-Form within Java application suggested here < Running Orbeon-Form-Builder-Generated-Form with Java Application > : downloaded Orbeon nightly build, created a sample form using Form Builder and copy & pasted it into JSP page in my app. However, when I try to access this JSP, it redirects me to: /myapp/fr/unauthorized . Can you please tell me what I maybe doing wrong? Or what is the right way of making Orbeon process Form Builder generated content in Java app?
For my deployment I followed separate deployment and configuration specified in Orbeon documentation. Thanks in advance.
You are not doing anything wrong, but Orbeon Forms doesn't support this type of form deployment.
The separate deployment mode runs the output of your JSP directly through the XForms engine.
Form Builder-generated forms OTOH expect pre-processing via the Form Runner runtime, in particular through the components.xsl XSLT transform. This is needed to support all the Form Runner features, including built-in persistence, error summary, internationalization, etc.
Currently the cleanest way to integrate such forms with your own app is to just run them side by side (Orbeon WAR + your own WAR) and navigate between each other via links and POSTs.
You could also use an iframe, although that is often a disliked solution.
You could also transform the form produced by Form Builder into plain XForms that doesn't assume Form Runner. It wouldn't be too hard to do but would be outside the scope of this StackOverflow question.
Does anyone know if there's a way to add an RTE to textarea fields within salesforce? I'm fairly new to the platform but i haven't been able to find any useful documentation on this.
In addition to the component, there's also an example of integrating the open source FckEditor component into Visualforce here:
http://blog.sforce.com/sforce/2009/05/a-rich-editor-component-for-visualforce.html
If you're using VisualForce, you can use the inputTextArea tag to edit/save rich text. Set the "richText" attribute to true.