Skip to Content
author's profile photo Former Member
Former Member

Calculated context attribute?

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?



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2003 at 12:40 PM

    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,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.