Decouple the converter into a stand alone class and use Application#evaluateExpressionGet()
to access the view scoped bean instance inside the converter method.
ViewBean viewBean = context.getApplication().evaluateExpressionGet(context, "#{viewBean}", ViewBean.class);
This is however a bit nasty design. If I understand your concrete functional requirement of converting the selected item based on the list of available items right, an alternative is to use a generic converter which converts based on the physical <f:selectItem>
/<f:selectItems>
components. The JSF utility library OmniFaces has two converters for exactly this purpose, the SelectItemsConverter
and SelectItemsIndexConverter
.