I've got this binding to the output field:
<xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
<xf:bind id="Pokoj-bind" ref="dok:Pokoj" name="Pokoj" />
</xf:bind>
<xh:body>
<xh:td>
<xf:output id="Pokoj-control" value="concat('Pokój ',xxf:repeat-position())"
bind="Pokoj-bind">
<xf:label ref="$form-resources/Pokoj/label"/>
<xf:hint ref="$form-resources/Pokoj/hint"/>
<xf:alert ref="$fr-resources/detail/labels/alert"/>
</xf:output>
</xh:td>
</xh:body>
but value of the output it's not saved to the model I would be grateful for any kind of help how to bind value of this to the model.
Unlike an xf:input
that can also "write" a value to its bound node, say when users change the value in the input field, an xf:output
just reads a value from its bound node, or shows a value coming from the value="..."
attribute, as you did here. But the fact that you have a bind="..."
on the xf:output
in addition to the value="..."
doesn't get the xf:output
to write that value into the bound node.
Typically, you would achieve this by moving expression you now have on the xf:output value="..."
to an xf:bind calculate="..."
. In your case, you can't do exactly that, as the xxf:repeat-position()
won't work in the model. So you'll most likely need to write something like calculate="concat('Pokój ',count(preceding-sibling::dok:Pokoj))"
.