Javascript 我是否需要手动设置WaveMaker LiveForm';什么是数据输出?
我通过从选定的网格项中获取数据,手动设置LiveForm的Javascript 我是否需要手动设置WaveMaker LiveForm';什么是数据输出?,javascript,wavemaker,Javascript,Wavemaker,我通过从选定的网格项中获取数据,手动设置LiveForm的数据集。然后我使用这些数据设置LiveForm的编辑器。看起来是这样的: getCurrentItem: function() { var item = this.grid_items.selectedItem.getData().related_item; this.liveForm_editItem.setDataSet(item); this.item_nameEditor2.set
数据集。然后我使用这些数据设置LiveForm的编辑器。看起来是这样的:
getCurrentItem: function() {
var item = this.grid_items.selectedItem.getData().related_item;
this.liveForm_editItem.setDataSet(item);
this.item_nameEditor2.setValue("displayValue", item.item_name);
this.item_nameEditor2.setValue("dataValue", item.item_name);
this.item_priceEditor2.setValue("displayValue", item.item_price);
this.item_priceEditor2.setValue("dataValue", item.item_price);
}
该函数将附加到LiveForm的onBeginUpdate
事件,以便在您编辑编辑器时预加载数据。这个很好用。我的问题是,当我试图保存表单时,我附加到onBeforeServiceCall
事件的函数未定义且为空。我收到以下错误消息:
Service Call Failed: .update JsonRpcService.js:410
invalid request; missing method or id: "{"params":[undefined,undefined,null],"method":"update","id":96332}"
所以我想知道,这是LiveForm的数据输出的问题吗?我需要手动设置吗?如果它想要任何值,我不确定它想要什么值。一个LiveForm
附加到一个LiveVariable
。update
功能可用于更新变量,而不是表单。
LiveForm
有一个方法。
现在,您可以使用dataOutput
property获取整个表单的编辑值,并将它们绑定到单个变量中。我相信这就是你正在做的。但我认为问题是,您正在调用方法update
,该方法用于LiveVariable
。因此出现了错误。我引用wavemaker社区的话:
(在现有数据库中插入数据)
在liveform中设置各个小部件
高级工程师迈克尔·坎特;造波机
嗯,我正在尝试做一些类似的工作,如果有的话,我会更新我的答案,但最好查看我发布的链接:)
祝你好运:)
编辑:
这是可行的,我在wm670结账
this.nameEditor1.setDataValue("hello");
this.startDateEditor1.setDataValue(new Date().getTime());
this.empLiveForm.insertData();