Saturday, 7 December 2013

Programmatically Accessing the Custom Properties Defined for Attributes in WSDC Sparse XML


About :

Accessing the Custom Properties in a ADFBC Components is little bit straight forward compared to accessing it from the Sparse XML generated for WSDC Accessor.
In this blog, I will provide the code snippet to access the Attributes Custom Properties programmatically from an backing Bean.



DCBindingContainer bc = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
AttributeDef[] ax = bc.findIteratorBinding("ITERATOR NAME").getAttributeDefs();
AttributeDefImpl attr = (AttributeDefImpl) ax[0];
ax[0].getProperty("Color"); // Gets the Value set Editor in this case it gives blue attr.setProperty("Color",YOUR STRING); //This overrides the Value set in the editor

In ADFBC we can access the Attributes from the ViiewObject's Impl Class directly but in this case we have to get the Iterator Bindings in the Page Definition and then get the Attributes definition 


No comments:

Post a Comment