我通过从选定的网格项抓取数据来手动设置LiveForm的dataSet。然后,我将使用该数据设置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的dataOutput的问题吗?我需要手动设置吗?我不知道它想要什么价值,如果它想要的话。
发布于 2015-03-29 19:12:51
我引用一下波发生器社区http://dev.wavemaker.com/forums/?q=node/3703#comment-12466的话:
(在数据库中插入数据)
在liveform中设置各个小部件
this.nameEditor1.setDataValue("hello");
this.startDateEditor1.setDataValue(new Date().getTime());
this.empLiveForm.insertData();Michael高级工程师;WaveMaker
嗯,我正在尝试做一些类似的工作,如果我的工作我会更新我的答案,但更好地查看我张贴的链接:)
问候并祝好运:)
编辑:
这是可行的,我在wm670中结帐。
发布于 2014-08-04 22:43:31
LiveForm附在LiveVariable上。update函数可用于更新变量,而不是表单。LiveForm有一个方法updateData。现在,您可以获取整个表单的编辑值,并使用dataOutput属性将它们捆绑在一个变量中。我相信你就是这么做的。但我认为问题是,您正在调用update方法,这是用于LiveVariable的方法。因此出现了错误。
https://stackoverflow.com/questions/23297305
复制相似问题