如何在oracle adf中使用表达式生成器设置当前日期? [英] How can i set current date using expression builder in oracle adf?

查看:94
本文介绍了如何在oracle adf中使用表达式生成器设置当前日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在oracle adf中使用表达式生成器设置当前日期? 我正在使用jdeveloper 11.1.1.3.0并使用Input Date(ADF faces.common.component)

How can i set current date using expression builder in oracle adf? i am using jdeveloper 11.1.1.3.0 and using Input Date(ADF faces.common.component)

推荐答案

表达式构建器用于构建引用方法或值属性的EL表达式.它并不是要设置一个值,而是使其可用于编辑.一种选择是使用方法表达式来调用对Manage bean的操作,然后设置该值.但是,在JSF 1.2中,您不能将参数传递给EL方法,因此,您需要解决一些设置日期的问题.解决方法是方法表达式(并因此按下按钮)调用一个方法,该方法然后创建当前日期(或您想要传递的任何日期)并直接在组件上设置(尽管在组件模型的效果要好得多(IMO).

The expression builder is used to build EL expressions that reference a method or a value property. Its not meant to set a value but to make it available for editing. One option would be to use a method expression to invoke an action on a manage bean that then sets the value. However, in JSF 1.2 you cannot pass arguments to an EL method and for this reason you would need a work around for setting a date. The work around is that the method expression (and thus the press of a button) invokes a method, which then creates the current date (or whatever date you want to pass in) and sets it on the component directly (though setting it on the component model works much better IMO).

坦率

这篇关于如何在oracle adf中使用表达式生成器设置当前日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆