What you may need to know about <events> definitions in PageDef file

I'm not sure how many of you have noticed the 'generated' PageDef file entries when you define a Contextual Event using the editor(PS2 release). If you define Contextual Event for a command button, the generated PageDef entries may look like as shown below
<?xml version="1.0" encoding="UTF-8" ?>
<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                version="" id="untitled8PageDef"
    <variableIterator id="variables"/>
    <eventBinding id="eventBinding"
      <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
        <event name="SampleEvent" customPayLoad="Test"/>
  <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
    <event name="SampleEvent" customPayLoad="Test"/>

You may notice that <events> repeats two times - one under <eventBinding> and another at root level, right inside <pageDefinition>. Please note that, Contextual Event Runtime is interested only in the one which appears inside <eventBinding>. The <events> right inside <pageDefinition> is supposed to be used by design time - while defining Contextual Event using existing events. It acts more like a template. (PS2 release doesn't seems to have this feature, hopefully upcoming release of JDeveloper may have this feature enabled)



The views expressed on this blog are my own and do not necessarily reflect the views of my employer.