|
发表于 2016-6-30 16:23:43
|
显示全部楼层
1.KSQL中可以通过SQL.调用数据库本地函数
2.如果是自己定义的action,把数据返回给bizData,可以在js中调用action,然后把返回结果loadData给bizData
action的返回类型要用Table
如下:action中对应的java的定义(table中还可以通过参数设置分页等http://bbs.wex5.com/forum.php?mod=viewthread&tid=38364)
- public static Table loadData() {
-
- String sql = "select fID, fName ,fCode,fRQ, fRQSJ from AP_RQ ";
- HashMap<String,String> sqlMap = new HashMap<String,String>();
-
- sqlMap.put(DatabaseProduct.ORACLE.name(),sql);
-
- Table table = SQL.select(sqlMap,null,"/appdemo/test/data");
- table.getProperties().put(Table.PROP_NAME_ROWID, "FID");
- return table;
- }
复制代码 js中调用
- var data = this.comp("data1");
- biz.Request.sendBizRequest({
- "context" : me.getContext(),
- "action" : "loadDataAction",
- "callback" : function(callbackData) {
- callbackData.ignoreError = false;
- if (callbackData.state) {
- var rows = callbackData.response.rows;
- if (rows.length > 0) {
- for (var i = 0; i < rows.length; i++) {
- var fName = rows[i].fName.value;
- }
- }
- data.loadData(callbackData.response);
- }
- }
- });
复制代码
3.执行慢的问题把\runtime\BusinessServer\WEB-INF\justep.xml中的<db-paging>false</db-paging> 改为
<db-paging>true</db-paging> 然后重启tomcat服务
|
|