A behavior is a dynamic functionality that can be added to a UI widget. Backbase widgets are object-oriented objects. This means they have a state, which is kept in properties and a dynamic behavioral functionality, which is coded in methods. A behavior is actually an object that a widget can inherit from. If you add the behavior to an UI widget, by coding for example: e:behavior="b:drag"
, the widget will now inherit all attributes, properties, and methods that are defined for the behavior (the capability to be dragged in this example).
We have already seen a large number of behaviors in the previous chapter. Remember that if you specify e:behavior="b:remoteData"
on a dataSource
element, the dataSource
will be able to communicate with a server and you will have extra attributes that you can use with the dataSource
, such as a url
attribute to specify the destination of a request for data. Similarly, you could make a dataGrid
sortable, by specifying e:behavior="b:dataGridSortOneColumn...