I created a form using Orbeon form builder, and i included in its form instance the content of an xml file using :
<xi:include href="oxf:/path/file.xml" xxi:omit-xml-base="true" />
When i save the form in form builder and edit it, i get a new form, and when i publish it and run it in form runner i get a blank page.
Can you tell me please what's wrong with the xi:include ?
If you want to include the whole content of an external file as the instance, use:
<xforms:instance id="main-model-instance" src="oxf:/path/file.xml"/>
Here we have the model instance xml in external file at /path/file.xml and we are using this file into our form and have named the model instance as id="main-model-instance"
If you need to add part of the instance from external file, then insert that piece dynamically during xforms-model-construct-done event, e.g.:
<xforms:action ev:event="xforms-model-construct-done">
<!-- Extracts the element some-section from file.xml and uses it as the
root element of the fr-form-instance -->
<xforms:insert context="instance('fr-form-instance')"
origin="doc('oxf:/path/file.xml')/root-element/some-section" />
</xforms:action>
Related
I'm new on ModX. I've created a template variable to input custom HTML into my page. I choose Rich Text as input type for this template variable.
On the other hand, my HTML contains some meta tag like <meta itemprop="name" content="myname"> tag with schema ( some custom attributes like <div class="review" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> )
So when I submit this data into page through template variable, I don't see that meta tag and custom attributes like itemprop, itemscope or script tag. They are removed or ignored by the editor.
Can someone tell me that how can I get rid from these issue? I will be great full for the help. Thanks.
There are two possible ways at least:
1) use textarea TV type instead rich text
2) it depends on your WYSIWYG editor, they allow you to exclude (not cut) the specified tags from processing
I'm working on custom control in Orbeon. In form builder, in settings there is a field called buttonName. Its value is supposed to show as a label of button visible in form runner.
I'm moving an old file that supposedly worked on old version of orbeon. I tried changing the way I refer to the value from form builder. Below I show old code, without my changes.
In form builder metadata I have declared input with ref:
<xbl:binding element="fr|custom-input" id="fr-custom-input-binding" xxbl:mode="lhha binding value">
<!-- Orbeon Form Builder Component Metadata -->
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder" xmlns:xf="http://www.w3.org/2002/xforms">
...
<control-details>
<xf:input ref="#buttonName">
...
Further on, there is a var to that binding
<xf:var name="binding" value="xxf:binding('fr-custom-input-binding')"/>
Finally, the reference in form runner:
<xf:trigger class="xbl-fr-custom-input-trigger">
...
<xf:label value="$binding/#buttonName"></xf:label>
</xf:trigger>
You want to access an attribute on the control itself:
<fr:custom-input buttonName="Your value">
This in contract to an attribute that you could have on the element the control is bound to, which is what $binding points to. So $binding/#buttonName is not the right expression to use here. Instead, inside your , you want to have:
<xf:var name="buttonName" xbl:attr="xbl:text=buttonName"/>
Then you can refer in XPath to the value of the attribute as $buttonName.
When accessing the Form Builder summary, which lists the forms I currently have access to, I see the search API is called with
<query name="application-name"
path="xh:head[1]/xf:model[#id = 'fr-form-model'][1]/xf:instance[#id = 'fr-form-metadata']/*[1]/application-name[1]"
inline-label="" type="xs:string" control="output"
search-field="true" summary-field="true" match="substring" />
How/where is the path expression built?
It is built by the Form Runner summary page, the same way for Form Builder as for other forms, looking for elements with the fr-summary class.
So the summary page can find those element, Form Builder has hidden outputs with that class.
Those outputs reference real binds in Form Builder's model.
Form Runner's summary page builds the path expression by going through the ancestors of the bind mentioned in the previous points, and building and building an expression concatenating the ref on those binds.
How can we send hint of Single-Line Text component, like xml attributes in Orbeon Form Builder to data.xml?
For example:
hint: first-name="Erik" last-name="Bruchez" email="info#orbeon.com"
<?xml version="1.0" encoding="utf-8" ?>
<form>
<contact first-name="Erik" last-name="Bruchez" email="info#orbeon.com" />
</form>
Now send button generate data.xml like :
<contact>
<first-name>Erik</first-name>
<last-name>Bruchez</last-name>
<email>info#orbeon.com</email>
<phone>6505555555</phone>
</contact>
Or maybe is there some ways to define data.xml attributes from Form Builder?
It look to me like you're trying to bind a control to an attribute (/form/contact/#first-name), instead of an element (/form/contact/first-name). You can do this if you write XForms by hand, but not if you're creating the form with Form Builder. With Form Builder, the structure of the XML used to collect the data is automatically created for you by Form Builder.
If this XML needs to go to another system that expects data in a different format, then you can, on submission, implement your own service to which the data is sent, and you can do the transformation in that service, for instance using XSLT.
I have a ApplicationBarIconButton which I use repeatedly on multiple pages.
I want to be able to define the Click action in my Application C# file.
I have
<Application.Resources>
<shell:ApplicationBarIconButton
x:Key="AddLocationAppBarIconBut"
IconUri="/icons/appbar.add.rest.png"
Text="location"
Click="Add_Location_Event" />
in my App.xaml file and I want to load it into another page I have under
<phone:PhoneApplicationPage.ApplicationBar>
How do I go about this exactly?
Can I bind a click event to an event in my Application cs file?
Unfortunately, you can't!
In full WPF framework, you'd be able to do something like this:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar>
<shell:ApplicationBar.Buttons>
<StaticResource ResourceKey="AddLocationAppBarIconBut" />
</shell:ApplicationBar.Buttons>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
The trick here is in the usage of StaticResource, but Silverlight doesn't have a backing class representation like that; you can only use the Markup Extension as {StaticResource AddLocationAppBarIconBut}, but this won't help you here!
What you can is define the full ApplicationBar object as a resource and then just call it on the page like this:
<phone:PhoneApplicationPage ApplicationBar="{StaticResource ApplicationBarResource}">
<!-- remaining code -->
<phone:PhoneApplicationPage />