Add event handling for Messagetextinput in oaf

Source: Internet
Author: User

Requirements: Now OAF page has two input boxes, unit price, quantity, according to the unit price quantity, automatically calculates the value of the Messagestyledtext amount, corresponding to the EO-based VO field unitprice,quantity,total.

Implementation method.

First, the unit price, the Quantity input box to add a local refresh event, setunitprice,setquantity.

If you do not add a time, the commit action that inserts the value of Messagetextinput into Vo is not processed, and you can not add any methods to this event

Then add the processing method in the Vorowimpl.

 PublicNumber Getunitprice () {return(number) getattributeinternal (UnitPrice);} Public voidsetunitprice (number value) {Number quantity= This. getquantity (); if("". Equals (quantity) | | quantity==NULL) {Quantity=0; }     This. Settotal (value.multiply (quantity)) setattributeinternal (UnitPrice, value);} PublicNumber getquantity () {return(number) getattributeinternal (QUANTITY);}  Public voidsetquantity (number value) {Number UnitPrice= This. Getunitprice (); if("". Equals (UnitPrice) | | unitprice==NULL) {UnitPrice=0; }     This. Settotal (value.multiply (UnitPrice)) setattributeinternal (QUANTITY, value);} PublicNumber Gettotal () {return(number) getattributeinternal (total);} Public voidsettotal (number value) {setattributeinternal (total, value);}

Add event handling for Messagetextinput in oaf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.