我是xforms的新手 - 使用Orbeon Form Builder 3.8 PE。我已经阅读了有关高级xbl控件的信息,例如'Alert Dialog'和'Datatable'。这些在我的应用程序中非常有用,但我无法弥合我在如何实现它们方面的知识差距。
似乎我需要在某个地方添加一个属性来获取它们在工具箱中;或者我需要直接向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>
答案 0 :(得分:2)
你可以在wiki上找到的关于XBL的文档适用于那些手工编写XForms的人,以及想要use XBL components或write their own XBL component的人,而不是将XBL组件添加到Form Builder中
话虽如此,您当然可以将XBL组件添加到表单生成器,但这需要您更改组件的来源,对于某些组件,甚至可能更改表单生成器本身。这是“高级Orbeon Forms开发人员”的任务,但嘿,谁说你不是一个人,或者不会很快成为一个人?只是给你一些指示:
oxf.fb.toolbox.group.*
属性引用的。默认值在properties-form-builder.xml
中定义,您可以在自己的properties-local.xml
。<fr:button>
。xs:dateTime
形式2010-11-12T10:16:36.209-08:00
的节点。我们需要超越这一个组件/一个值映射,以获取可以保存更丰富数据的组件,例如数据表。