« Back to University of Vienna - OMILAB

Event handler when notebook opens

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Event handler when notebook opens
Answer
1/9/19 1:50 PM
I was wondering if there is an event handler which fires when the notebook of an element opens?

Here is a sample scenario: I have a model with several objects of type "A" inside. When I double-click on an object (which actually opens the notebook), I want to fire an event which counts all the objects of type "A" and print the result in an attribute "Number" (textfield) inside the notebook of the element.

Furthermore, is there a collected list of all events available in ADOxx?

RE: Event handler when notebook opens
Answer
6/11/14 6:37 AM as a reply to Christian Vorhemus.
Dear Christrian,

I) Event Handler "Open Notebook"
there is no event handler that is triggered when opening the notebook. For an overview of existing event handlers, please have a look into the help file of the development toolkit environment.
II) Counting Instances using an Expression Attribute
in order to solve your questions, an option is to use the attribute type "EXPRESSION" combined with an AQL statement. Attributes of type EXPRESSION are dynamically calculated within an open model. Please be careful when using EXPRESSION attributes that access information in referenced models (e.g. following INTERREFs using EXPRESSIONS), since all models must be loaded to update these expressions.Please find the expression attribute below, also included in the demonstration implementation available via the Application Library Repository at:
https://www.adoxx.org/svn/all-repo/5_ADOxx_SupportLibraries_ADOxx13UL1/CountingInstancesExpression_ADOxx13UL1/

1EXPR type:integer expr:fixed: (tokcnt(aql("<\"A\">")))

type: specifies the return value of the expression, possible values are: double, string, integer, time
fixed: specifies if the expression will be unchangeable in the Modelling Toolkit. It means that the EXPRESSION attribute evaluates the same formula everywhere.