I'm using jsf 2.2. I have 2 @Named beans in @ViewScoped
@Named(value = "menuMB")
@ViewScoped
public class MenuMB implements Serializable{
}
@Named(value = "produtoGeralMB")
@ViewScoped
public class ProdutoGeralMB implements Serializable{
@Inject
private MenuMB menuMB;
}
I have a method that changes a property of produtoGeralMB
, but on page jsf if I use an inputText menuMB
, after ajax there is no change, if I use #{menuMB.minhaPropriedade}
it works fine
I noticed that the CDI works with proxy for the injected object. Is there anything so that on the page I use #{produtoMB.menuMB.minhaPropriedade}
and not #{menuMB.minhaPropriedade}
? Why does this happen if there is only a single instance of #{produtoMB.menuMB.minhaPropriedade}
in memory?