为重复的网格模板设置一些值时,我的本地orbeon 4.10CE正在删除该值。
原始标签:
<xf:instance xxf:readonly="true" xxf:exclude-result-prefixes="#all" id="repeater-template">
<repeater-iteration>
<control-5>TEST</control-5>
</repeater-iteration>
</xf:instance>
&#34>申请&#34;在Orbeon变为:
<xf:instance xxf:readonly="true" xxf:exclude-result-prefixes="#all" id="repeater-template">
<repeater-iteration>
<control-5/>
</repeater-iteration>
</xf:instance>
奇怪的是,将此表格粘贴到http://demo.orbeon.com/时效果很好。
这是4.10.2 PE和4.10 CE版本之间的问题还是我的服务器有问题?
以下整个表格:
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
<xh:head>
<xh:title>Untitled Form</xh:title>
<xf:model id="fr-form-model" xxf:expose-xpath-types="true">
<!-- Main instance -->
<xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all">
<form>
<section-1>
<repeater>
<repeater-iteration>
<control-5/>
</repeater-iteration>
</repeater>
</section-1>
</form>
</xf:instance>
<!-- Bindings -->
<xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
<xf:bind id="section-1-bind" name="section-1" ref="section-1">
<xf:bind id="repeater-bind" ref="repeater" name="repeater" readonly="false">
<xf:bind id="repeater-iteration-bind" ref="repeater-iteration" name="repeater-iteration">
<xf:bind id="control-5-bind" ref="control-5" name="control-5"/>
</xf:bind>
</xf:bind>
</xf:bind>
</xf:bind>
<!-- Metadata -->
<xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all">
<metadata>
<application-name>a</application-name>
<form-name>a</form-name>
<title xml:lang="en">Untitled Form</title>
<description xml:lang="en"/>
<singleton>false</singleton>
</metadata>
</xf:instance>
<!-- Attachments -->
<xf:instance id="fr-form-attachments" xxf:exclude-result-prefixes="#all">
<attachments>
<css mediatype="text/css" filename="" size=""/>
<pdf mediatype="application/pdf" filename="" size=""/>
</attachments>
</xf:instance>
<!-- All form resources -->
<!-- Don't make readonly by default in case a service modifies the resources -->
<xf:instance id="fr-form-resources" xxf:readonly="false" xxf:exclude-result-prefixes="#all">
<resources>
<resource xml:lang="en">
<control-5>
<label>repeater</label>
<hint/>
</control-5>
<section-1>
<label>Untitled Section</label>
</section-1>
</resource>
</resources>
</xf:instance>
<!-- Utility instances for services -->
<xf:instance id="fr-service-request-instance" xxf:exclude-result-prefixes="#all">
<request/>
</xf:instance>
<xf:instance id="fr-service-response-instance" xxf:exclude-result-prefixes="#all">
<response/>
</xf:instance>
<xf:instance xxf:readonly="true" xxf:exclude-result-prefixes="#all" id="repeater-template">
<repeater-iteration>
<control-5>TEST</control-5>
</repeater-iteration>
</xf:instance>
</xf:model>
</xh:head>
<xh:body>
<fr:view>
<fr:body xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:xbl="http://www.w3.org/ns/xbl">
<fr:section id="section-1-control" bind="section-1-bind">
<xf:label ref="$form-resources/section-1/label"/>
<fr:grid id="repeater-control" bind="repeater-bind" repeat="content" min="1"
template="instance('repeater-template')">
<xh:tr>
<xh:td>
<xf:input id="control-5-control" bind="control-5-bind">
<xf:label ref="$form-resources/control-5/label"/>
<xf:hint ref="$form-resources/control-5/hint"/>
<xf:alert ref="$fr-resources/detail/labels/alert"/>
</xf:input>
</xh:td>
</xh:tr>
</fr:grid>
</fr:section>
</fr:body>
</fr:view>
</xh:body>
</xh:html>
答案 0 :(得分:0)
模板由表单生成器自动生成,因此通过编辑源代码将任何内容放入其中是不安全的。
相反,使用“初始值”公式将该字段的初始值设置为'TEST'
(带引号),并设置“添加迭代时应用初始值公式”复选框,如下所述here