ADF修改默认filter查询将%改为%%方式
来源:互联网 发布:枸杞 怎么泡水 知乎 编辑:程序博客网 时间:2024/04/29 22:21
public static void customQuery(QueryEvent queryEvent,String queryProcess){ FilterableQueryDescriptor queryDescriptor = (FilterableQueryDescriptor) queryEvent.getDescriptor(); ConjunctionCriterion cc = queryDescriptor.getFilterConjunctionCriterion(); List<Criterion> lc = cc.getCriterionList(); for(Criterion cr : lc){ AttributeDescriptor attr = ((AttributeCriterion) cr).getAttribute(); Object value = ((AttributeCriterion) cr).getValue(); if(attr.getType().equals(String.class)){ if(value != null){ ((AttributeCriterion) cr).setValue("%" + value + "%"); } } } invokeEL(queryProcess,new Class[]{QueryEvent.class},new Object[]{queryEvent}); for(Criterion cr : lc){ AttributeDescriptor attr = ((AttributeCriterion) cr).getAttribute(); Object value = ((AttributeCriterion) cr).getValue(); if(attr.getType().equals(String.class)){ if(value != null){ ((AttributeCriterion) cr).setValue(value.toString().replace("%", "")); } } } } public static Object invokeEL(String el, Class[] paramTypes,Object[] params){ FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext eLContext = facesContext.getELContext(); ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory(); MethodExpression exp = expressionFactory.createMethodExpression(eLContext, el, Object.class, paramTypes); return exp.invoke(eLContext, params); }
调用的地方为以下,比如通过一个按钮点击事件,其中queryProcess参数为table组件中queryListener属性的值,现在如今修改为以下自定义方式
public void queryMyOrder(QueryEvent queryEvent) { String queryProcess = "#{bindings.TPurchasedProductsView1Query.processQuery}"; ADFUtils.customQuery(queryEvent, queryProcess); }
阅读全文
0 0
- ADF修改默认filter查询将%改为%%方式
- 修改默认模板(dece)将default改为temp
- tomcat 修改端口号及将项目改为默认项目
- 将USB的默认连接方式改为MTP
- 将tomcat内部默认日志方式改为Log4j未成功的记录
- 将ecm的默认数据库改为mysql
- sqlplus edit将默认编辑器改为vi
- ubuntu将默认的nano改为vim
- 将Ceilometer默认的MongoDB改为MySQL
- eclipse将默认字符集改为utf8
- centos将默认英文改为中文
- 系统默认打开方式改为资源管理器
- ubuntu 修改时间将UTC改为CST
- 将NS2改为plugin方式的尝试
- MySQL 将默认编码改为gb2312的几个步骤
- 将Windows XP默认的Administrator帐户改为其他名称
- 将Windows XP默认的Administrator帐户改为其他名称
- 将ubuntu默认的目录中文名改为英文
- 破解安装3DUnity5.1.3
- Postgresql_TCP-IP下监听的配置(listen_addresses)
- https
- word的宏_vba统一设置表格宽度
- xfs 在线扩容,使用xfs_growfs
- ADF修改默认filter查询将%改为%%方式
- synchronized和volatile的一些问题
- RxJava详解
- Jsoup 发送post请求 org.jsoup.HttpStatusException: HTTP error fetching URL. Status=404, URL=https:
- Centos搭建ceph+++三、创建部署CEPH用户
- Threejs 三大组件 -- 场景、相机、渲染器
- Android的五大布局以及常用控件
- 人工智能TensorFlow学习研究(一)
- 使用solcjs命令生成abi和bin文件出现"ParserError:Source "G:/XXX/strings.sol" not found:File not supplied initally