Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel2
outlinetrue

 

Customizations

...

Enter a name, for exampl EmployeeCust and enter a package:

Image Removed

After this the Customization Class is created:

Image Removed

We will create all our customizations in the class, but before we are moving on to that, we need to register this class in our DataControl. 
Open the DataControls.dcx and go to the Source view. Here we need to tell our DataControl definition that we have a customization class. 
This is done by adding an customization-provider after the data-provider in the definition node.   

Code Block
languagexml
<customization-provider class="org.adfemg.datacontrol.xml.provider.customization.CustomizationProviderImpl">
  <parameters>
    <list-parameter name="classes">
      <value>org.adfemg.xmlsample.cust.EmployeeCust</value>
    </list-parameter>
  </parameters>
</customization-provider>

Since it is possible to have multiple customization classes on one DataControl, this is a list parameter in which you can add multiple value elements with references to customization classes.
That is all you need to tell to the DataControl, so now we can move back to ou Java class and start coding our Customizations.
Warning: The XML DataControl customization-provider works on the compiled classes, not in the design-time source. Make sure that you compile your Java class after every change you make, so the DataControl will pick up the change.  
Note: Both the registration of the customization-provider as well as the compiling of sources are obsolete on the trunk build of the XML Data Control. However, in the official 1.0 release, these steps are still necessary.
This will be removed from the documentation once the newer version of the Data Control is officially released. ElementCustomization

Every customization is a customization for one element. We need to tell this to the Java class by adding an annotation to the class.
We add the annotation '@ElementCustomization(target = "")' after which JDeveloper should add an import to the 'org.adfemg.datacontrol.xml.annotation.ElementCustomization' class.
The annotation needs an attribute target, here we need to enter the full name to the package of the element we want to customize with this Java class. 
The easiest way to get the correct information is to go to the pageDef file and copy the BeanClass from the accessorIterator.    

...