zoukankan      html  css  js  c++  java
  • OAF中为MessageTextInput添加加事件处理

    需求:现在OAF页面上有俩输入框,单价,数量,根据单价数量,自动计算MessageStyledText金额中的值,对应的基于EO的VO的字段为UnitPrice,Quantity,Total。

    实现方式。

    先分别为单价,数量输入框添加局部刷新事件,setUnitPrice,setQuantity.

    //若不添加时间,是不会处理将MessageTextInput的值插入VO的提交动作的,可以不对此事件添加任何方法

    再在VORowImpl中添加处理方法。

    public Number getUnitPrice() {
    return (Number) getAttributeInternal(UNITPRICE);
    }
    
    public void setUnitPrice(Number value) {
        Number quantity = this.getQuantity();    
        if("".equals(quantity) || quantity==null){
            quantity=0;
        }
        this.setTotal(value.multiply(quantity))
    setAttributeInternal(UNITPRICE, value);
    }
    
    public Number getQuantity() {
    return (Number) getAttributeInternal(QUANTITY);
    }        
    
    public void setQuantity(Number value) {
        Number unitPrice = this.getUnitPrice();    
        if("".equals(unitPrice) || unitPrice==null){
            unitPrice=0;
        }
        this.setTotal(value.multiply(unitPrice))
    
    setAttributeInternal(QUANTITY, value);
    }
    
    
    public Number getTotal() {
    return (Number) getAttributeInternal(TOTAL);
    }
    
    public void setTotal(Number value) {
    setAttributeInternal(TOTAL, value);
    }
  • 相关阅读:
    内置函数
    json && pickle 反序列化
    装饰器(语法糖)
    shell环境改变引起的命令提示符改变
    FTP服务安装与端口说明
    tomcat配置
    greenDao 中连接查询
    COM组件DLL引用时出现检索组件错误
    VS 调试断点命中了,程序无法再断点处中断
    单点登录原理与简单实现
  • 原文地址:https://www.cnblogs.com/huanghongbo/p/4605447.html
Copyright © 2011-2022 走看看