簡體   English   中英

我需要手動設置WaveMaker LiveForm的dataOutput嗎?

[英]Do I need to manually set a WaveMaker LiveForm's dataOutput?

我通過從選定的網格項中獲取數據來手動設置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事件的函數未定義且為null。 我收到此錯誤消息:

Service Call Failed: .update JsonRpcService.js:410
invalid request; missing method or id: "{"params":[undefined,undefined,null],"method":"update","id":96332}"

所以我想知道,這是LiveForm的dataOutput嗎? 我需要手動設置嗎? 我不確定如果需要的話它想要什么值。

來自Wavemaker社區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 Kantor高級工程師; 為本研究

好吧,我正在嘗試做一些類似的事情,如果可以的話我會更新我的答案,但是最好檢查一下我發布的鏈接:)

問候和好運:)

編輯:

這有效,我在wm670中結帳

LiveForm附加到LiveVariable update功能可用於更新變量,而不是表單。 LiveForm有一個updateData方法。 現在,您可以獲取整個表單的編輯值,並使用dataOutput屬性將它們捆綁在一個變量中。 我相信這就是你在做什么。 但是我認為問題是,您正在調用方法update ,該update用於LiveVariable 因此,錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM