Extension Views

Form and grid views can be altered by defining a new view that has the same name, a unique id defined, and extension="true". That kind of view is called an extension view.


<form name="contact-form" title="Contact" model="com.axelor.contact.db.Contact"
  id="sale-contact-form" extension="true">

  <!-- Insert a dashlet after Contacts panel. -->
  <extend target="panel[@title='Contacts']">
    <insert position="after">
      <panel-dashlet action="action-view-orders-by-contact" title="Orders"/>

  <!-- Replace fullName field by firstName and lastName fields. -->
  <extend target="//field[@name='fullName']">
      <field name="firstName"/>
      <field name="lastName"/>

  <!-- Move Extra panel before first sidebar panel. -->
  <extend target="panel[@sidebar='true']">
    <move position="before" source="panel[@title='Extra']"/>

  <!-- Change widget attribute on notes field. -->
  <extend target="//field[@name='notes']">
    <attribute name="widget" value="html"/>

  <!-- Change attributes on the root element. -->
  <extend target="/">
    <attribute name="canAttach" value="false"/>
    <attribute name="width" value="large"/>


Defining extension views causes computed views to be generated (views with computed="true") with a priority higher than the original views'. Those computed views are regenerated whenever the extension views or the original views are updated.



Extension views have one or more <extend> tags defining the extensions:

<extend target="<XPath expression>" if-feature="<feature name>" if-module="<module name>">
  <!-- One or more extension operations -->
Attribute Description


XPath expression to select the target element of the extension operation (extend operation is performed on the first match only)


name of a feature and only apply this extension if this feature is enabled (optional)


name of a module and only apply this extension if this module is installed (optional)

The if-feature attribute works with a class extending com.axelor.app.AppConfig and specified by application.config-provider configuration in axelor-config.properties file:

import com.axelor.app.AppConfig;

public class AppService implements AppConfig {

  public boolean hasFeature(String featureName) {
    // Return whether the feature is enabled.

An <extend> tag is composed of one or more extension operations, among insert, replace, move, and attribute.


Insert specified elements at a position relative to the target element.

<insert position="before|after|inside">
  <!-- Elements to insert -->
Attribute Description


position where to insert these elements, relative to the target element: before, after, or inside


Replace the target element by the specified elements. Only one replace operation may be applied to one target element.

  <!-- Elements to replace the target element with -->

If no elements are specified, the target element is removed.


Move a specified source element to a position relative to the target element.

<move position="before|after|inside" source="<XPath expression>"/>
Attribute Description


position where to move this source element, relative to the target element: before, after, or inside


XPath expression to select the source element of the move operation


Change a specified attribute on the target element.

<attribute name="<attribute name>" value="<attribute value>"/>
Attribute Description


name of the attribute to change


new value of the attribute

If the value is empty, the attribute is removed from the element.


Normally, before means before the target element, and after means after the target element.

However, when the target element is "/" (root element of the view), the meaning is altered: before means before first child element, and after means after last child element: Special cases where some elements such as <toolbar> and <menubar> that need to stay on top are dealt with automatically:

<!-- Insert a dashlet as first element inside the view. -->
<!-- If a toolbar and/or a menubar already exist, -->
<!-- the dashlet is inserted after those. -->
<extend target="/">
  <insert position="before">
    <panel-dashlet action="action-view-orders-by-contact" title="Orders"/>