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);
}

 

转载于:https://www.cnblogs.com/huanghongbo/p/4605447.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值