cancel
Showing results for 
Search instead for 
Did you mean: 

Is it a bug or a feature?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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