Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded