Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用特定节点的计算属性,该节点可编辑以获得最初的默认值。当控件最初加载时,根据该特定节点的计算属性填充默认值。但是当我覆盖默认值时,被覆盖的值不会绑定到该节点。这个问题有什么解决办法吗?
是的,您可以允许用户编辑您有计算的节点的值。为此,在 中xforms:bind,显式添加readonly="false()", 作为您指定的节点 acalculate自动变为只读。如果您这样做,请记住calculate在用户编辑字段后也会运行,因此需要以不会覆盖用户输入的值的方式编写表达式。通常你会做类似:的事情calculate="if (. = '') then {some expression} else .",如果用户确实输入了某些内容,则不要覆盖他们输入的内容。
xforms:bind
readonly="false()"
calculate
calculate="if (. = '') then {some expression} else ."