This content has been marked as final.
Show 2 replies
-
1. Re: How can I find a component's name?
niox.nikospara.yahoo.com Jul 23, 2009 10:00 AM (in response to billevans)Hello,
I do not know how you can achieve what you are asking, or if ti is possible at all.
However, if all you want to do is something like:
String componentName = findItSomehow(); if( "accountFilter".equals(componentName) ) { doThis(); } else if( "caseDetailsFilter".equals(componentName) ) { doThat(); } ...etc...
Wouldn't it be more appropriate and clean to have an abstract base class with the core functionality and then concrete implementations, each having a single @Name?
-
2. Re: How can I find a component's name?
swd847 Jul 23, 2009 12:43 PM (in response to billevans)If you specify a create method with a single parameter of type Component you can get access to the name:
public class MyComponent { String name; @Create public void create(Component component) { name=component.getName(); } }