单选按钮框需要选择3个按钮时怎么判断跳转到哪一个报表呀?之前做过两个选择的。




FineReport 小八路小八路 发布于 2020-9-17 14:55 (编辑于 2020-10-16 09:14)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
ColdmanLv6高级互助
发布于2020-9-17 15:53(编辑于 2020-9-17 15:58)
var a = this.getValue();
if (a == 1) {
	window.location = FR.cjkEncode("${servletURL}?viewlet=doc/JS/JS实现排序功能.cpt");
} else if (a == 2) {
	window.location = FR.cjkEncode("${servletURL}?viewlet=doc/JS/js实现时钟效果.cpt")
} else {
	window.location = FR.cjkEncode("${servletURL}?viewlet=doc/JS/按钮点击修改颜色.cpt")
}

WorkBook102.cpt

看了一下,你的错误应该是出在判断值上面了。a=1是赋值,判断应该是用a==1。

2020-09-17_15-55-29.gif

最佳回答
0
snrtuemcLv8专家互助
发布于2020-9-17 14:58

做if判断啊,取到单选按钮值,然后判断

var a=this.getValue();

if(a=1){你的代码}

else  if(a=2){你的代码}

else{你的代码}

  • 小八路小八路 小八路小八路(提问者) 做if判断啊,取到单选按钮值,然后判断 var a=this.getValue(); if(a=1){window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE_Subtotal.frm\");} else if(a=2){window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE - Production.frm\");} else{window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE - Eng.frm\");} 我按照你的结构填,报错误了
    2020-09-17 15:11 
  • snrtuemc snrtuemc 回复 小八路小八路(提问者) 什么错误,在参数面板, var a=this.options.form.getWidgetByName(\"ss\").getValue();//取实际值,ss为你控件名
    2020-09-17 15:14 
  • 小八路小八路 小八路小八路(提问者) 回复 snrtuemc 我也不知道是什么错误,现在是无法跳转页面 //做if判断啊,取到单选按钮值,然后判断 //var a=this.getValue(); var a=this.options.form.getWidgetByName(\"radioGroup0\").getValue(); if(a=1){window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE_Subtotal.frm\");} else if(a=2){window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE - Production.frm\");} else{window.location = FR.cjkEncode(\"${servletURL}?viewlet=SMEC REPORT/Manufacturing Report/Shift Performance Indices Report/Shift Move Performance Report/SHIFT_MOVE - Eng.frm\");}
    2020-09-17 15:24 
  • 3关注人数
  • 378浏览人数
  • 最后回答于:2020-10-16 09:14
    请选择关闭问题的原因
    确定 取消
    返回顶部