<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: why doesn't support Ivy-JSF the annotation @ManagedProperty within a managedbean?</title><link>https://answers.axonivy.com/questions/1248/why-doesn-t-support-ivy-jsf-the-annotation-managedproperty-within-a-managedbean</link><description>&lt;p&gt;@ManagedProperty is not working in a managedbean&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1248/why-doesn-t-support-ivy-jsf-the-annotation-managedproperty-within-a-managedbean" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 08 Apr 2015 09:09:41 -0400</lastBuildDate><item><title>Answer by Christian Strebel</title><link>https://answers.axonivy.com/questions/1248/why-doesn-t-support-ivy-jsf-the-annotation-managedproperty-within-a-managedbean/1249</link><description>&lt;p&gt;I can not say why it is not supported, but I can give you a workaround, how you can access another ManagedBean in a ManagedBean or other Java Code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ELContext elContext = FacesContext.getCurrentInstance().getELContext();
MyOtherManagedBean myOtherManagedBean = (MyOtherManagedBean) FacesContext.getCurrentInstance()
    .getApplication().getELResolver().getValue(elContext, null, "myOtherManagedBean");
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Bean which we access could look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@ManagedBean(name = "myOtherManagedBean")
@RequestScoped
public class MyOtherManagedBean {
...
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Wed, 08 Apr 2015 09:09:41 -0400</pubDate><guid>https://answers.axonivy.com/questions/1248/why-doesn-t-support-ivy-jsf-the-annotation-managedproperty-within-a-managedbean/1249</guid></item></channel></rss>