Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The class annotations are specific to the class itself and they are discarded when you subclass it. Per saldo, you <code>CategoriesDetailedBean</code> has inherited two methods <code>getId()</code> and <code>setId()</code> and that's all. They do not magically run in a different scope nor hold the values of a different instance.</p> <p>You're not very clear about the concrete functional requirement, so it's hard to post a suitable answer to what you're <em>really</em> trying to do. But if I guess it right, you actually want to access a different managed bean instance from inside a managed bean. If so, then you can use <a href="http://docs.oracle.com/javaee/6/api/javax/faces/bean/ManagedProperty.html" rel="nofollow noreferrer"><code>@ManagedProperty</code></a> for this. Or perhaps you want a master-detail view and in this case you don't need to inject beans in each other, but better pass the detail ID as GET request parameter and use <a href="http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/f/viewParam.html" rel="nofollow noreferrer"><code>&lt;f:viewParam&gt;</code></a> to set it.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/10344256/elegant-handling-of-attributes-without-a-session-bean">Elegant handling of attributes without a session bean</a></li> <li><a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html" rel="nofollow noreferrer">Communication in JSF 2.0</a> <ul> <li><a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#ManagedBeanScopes" rel="nofollow noreferrer">Managed bean scopes</a></li> <li><a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#InjectingManagedBeansInEachOther" rel="nofollow noreferrer">Injecting managed beans in each other</a></li> <li><a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#ProcessingGETRequestParameters" rel="nofollow noreferrer">Processing GET request parameters</a></li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload