I have a JSF Composite Component which is loading its own Data in Contractor method. Data is loading from webservice. Now I want to add some filter attrbutes for passing to the web service. But I can't access to the attributed in contactor method. So what shlould do ?
My Components XML
<cc:interface componentType="AccountComponent">
<cc:attribute name="value" type="com.test.pojo.Account" shortDescription="Account Class" />
<cc:attribute name="CurrencyCode" />
</cc:interface>
And my Backing Bean .
// Constactor MEthod.
public AccountComponent(){
String attr=this.getAttributeValue("CurrencyCode", null); // I can not access attribute here. It is allways null
AccountComponentLoadDataFromService(attr);
}
So what I want to know if is there any other phase or method two load data and access to attributes at same time ?
By the way , my helper method that uses to get attribute is below.
private <T> T getAttributeValue(String key, T defaultValue) {
T value = (T) getAttributes().get(key);
return (value != null) ? value : defaultValue;
}