使用文本字段值编辑器,我添加一个带有条件的文本到文本字段(注意 if 是使用 JasperSoft studio 的字段编辑器构建的,因此代码 IF(...) 是自动生成的,我只给出了值“pippo”并且“冥王星”)
"Some value" +IF(true,"pippo","pluto")
Run Code Online (Sandbox Code Playgroud)
但似乎不起作用。从我的代码调用报告时出现此错误:
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The method IF(boolean, String, String) is undefined for the type
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激
我正在研究一些 TypeScript,所以我尝试创建一个小示例,其中包含一个简单的模式窗口,当用户单击按钮时应该出现该窗口。该示例非常类似于: https://www.w3schools.com/bootstrap/tryit.asp ?filename=trybs_ref_js_modal_js&stacked=h
html 页面包含(只是完整代码的摘录)一个简单的 Bootstrap 模式
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
然后我尝试简单地附加一个单击事件并使用 jquery 尝试显示模式(类型脚本文件):
import * as $ from "jquery";
$(document).ready(function(){
console.log("Document ready!!");
$("#myBtn").click(function(){
($("#myModal")).modal({backdrop: true});
});
});
Run Code Online (Sandbox Code Playgroud)
我有一个错误:
[ts] 类型“JQuery”上不存在属性“modal”。
显然,错误已使用解决<any>$("#myModal")(但我们失去了类型)
$(document).ready(function(){
console.log("Document ready!!");
$("#myBtn").click(function(){ …Run Code Online (Sandbox Code Playgroud)