• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
黄洪波写点东西的地方
博客园    首页    新随笔    联系   管理    订阅  订阅
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);
}

 

posted on 2015-06-28 13:42  红无酒伤  阅读(699)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3