xpath 式を変更してからサブフォームをロードするトリガーをクリックするなど、異なるデータノードでサブフォームを呼び出して、サブフォームを再利用しようとしています。
そのためにバインディング要素を作成しましたが、動的に変更することはできません。インスタンス ノードの値を変更する方法を知っているので、バインド要素がノードを指すようにしますが、機能しません。このようなもの:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
<xf:model xmlns="">
<xf:instance>
<tmp>
<configuration uri="/tmp/props"/>
<props>
<prop id="demo id 1" value="demo value1"/>
<prop id="demo id 2" value="demo value2"/>
</props>
</tmp>
</xf:instance>
<xf:bind id="dynamicNodeset" nodeset="string(/tmp/configuration/@uri)"/>
</xf:model>
</head>
<body>
<xf:repeat bind="dynamicNodeset">
<xf:output ref="prop/@id"/>
<xf:input ref="prop/@value" class="xforms-value"/>
</xf:repeat>
</body>
</html>
私もこれを試しましたが成功しませんでした:
<xf:bind id="dynamicNodeset" nodeset="/tmp/configuration/@uri[string()]"/>
Any idea how can I achieve this?
また、Jsを介して:
function changeBinding(modelId, bindId, newNodeset){
var model = document.getElementById(modelId).xfElement;
window.XsltForms_globals.openAction("XsltForms_change");
model.binds[0].nodeset = newNodeset;
model.setRebuilded(true);
model.addChange(bind);
window.XsltForms_globals.addChange(model);
window.XsltForms_globals.closeAction("XsltForms_change");
window.XsltForms_globals.refresh();
}
前もって感謝します。