在ADF中用EL表达式计算两个参数的乘积

Rick_ang 2010-10-29 04:42:16
我在页面上有一个treeTable组件,组件的节点用node变量来表示,页面上还有一个参数#{bindings.quantity},我想计算#{node.unit_cost}乘以#{bindings.quantity}的值再赋给treeTable上的一个outputText组件。可是我用表达式

#{bindings.quantity * node.unit_cost}时就会报错,提示:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key el.convert
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at com.sun.el.util.MessageFactory.getArray(MessageFactory.java:75)
at com.sun.el.util.MessageFactory.get(MessageFactory.java:55)
at com.sun.el.lang.ELArithmetic.coerce(ELArithmetic.java:373)

我要怎样才能用EL表达式来计算这个值呢?
...全文
202 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Rick_ang 2010-11-02
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 magong 的回复:]

#{bindings.quantity * node.unit_cost}
肯定报错,因为延迟EL都是要绑后台Bean的,到哪儿去找它绑的这个属性(它被写成了表达式!)。只能用只读EL来输出计算后的值,如下:

${bindings.quantity * node.unit_cost}

直接甩页面上,不要放outputText中了
[/Quote]
试过了,还是不行
youfeng445 2010-10-30
  • 打赏
  • 举报
回复
敢问4楼,你答案和楼主的怎么一样
softwarexiang120 2010-10-30
  • 打赏
  • 举报
回复
关注一下。。。
magong 2010-10-30
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 youfeng445 的回复:]

敢问4楼,你答案和楼主的怎么一样
[/Quote]
你没仔细看吧
magong 2010-10-29
  • 打赏
  • 举报
回复
#{bindings.quantity * node.unit_cost}
肯定报错,因为延迟EL都是要绑后台Bean的,到哪儿去找它绑的这个属性(它被写成了表达式!)。只能用只读EL来输出计算后的值,如下:

${bindings.quantity * node.unit_cost}

直接甩页面上,不要放outputText中了
kokorenfeng 2010-10-29
  • 打赏
  • 举报
回复
${ bindings.quantity } * ${ node.unit_cost }
Rick_ang 2010-10-29
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 youfeng445 的回复:]

Java code

${ bindings.quantity } * ${ node.unit_cost }
[/Quote]
这个不行的,ADF的outputText组件的value只能用#{}
youfeng445 2010-10-29
  • 打赏
  • 举报
回复

${ bindings.quantity } * ${ node.unit_cost }

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧