如何将数据表 xbl 控件实现到 Orbeon Form Builder Xform
我是 xforms 的新手 - 使用 Orbeon Form Builder 3.8 PE。我读过有关高级 xbl 控件的内容,例如“警报对话框”和“数据表”。这些在我的应用程序中非常有用,但我无法弥合我在如何实现它们方面的知识差距。
看来我需要在某处添加一个属性才能将它们放入工具箱中;或者我需要直接将代码添加到 xform 中。 Orbeon 示例显示的片段让我认为是后者/但是,这些示例脱离了上下文 - 不知道使用哪些标签来夹住这些东西,也不知道如何在稍后的操作等中引用它们。
提前致谢。 [编辑:每个评论下面的代码] 账单
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xhtml:head>
<xhtml:title>Operations</xhtml:title>
<xforms:model id="fr-form-model">
<xforms:instance id="fr-form-instance">
<form>
<section-1>
<control-1/>
<control-2/>
</section-1>
<section-2/>
<control-3/>
</form>
</xforms:instance>
<xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
<xforms:bind id="section-1-bind" nodeset="section-1">
<xforms:bind id="control-1-bind" name="control-1" nodeset="control-1"/>
<xforms:bind id="control-2-bind" name="control-2" nodeset="control-2"/>
</xforms:bind>
<xforms:bind id="section-2-bind" nodeset="section-2">
<xforms:bind id="control-3-bind" name="control-3" nodeset="control-3"/>
</xforms:bind>
</xforms:bind>
<xforms:instance id="fr-form-metadata" xxforms:readonly="true">
<metadata>
<application-name>KENAN_TOOLKIT</application-name>
<form-name>operations-process</form-name>
<title xml:lang="en">Operations</title>
<description xml:lang="en"/>
<author/>
<logo mediatype="image/jpeg" filename="optimum-lightpath-logo-810x141.JPG"
size="14799">/fr/service/oracle/crud/orbeon/builder/data/3978eab19d9c6ccd8c65a787aa1864c4/541ca86ada859805464573ca539d6327.JPG</logo>
</metadata>
</xforms:instance>
<xforms:instance id="fr-form-attachments">
<attachments>
<css mediatype="text/css" filename="" size=""/>
<pdf mediatype="application/pdf" filename="" size=""/>
</attachments>
</xforms:instance>
<xforms:instance id="fr-form-resources" xxforms:readonly="false">
<resources>
<resource xml:lang="en">
<section-1>
<label>EBF</label>
<help/>
</section-1>
<control-1>
<label/>
<hint/>
<help/>
<alert/>
</control-1>
<control-2>
<label/>
<hint/>
<help/>
<alert/>
</control-2>
<section-2>
<label>Archive</label>
<help/>
</section-2>
<control-3>
<label/>
<hint/>
<help/>
<alert/>
</control-3>
</resource>
</resources>
</xforms:instance>
<xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
<request/>
</xforms:instance>
<xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
<response/>
</xforms:instance>
<xforms:instance id="testsvc-instance" class="fr-database-service"
xxforms:exclude-result-prefixes="#all">
<body><sql:config xmlns:sql="http://orbeon.org/oxf/xml/sql">
<sql:datasource>orbeonedmDS</sql:datasource>
<sql:query>SELECT n.node_id as id, n.node_name_tid as name, n.sw_ver as ver, m.model_name as model FROM techmgr.node n, techmgr.model m WHERE n.model_id = m.model_id and rownum between 0 and 100</sql:query>
</sql:config></body>
</xforms:instance>
<xforms:submission id="testsvc-submission" class="fr-database-service"
ref="instance('fr-service-request-instance')"
resource="/fr/service/custom/orbeon/database"
method="post"
serialization="application/xml"
replace="instance"
instance="fr-service-response-instance"/>
<xforms:action id="pop-test-binding">
<xforms:action ev:event="xforms-ready" ev:observer="fr-form-model">
<xforms:send submission="testsvc-submission"/>
</xforms:action>
<xforms:action ev:event="xforms-submit" ev:observer="testsvc-submission">
<xxforms:variable name="request-instance-name" select="'testsvc-instance'" as="xs:string"/>
<xforms:insert nodeset="instance('fr-service-request-instance')"
origin="saxon:parse(instance($request-instance-name))"/>
<xforms:action context="instance('fr-service-request-instance')">
</xforms:action>
</xforms:action>
<xforms:action ev:event="xforms-submit-done" ev:observer="testsvc-submission"
context="instance('fr-service-response-instance')">
</xforms:action>
</xforms:action>
</xforms:model>
</xhtml:head>
<xhtml:body>
<fr:view>
<xforms:label ref="instance('fr-form-metadata')/title"/>
<fr:body>
<fr:section id="section-1-section" bind="section-1-bind">
<xforms:label ref="$form-resources/section-1/label"/>
<xforms:help ref="$form-resources/section-1/help"/>
<fr:grid columns="2">
<xhtml:tr>
<xhtml:td>
<xforms:input id="control-1-control" bind="control-1-bind">
<xforms:label ref="$form-resources/control-1/label"/>
<xforms:hint ref="$form-resources/control-1/hint"/>
<xforms:help ref="$form-resources/control-1/help"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
</xforms:input>
</xhtml:td>
<xhtml:td/>
</xhtml:tr>
<xhtml:tr>
<xhtml:td>
<xforms:input id="control-2-control" bind="control-2-bind">
<xforms:label ref="$form-resources/control-2/label"/>
<xforms:hint ref="$form-resources/control-2/hint"/>
<xforms:help ref="$form-resources/control-2/help"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
</xforms:input>
</xhtml:td>
<xhtml:td/>
</xhtml:tr>
</fr:grid>
</fr:section>
<fr:section id="section-2-section" bind="section-2-bind">
<xforms:label ref="$form-resources/section-2/label"/>
<xforms:help ref="$form-resources/section-2/help"/>
<fr:grid columns="1">
<xhtml:tr>
<xhtml:td>
<fr:datatable scrollable="both" width="800px" height="500px">
<thead>
<tr>
<th fr:sortable="true" fr:resizeable="true">ID</th>
<th fr:sortable="true" fr:resizeable="true">Name</th>
<th fr:sortable="true" fr:resizeable="true">Version</th>
<th fr:sortable="true" fr:resizeable="true">Model</th>
</tr>
</thead>
<tbody>
<xforms:repeat nodeset="/testsvc:response/testsvc:row">
<tr>
<td>
<xf:output value=""/>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</xforms:repeat>
</tbody>
</fr:datatable>
</xhtml:td>
</xhtml:tr>
</fr:grid>
</fr:section>
</fr:body>
</fr:view>
</xhtml:body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 wiki 上找到有关 XBL 的文档,该文档面向手动编写 XForms 以及想要使用 XBL 组件 或 编写自己的 XBL 组件,而不是将 XBL 组件添加到 Form Builder。
话虽这么说,您当然可以将 XBL 组件添加到 Form Builder,但这需要您更改组件的源,对于某些组件,甚至可能更改 Form Builder 本身。这是“高级 Orbeon Forms 开发人员”的一项任务,但是嘿,谁说您不是其中之一,或者不会很快成为其中之一?只是给您一些提示:
properties-form-builder.xml
,您可以在自己的properties-local.xml
中覆盖它。
。关于在 Form Builder 中支持 Orbeon 数据表的想法
2010- 形式的
。对于可以容纳更丰富数据(例如数据表)的组件,我们需要超越这一单组件/单值映射。xs:dateTime
的节点。 11-12T10:16:36.209-08:00The documentation about XBL you'll find on the wiki is geared towards people who write XForms by hand, and who would like to either use XBL components or write their own XBL component, rather than add XBL components to Form Builder.
This being said, you can certainly add XBL components to Form Builder, but that will require you to change the source of the components, and for some components, maybe even change Form Builder itself. This is a task for "advanced Orbeon Forms developers", but hey, who said you aren't one, or won't become one very quickly? Just to give you a few pointers:
oxf.fb.toolbox.group.*
properties. The default is defined inproperties-form-builder.xml
and you can override this in your ownproperties-local.xml
.<fr:button>
.Ideas about supporting the Orbeon datatable in Form Builder
xs:dateTime
of the form2010-11-12T10:16:36.209-08:00
. We'll need to go beyond this one component / one value mapping for components which can hold richer data, like the datatable.