Espen Dahl
|
| Posted: 04/17/2003, 1:35 PM |
|
I am trying to enter before show code to multiply two values from different controls in the same grid. According to the documentation this can be done like this: e.getRecord().getControl("Total").setValue(e.getRecord().getControl("Quantity").getValue().longValue() * e.getRecord().getControl("Price").getValue().doubleValue() );
But i keep getting "Method longValue() not found in class java.lang.Object." and "Method doubleValue() not found in class java.lang.Object."
Any ideas?
|
|
|
 |
bb
|
| Posted: 04/19/2003, 11:24 AM |
|
bbb
|
|
|
 |
h
|
| Posted: 04/19/2003, 11:26 AM |
|
h
|
|
|
 |
Dandavat
|
| Posted: 04/21/2003, 1:40 AM |
|
Espen,
getValue() method returns Object, so you need to cast to Double and Long accordingly.
long q = ((Long)e.getRecord().getControl("Quantity").getValue()).longValue();
double p = ((Double).getRecord().getControl("Price").getValue()).doubleValue();
e.getRecord().getControl("Total").setValue(q*p);
Pranams,
Dandavat.
|
|
|
 |
|