SAPUI5:Wizard goToStep()方法不起作用
SAPUI5: Wizard goToStep() method is not working
我正在为我的公司项目使用SAPUI5向导,但由于某种原因,它对我不起作用。
这是我的代码:
var allSteps = oWizardElement.getSteps();
var stepOne = allSteps[0];
var stepTwo = allSteps[1];
var stepThree = allSteps[2];
if (iActiveStep === 1) {
oWizardElement.goToStep(stepThree, false);
}
运行完代码后,整个向导都崩溃了。包括带有步骤1、steo 2和步骤3按钮的标题都是关闭的。。。当我检查错误时,控制台上显示
/webapp/resources/sap/m/library-preload.json/sap/m/WizardProgressNavigator.js:6 Uncaught TypeError: Cannot read property 'setAttribute' of undefined
有人能告诉我我的代码出了什么问题吗?
以下是我在SAPUI5文档中找到的来源:https://sapui5.hana.ondemand.com/docs/api/symbols/sap.m.Wizard.html#getSteps
正如文档所说,您将需要激活的步骤。您应该已经达到"第三步",否则gotostep()将不起作用。
请记住,您必须在onRouteMatched或onAfterRendering函数中编写源代码
然后按照下面的代码进行操作。
var oFirstStep= this._wizard.getSteps()[0];
this._wizard.discardProgress(oFirstStep);
var oCurrStep = this.getView().byId(this._currentStep);//this._currentStep is step you want to nav to
this._wizard.setCurrentStep(oCurrStep);
相关文章:
- Meteor-添加用户自定义字段的方法不起作用
- 在 JQUERY 中创建 HTML 后,Jquery 方法不起作用
- 为什么这个扩展方法不起作用
- Splice()方法不起作用
- Angularjs-向工厂传递数据的方法不起作用
- Knockout和bread.js的take方法不起作用Paging
- javascript注入$http-post方法不起作用
- 为什么pulk()和where()方法不起作用
- Ajax get 方法不起作用
- 当我将javascript代码放在外部站点.js文件中时,Ajax页面方法不起作用
- getJSON 方法不起作用
- Jquery ajax get 方法不起作用
- jQuery AddClass 方法不起作用
- ScriptManager.RegisterStartupScript() 方法不起作用 - ASP.NET,C#
- 为什么JavaScript方法不起作用
- 为什么 findRandom() mongoose for node.js 方法不起作用
- BackboneJS的设置方法不起作用
- 从javascript调用 asp.net 页面方法不起作用
- 主干.js对以前的方法不起作用进行建模
- toExponential() 方法不起作用