2
以下有關運行xforms-with-java-applications Orbeon文檔, 我單獨部署Orbeon戰爭文件在JBoss上我的Java戰爭旁邊。訪問Orbeon第二XForms實例
我試圖創建一個模型內2個實例
<xforms:model id="fr-form-model">
<xforms:instance id="don-instance1">
<don>
<laptop>
</laptop>
</don>
</xforms:instance>
<xforms:instance id="don-instance2">
<don2>
<laptop2>
</laptop2>
</don2>
</xforms:instance>
</xforms:model id="fr-form-model">
我似乎無法從
<xforms:input ref="instance('don-instance')/don/laptop2">
<xforms:label>Enter a Name:</xforms:label>
</xforms:input>
訪問第二XForms實例訪問第一XForms實例是精細的,只要我不使用實例()函數
<xforms:input ref="/don/laptop">
<xforms:label>Enter a Name:</xforms:label>
</xforms:input>
不知何故實例()方法不工作,因爲我期望,我錯過了什麼?
修訂完成XML:
<xhtml:html
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>
<xhtml:head>
<xhtml:title>Simple</xhtml:title>
<xforms:model >
<xforms:instance id="don-instance1">
<don1>
<laptop1>
</laptop1>
</don1>
</xforms:instance>
<xforms:instance id="don-instance2">
<don2>
<laptop2>
</laptop2>
</don2>
</xforms:instance>
<xforms:submission id="submit_metadata" action="../processor.jsp" method="post"/>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xforms:input ref="instance('don-instance1')/don1/laptop1">
<xforms:label class="composers-label">Laptop1: </xforms:label>
<xhtml:br />
</xforms:input>
<xforms:input ref="instance('don-instance2')/don2/laptop2">
<xforms:label class="composers-label">Laptop2: </xforms:label>
<xhtml:br />
</xforms:input>
<xhtml:br />
<xhtml:br />
<xforms:submit submission="submit_metadata">
<xforms:label class="composers-label">Submit</xforms:label>
</xforms:submit>
<xhtml:br />
<fr:xforms-inspector/>
</xhtml:body>
</xhtml:html>
哎呀, 我的錯。我修改了xml並添加了我的完整測試xml,但仍然無法正確使用instance()方法 – portoalet
答案中給出的代碼是否有效? – Jayy
不,它沒有工作,它是否適合你? – portoalet