Jaco writes in to ask:
I want to add some functionality to the JUCtrlAttrsBinding class. This class is used for an attribute binding. What are the steps to plug in your own custom binding class?
Great question. I've added example #41 ("Example of Using Customized ADF Binding Class in a ADF/Struts Web Application") to my Not Yet Documented Examples page with a simple, working example.
The example illustrates the minimal details necessary to get the ADF binding layer to use a customized ADF binding implementation class at runtime, in the context of a web application. The steps would be the same for an ADF JClient application or other use case, the only thing that might change is the place you register you custom binding definition factory with the JUMetaObjectManager. In the example:
- MyADFBindingFilter extends ADFBindingFilter and calls JUMetaObjectManager.setControlDefFactory() to register a custom control binding definition factory.
- MyCustomBindingDefFactoryImpl extends JUBindingDefFactoryImpl and overrides createControlDef() to return a custom binding definition class for one of the subtypes of bindings. In this case, I've chosen to provide a customized binding class the the binding subtype "DCTextField". This value corresponds to the value of the SubType attribute in the UIModel.xml file for a binding's metadata.
- MyCtrlAttrsDef extends JUCtrlAttrsDef and overrides createControlBindingInstance() to return a new instance of my customized MyCtrlAttrsBinding instead of the default.
- MyCtrlAttrsBinding extends the default JUCtrlAttrsBinding object and overrides the setInputValue() method to print out a custom message to system output to allow you to see at runtime that the custom binding is getting used.
10:00:30 AM
|