我正在尝试通过按钮功能获取参数addCallbackElement
。但我收到以下错误:
遇到错误:TypeError:无法读取未定义的属性“nameRegister”
----------
function **createUserPanel**(e){
var ss = SpreadsheetApp.openById(LOGS_SHEET_ID);
var app = UiApp.getActiveApplication();
var absolutePanelReg = app.createAbsolutePanel().setId("absolutePanelReg");
var verticalPanelReg = app.createVerticalPanel().setId("verticalPanelReg");
var mainPanelReg = app.createHorizontalPanel().setId("mainPanelReg");
----------
var lbNameRegister = app.createLabel().setText("Name of user: ");
var nameRegister = app.createTextBox().setId("nameRegister").setName("nameRegister");
var botonSend = app.createButton().setText("Send");
var handlerRegister = app.createServerHandler("createUser")**.addCallbackElement**(verticalPanelReg);
botonSend.addClickHandler(handlerRegister);
----------
verticalPanelReg.add(lbNameRegister);
verticalPanelReg.add(nameRegister);
mainPanelReg.add(verticalPanelReg);
absolutePanelReg.add(mainPanelReg);
app.add(absolutePanelReg);
return app;
};
----------
function **createUser**(e){
/*var nameRegister ="test";*/
var nameRegister = e.paramater.nameRegister;
.......
};