cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated context attribute?

Former Member
0 Kudos

Hi All,

Can somebody tell me what is the idea of the calculated context attributes? I saw that there are methods added to the controler when a context attribute is marked as calculated but from where can be these methods called and how they work?

Regards,

Metodi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Metodi,

A calculated attribute is an attribute that is not stored by the element, but calculated each time the attribute is accessed. Therefore it must be marked in the IDE and controller methods must be declared.

Calculated attributes can have getters and (unless they are read only) setters. The getter calls the declared controller method with the following signature:

                      AttrClass getNodenameAttributename(NodenameElement element);

It is expected to calculate and return the value based on other values of the element.

The setter is only generated if the attribute is not marked read only. It has the following signature:

                      void setNodenameAttributename(NodenameElement element, AttrClass value);

This method is expected to modify other attributes of the element based on the given value. It does not mark anything changed by itself. Only the modification of other attributes leads to updates of the GUI.

(The above method names are proposals of the IDE. You may change them.)

E.g. you could use the getter in order to get a form of address like "Mr. Metodi Mladenov" from the following fields of an address book: Last Name, First Name, Gender, Address.

Best regards,

Karin