Here's a very simple example EWD Page Fragment. Note the pageType declaration in the ewd:config tag, and the fact that it otherwise consists of nothing more than a block of markup that will replace the innerHTML of its target tag. To ensure correct parsing and processing by EWD's compiler, it is good practice to enclose your fragment's markup inside a single outer tag, in this case the benign span tag.

  <ewd:config pageType="ajax">
  <span>
     <h3>Here's a very simple EWD Ajax Page Fragment</h3>
     <div>It doesn't do much though!</div>
  </span>

An EWD Ajax Page Fragment can otherwise contain anything that a full EWD page can contain, including a pre-page script, EWD custom tags, EWD includes and references to EWD Session variables.

In order to use Ajax you must have a complete page already occupying the browser. This page is known as the Container Page. To use an EWD Ajax Page Fragment, you must determine an in-page event within the Container Page that will trigger the process (eg onClick, onKeyPress etc) and associate with that event two key things:

You can specify this in one of two ways:

Click the Enterprise Web Developer/Examples tab to see detailed Ajax examples.