What is an XTEND token

An XTEND token is a text element added in an HTML page in order to make the content dynamic.

The token can be inserted in the page in two different ways:

  • either as an attribute to an HTML tag
      <td adx="monChamp"></td>
  • or as a delimiter of part of the HTML
      <!adx="monBlocConditionné">...Html...<!adx="monBlocConditionné">

Each token is associated with a setup record in the XTEND dictionary used to control its behavior.

For instance:

  • A field type token inserted in a tag <td> replaces the cell content by the value of the field whose format is given by the setup record
  • a token of type 'conditioned section' masks or hides the part of HTML that it delimits depending on a rule defined in the setup record

For instance:

<!adx="ADISPUSERLOGGEDIN">
<!--This section is displayed if the user is connected'-->
 <!--AUSERCODE is a token of 'field' type'-->
 You are logged in with a user code<b adx="AUSERCODE"></b><br>
 <!--ADLKLOGOUT is a token of type 'dynamic link''-->
 In order to log out, click<a adx="ADLKLOGOUT">here</a>              
<!adx="ADISPUSERLOGGEDIN">        

Token syntax

Common syntax

adx="myElement"

It is possible to use lower or upper case letters:

ADX="myelement", Adx="MYELEMENT", aDx="MyElEmEnT",…

It is forbidden to insert blanks:

adx ="aaa", adx= "aaa", adx=" aaa " are forbidden

Expressing an origin

adx="B1.MyField"

B1 named reference section

This syntax is used to express the origin of an information.

The dot is used as separator.

In the example, MyField is a data coming from B1 section.

This syntax is described with further details in the Field Token documentation.

adx="B1(i).MyField"

This expression is used to access the MyField field of such or such line in the section (beginning with 1)

adx="B1.MyTokenLink"

This expression is used to trigger the MyTokenLink token by taking the B1 reference section data as action setup. MyTokenLink may for instance stand for a pagination action.

Adding HTML setups

adx="myElement:param1=val1&param2=val2&param3"

The HTML setups are added in the HTML page and modify the standard behavior of the token.

It is possible to add setups:

  • by separating the setups from the element code via ':' character
  • by separating them from another via character&
  • by entering Setup name = setup value

This syntax is described with further details in the Field Token documentation.

Examples:

Modification of a date format:

<span adx="ATODAY:xformat=Dz:DD[ ]MMMMMMMMMM[ ]YYYY"></span>

Description display:

 When defining the field LIBMENULOCAL of type 'local menu' with option 'description', the code below makes it possible to display the text no. 1 of local menu.

<span adx="LIBMENULOCAL:xcaption=1"></span>

Use in a <select> tag:

The code below shows how to:

  • call the dynamic link MyLink on event on Change
  • fill the options with the content of field MyMenuLocal
  • select automatically the option corresponding to the value of MyField

<select name="MYNAME" adx="MyField:xonchange=MyLink&xfill=MyMenuLocal">...</select>

Local menu field token or token with value list

Adding of _DESCR to the token code makes it possible to select the description associated with the token value.

<!-- Displays the description-->
<b adx="MyMenuLocal_descr"></b>
<!-- Displays the value (index)-->
<b adx="MyMenuLocal"></b>

Token types

Here is the list of the various token types proposed by XTEND:

Field token
Stands for the value of the data fields

Link token
Triggers a user action like for example a tunnel and/or a web action and/or a selection

Section token
Allows an "access to data" (query) with iteration on the read entities (records).

Conditioned section token
Manages the display of HTML code sections according to predefined rules

Special token
Specific token whose behavior cannot be set up

Page token
A page code can be inserted in a tag <a adx="MyPage"></a> in order to tunnel to the page without having to create a dynamic link token.