on 11-02-2007 3:29 AM
Hi,
Can anybody tell me the use of setter and getter methods in webdynpro .
It is generated when we set the calculate property of value attribute to true .
Thanks a lot .
Hi,
Setter method is called when a value is assigned to the attribute .
This method can be called either by using
wdContext.currentContextElement().set<YOURATTRIBUTE>
or when a new value is entered by the user from the UI Element bound to this attribute.
<b>value</b> param of the setter method holds the new value.
Getter is called to retreive the value for the attribute.
wdContext.currentContextElement().get<YOURATTRIBUTE>
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 Jain
<b>setter</b> and <b>getter </b>functions will be created when you set the calculated propertyto true
Consider the following scenario where in you can get some basic idea
1) First insert a Child "Image" UI Element
2) Create a Context in a view in which you are using Image UI Element
3) Value Node
Name : Image
Cardidality : 1..1
4) create 2 Value Attributes
4)a ImageAlt (Calculate property - true) //this will create getter and setter methods
4)b ImageSrc (Calculate property - true) //this will create getter and setter methods
5)Bind the properties of Image
alt - Image.ImageAlt
source - Image.ImageSrc
6) in getImageSrc()
{
retrun "XX.gif"
}
7) in getImageAlt()
{
return "Image Not Available"
}
you can even achieve getter and setter methods by doing the following procedure
goto <b>implementation</b> tab-> rightclick -> <b>source</b> -> <b>generate Getter and Setter methods...</b>
Best Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When we create a node or attribute at design time, setter and getter
methods are provided to access these elements:
The set methods set the value of a property or an element. If a property is readOnly, then this method is not implemented
The get methods return the value of a property or an element.
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.