Target Unreachable, identifier resolved to null

0

When I try to open the page, I get:

javax.el.PropertyNotFoundException: pagina.xhtml @3,54 value="#{meuManagedBean.valores}": Target Unreachable, identifier 'meuManagedBean' resolved to null

Considering:

<h:form>
    <p:outputLabel id="formulario" value="#{meuManagedBean.label}"/>
    <p:selectOneRadio id="grupo" layout="custom" value="#{meuManagedBean.valores}">
        <f:selectItem itemLabel="Verdadeiro" itemValue="true"/>
        <f:selectItem itemLabel="Falso" itemvalue="false"/>
        <p:ajax event="keyup" update="formulario"/>
    </p:selectOneRadio>
    <p:panelGrid columns="4">
        <p:radioButton for="grupo" itemIndex="0"/>
        <p:outputLabel value="Verdadeiro"/>
        <p:radioButton for="grupo" itemIndex="1"/>
        <p:outputLabel value="Falso"/>
    </p:panelGrid>
</h:form>

Why does the error occur only in EL of p:selectOneRadio and not p:outputLabel ? How to solve?

    
asked by anonymous 16.11.2014 / 22:25

1 answer

1

This error happens because meuManagedBean simply does not exist in this case. Possibly missing some annotation in the class to indicate that this class should be a manageable bean or simply the name of the bean is wrong. The bean names are case-sensitive, meaning there is a difference between a bean called MeuManagedBean and another called meuManagedBean .

On error being triggered only in selectOneMenu , this depends a lot on the implementation of JSF you are using (Mojarra, MyFaces), because each acts differently, but what happens is that XHTML is transformed into a component tree, and for some reason this entry is being executed first as outputLabel . For test purposes, leave only the label in XHTML. You will get the same result as there will only be one to run.

    
17.11.2014 / 01:17