【发布时间】:2018-01-22 10:20:42
【问题描述】:
我创建了一个带有选择框和一些列表项的类。要更改这些项目的标签,我将选择框控制器的委托设置为 configureItem。
知道我想添加这些类的一些子元素并将一些项目添加到列表中。现在我必须通过调用 configureItem 中的函数来调整configureItem。这个函数检查项目是否在当前类中,如果不是,我调用处理他的项目标签的超类方法。
运行良好的是 Qooxdoo 5.0.2。现在我改用 Qooxdoo 6 来使用新的编译器,但在调用超类方法时出现错误:Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them。
这里有一些代码 sn-ps:
//Set Delegate in superclass
this.operatorController.setDelegate({
configureItem : function(item) {
that.operatorDelegateItems(item, that);
}
});
// Superclass Method
operatorDelegateItems : function(item, that) {
switch (item.getLabel()) {
case "":
item.setLabel(qx.locale.Manager.tr("Ist Vorhanden"));
break;
case "-":
item.setLabel(qx.locale.Manager.tr("Ist nicht Vorhanden"));
break;
case "Nachfolger":
item.setLabel(qx.locale.Manager.tr("Zeige Nachfolger"));
break;
}
}
// Child class Delegate FUnction
operatorDelegateItems : function(item, that) {
if (item.getLabel() == "Period")
item.setLabel("Jahresintervall");
else
that.base(arguments, item);
}
有人可以帮我解决这个问题还是有更好的方法来解决我的问题?
【问题讨论】:
-
错误是指
arguments.caller和arguments.callee在严格模式下不可用(Qooxdoo 6 应用程序使用),您的 sn-p 不使用它,所以我需要更多信息。请您在操场上提供一个工作示例(qooxdoo.org/current/playground)?
标签: inheritance qooxdoo