Monday, September 5, 2011

Attribute Binding

Attribute Binding is of greate help, It can be used to get the values of current selected row in table, selectonechoice etc instead of iterating through the viewobject iterator.

1) On you jsf/jsff page right click and say goto page definition.
2) In bindings click to add (+) and select attributevalues
3) Select datasource and in second dropdown select the attribute you want this variable to store e.g. emp id, name etc
4) Now which ever row/record you select dynamically this attribute will hold the value of that record e.g. for employee if you select some middle row this will show the emp id of that record.
5) The value of this variable is accessed using following expression:
#{bindings.FirstName.inputValue} (based upon the attribute you have specified) or programmatically

DCBindingContainer dbc = (DCBindingContainer)this.getBindings();

AttributeBinding attr =((AttributeBinding)dbc.getControlBinding("FirstName"));

Your can even specific this as input parameter to you execute with parameter operations.