on 04-21-2008 11:13 AM
Hi,
Wat is the actual use of this and also giv me some sample for this..when and wher we use it?
**Helpful answers will be appreciated...
GS
Hi
The values of context attributes are normally saved in node elements of a controller context at runtime, and with data binding are displayed in the UI using a generic formatting mechanism (for Dictionary-based types).
In many cases, saved context data should be transferred identically, instead it should be converted before the display. A typical example is displaying an address text based on name and gender. Using the two context attributes Name=Maier and Gender=male, the standardized address text 'Dear Mr. Maier! should be displayed in the user interface. This text can be saved by defining an additional value attribute Address in the controller context. In multiple context nodes, each individual node element would then have the additional context attribute called Address, where the name would be saved redundantly as part of the address.
Calculated context attributes are a more elegant way of handling the example. These are not saved specially in the context, they are calculated (read) where necessary by the controller instead. Where necessary can mean that UI elements should display the content of a calculated attribute, or that the value is accessed by the program in the controller coding. The calculation method is called automatically by the Web Dynpro runtime environment. A calculated context attribute is calculated in an automatically generated access method using signature
<CalcAttrType> get<NodeName><CalcAttrName>(<NodeName>Element element).
For a calculated context attribute called FullNameCalc of type String in node UserData in the context of the FormView view, this results in access method
java.lang.String getUserDataFullNameCalc(
IPrivateFormView.IUserDataElement element).
The calculation method is called automatically where necessary by the Web Dynpro runtime environment. It passes a reference to the node element to which the calculated context attribute refers. If this method were defined in a multiple node with cardinality 0..n, for example, then the access method would be called for each node element that is available in the node at runtime. In this way, the full name of a customer could be displayed in a third table column, consisting of first and last names. The access method would be called for each row (each node element) in the table.
It is expected that the access method for calculating a calculated context attribute is based on the same node elements other attributes.
Within the generated access method for a context attribute, the context attribute to be calculated should not be accessed, as this results in the access method being called recursively. A recursion termination occurs only if you implement a recursion condition.
According to the Web Dynpro naming convention, calculated context attributes should contain the ending Calc for Calculated in the name, such as SalutationCalc or TotalPriceCalc. This makes the application coding easier to read with respect to the components from the calculated context attributes.
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jansi and fistae...
Thanks for u r kind replies... This infm is enough for me ...
GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
Refer to the following link of help.sap.com which will answer your question.
http://help.sap.com/saphelp_nw04s/helpdata/en/7f/a0384162316532e10000000a1550b0/frameset.htm
Thanks n Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
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.