在模式对话框中,当用户单击ok时,我必须在现有实例中插入不同的“模板”实例。要插入的模板实例的数量取决于另一个节点集中的元素数量。我试着用这种方式实现这个行为:
<xforms:trigger>
<xforms:label>OK</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:repeat nodeset="$currentBranche/../../Eleves/Eleve">
<xforms:insert context="instance('examen-template')/Notes" nodeset="Note" at="1" position="before" origin="instance('note-template')"/>
</xforms:repeat>
<xforms:insert context="$currentBranche/Examens" nodeset="Examen" at="1" position="before" origin="instance('examen-template')"/>
<xxforms:hide dialog="create-examen"/>
</xforms:action>
</xforms:trigger>我得到了以下错误:Invalid action: {http://www.w3.org/2002/xforms}repeat
这是否意味着我不能在xforms:action中使用xforms:repeat?如果是这种情况,我如何实现所需的行为?
发布于 2012-12-17 09:04:34
正如阿兰提到的,xforms:repeat是一个用户界面元素,不能在动作中使用。
相反,在支持它的实现中使用XForms 2.0 iterate属性。自this commit from March 10, 2012以来的Orbeon Forms版本都支持它。如果您正在使用Orbeon Forms3.9或2012年3月10日之前的版本,请使用xxforms:iterate扩展。
发布于 2012-12-16 23:28:40
您可以在Orbeon2.0 (The iterate attribute)中使用@iterate来代替xforms:repeat,它至少已经在XForms中实现为xxforms:iterate:More powerful XForms actions thanks to iterations
-Alain
https://stackoverflow.com/questions/13900192
复制相似问题