Versions Compared

Key

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

...

On the page we want the user to be able to toggle between showing jobs information or not. So we will introduce an transient attribute called 'showJobInfo'.
We create this again with a simple annotation on a method in the same EmployeeCust Java class.   

A TransientAttr will always be an 'init' method with the annotation '@TransientAttr', after adding the annotation you should see an import appear from the class: 'org.adfemg.datacontrol.xml.annotation.TransientAttr'.
The return type, boolean in this case, determines of which type the attribute will be. 
The name of the attribute will be based on the method name, the prefix init will be stripped and there will be an attribute with the name 'showJobInfo'.
The XMLDCElement is the mandatory first argument of the method, which represents the actual element we are customizing (Employee).
The result of the method will be the initial value of the transient attribute.

Do not forget to rebuild your Java class and refresh your Data Controls panel, after this you should see an extra element in the Employee:

...