Home » Developer & Programmer » JDeveloper, Java & XML » Trying to set entity object attributes' control hints values to generic classes (JDeveloper ,10.1.3.3,Windows xp)
Trying to set entity object attributes' control hints values to generic classes [message #325851] Mon, 09 June 2008 04:05
makis
Messages: 2
Registered: June 2008
Junior Member
Hi, how are you? I work for a project , that uses JDeveloper 10.1.3.3 version and I am assigned to solve some problems in the part that is associated with ADF Business Components—Model—of the application. The question is how could I implement generic functionality in CustomEntityImpl and there I am to assign some control hint values to some attributes and then the entities that will extend this class will acquire this functionality in their attributes.
I send you some code I have in my mind in order to find out how to write something relevant to set control hints. I have searched in relevant api’s for AttributeHints and EntityDef but I did not find a solution to my problem. I’ve tried this code:

private final String desc = "Description";
...

protected boolean findAttribute(String name) {
String[] list = this.getAttributeNames();
for (int i = 0; i < list.length; i++) {
if (name.equals(list[i]))
return true;
}
return false;
}

public void beforeCommit(TransactionEvent transactionEvent) {
if (findAttribute(desc)){
* AttributeDefImpl adi=null;
adi.setProperty(AttributeHints.ATTRIBUTE_DISPLAY_HINT_HIDE,"Hide");
AttributeDef desc=(AttributeDef)adi.getProperty(AttributeHints.ATTRIBUTE_DISPLAY_HINT_HIDE);

}
super.beforeCommit(transactionEvent);
}




but it does not work. How could I set this value – to hide one attribute whenever it exists in my entities , setting it once in my CustomEntityImpl class?
I’ve read the whole tutorial ADF Business Components For Forms 4GL Developers but I did not find a solution to my problem. Your help would be a gift to me. Thank you very much!

* I think that the error is here because this object can not be null. In an api I found the following :

Advanced users can provide their own implementation of EntityDefImpl (by subclassing EntityDefImpl). Within it, they can create their own AttributeDefImpls by using: new AttributeDefImpl(...);
How should I subclass EntityDefImpl to create an AttributeDefImpl object?
Previous Topic: Problem (ORA-00600 and ORA-30980) with XDB.XMLINDEX and XPath subsetting
Next Topic: nesting xmlelement within xmlforest
Goto Forum:
  


Current Time: Thu Dec 08 06:22:14 CST 2016

Total time taken to generate the page: 0.21727 seconds