问题描述
如果使用以下配置(本地属性)提交表单,我将尝试隐藏保存按钮:
// upload function
const UploadImg = async (img: any) => {
// img from react-native-image-crop-picker
const fromData = new FormData();
fromData.append('file',`${img.data}`);
return fetch(`${API_URL_R}/upload`,{
method: 'POST',body: fromData,// this should be binary
})
};
// use
// import ImagePicker from 'react-native-image-crop-picker'
ImagePicker.openPicker({
width: 300,height: 400,cropping: true,includeBase64: true,}).then(async image => {
await UploadImg(image);
});
我也尝试过类似的东西:
<property as="xs:string" name="oxf.fr.detail.button.save-draft.visible.*.*">
xxf:instance('fr-workflow-stage-value') = "submitted"
</property>
或:
xxf:instance('fb-form-instance')/xh:head/xf:model[@id = 'fr-form-model']/xf:bind[@id = 'fr-form-binds']/readonly = "true"
但是他们没有工作。那么我可以得到任何建议吗?
解决方法
您没有说明您使用的是哪个 Orbeon Forms 版本,但目前没有名为 fr-workflow-stage-value
的内部实例,这可能解释了为什么这不起作用。自 Orbeon Forms 2020.1 起,执行此操作的正确方法是使用 fr:workflow-stage-value()
函数。