on 09-23-2008 9:02 AM
Hi,
I'm using Web DynPro 7.0 SP12. I have devoloped an Application with two Attributes: Count per Package and Package Count. For these Attributes I have add calculated tmp-Attributes which are bound to my view.
The coding for these is the following:
public int getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement element)
{
//@@begin getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement)
return wdContext.currentArticelElement().getCountperPackage();
//@@end
}
public void setArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement element, int value)
{
//@@begin setArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement, int)
wdContext.currentArticelElement().setCountperPackage(value);
wdContext.currentArticelElement().setPackageCount(
new BigDecimal(
(double) wdContext.currentArticelElement().getOrderCount()
/ (double) wdContext
.currentArticelElement()
.getCountperPackage())
.divide(new BigDecimal(1), 0, BigDecimal.ROUND_UP)
.intValue());
//@@end
}
public int getArticelTmpPackageCount(IPrivateKalkComp.IArticelElement element)
{
//@@begin getArticelTmpPackageCount(IPrivateKalkComp.IArticelElement)
return wdContext.currentArticelElement().getPackageCount();
//@@end
}
public void setArticelTmpPackageCount(IPrivateKalkComp.IArticelElement element, int value)
{
//@@begin setArticelTmpPackageCount(IPrivateKalkComp.IArticelElement, int)
wdContext.currentContextElement().setPackageCount(value);
wdContext.currentArticelElement().setCountperPackage(
new BigDecimal(
(double) wdContext.currentArticelElement().getOrderCount()
/ wdContext.currentContextElement().getPackageCount())
.divide(new BigDecimal(1), 0, BigDecimal.ROUND_UP)
.intValue());
//@@end
}
You can see, what I want to do?!
Okay.. it works fine, if i have changed the PackageCount or the CountperPackage at last, before I make the roundtrip. If I insert something into another attribute, there is nothing calculated. Bug or Feature or is anything wrong?
Greets,
Peter
Hi Peter,
Only on round trips the calculated attributes are called.
one change you can do in the code is
public int getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement element)
{
//@@begin getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement)
return wdContext.currentArticelElement().getCountperPackage();
//@@end
}
Instead of the above one to access the current element you can use element which is part of the parameter.
public int getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement element)
{
//@@begin getArticelTmpCountperPackage(IPrivateKalkComp.IArticelElement)
return element.getCountperPackage();
//@@end
}
Could you try this change in other methods too where the current element is accesed.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I know, that only on round trips the calculated attributes are called. my problem is, that the method only called, if the curser is in the inputfield of the calculated attribute.
The coding you descriped has the same result. There is no different, because the cardinality of the node articel is 1..1 and the selection is also 1..1.
Greets,
Peter
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.