some problems with SetItemValue function

Hi all.
Please, help.


var win = dhxWins.createWindow(“sms_send”, 0, 0, 700, 380);
win.setText(“СМС рассылка”);

var layout = win.attachLayout(“2U”);
layout.cells(“a”).setText(“Some text”);
layout.setCollapsedText(“a”, “”);
layout.cells(“b”).setText(“Some text”);
layout.setCollapsedText(“b”, “”);

var form = layout.cells(“a”).attachForm();
form.attachEvent(“onButtonClick”, function(){
form.SetItemValue(“phone”, “NEW INPUT VALUE”); - PROBLEMS HERE!!!

When I press the button occurs of nothing, in the field of input “phone” there is no text.
What do I do incorrectly? Please? help!!!

Please, help somebody.

Change you code as

form.loadStruct("common/form_sms.xml", function(){
    form.attachEvent("onButtonClick", function(){	
    form.SetItemValue("phone", "NEW INPUT VALUE");

loading is async

Stanislav, Unfortunately, it hasn’t helped to solve a problem, doesn’t work.
Please help!
I don’t understand, in what a problem

var form = layout.cells(“a”).attachForm();
form.loadStruct(“common/form_sms.xml”, function(){
form.attachEvent(“onBeforeChange”, function(id, old_value, new_value) {
alert(id + " oldvalue= " + old_value + " newvalue= " + new_value);
return true;
form.attachEvent(“onButtonClick”, function(){
form.SetItemValue(“phone”, “SOME NEW VALUE”);

Problem with installation of the text in the field of input, in two different places, please help! See code in file.

Please, help somebody.

The correct name of method is setItemValue - case is matter … titemvalue

Stanislav, thanks a lot.
Now, all works.