Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

In some use cases you want to manipulate an Element the moment it is created (a “new row”). For this you can use the Created annotation. The XML Data Control will call your java method if a new Element is created.

@Created
public void elementCreated(XMLDCElement employee) { 
employee.putInternal("hireDate", new Date()); 
}


The method has a void return type and the XMLDCElement as input parameter. 
The name of the method needs to be ‘elementCreated’, else the Data Control will throw an InvalidMethodSignatureException.
In this case we will set the default hireDate to the current sysdate on the creation of a new Employee element.

Drag and drop the ‘Create’ operation on the form, so we can create a new element.


Run the page and click the Create button, you will see the employee form is created with the sysdate as default:
 

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.