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