Need help on how to load lov accoding to the value, select locale

Hello
My scenario is, I'll have two buttons. A single button for local (English) and another button for local (Nl) Dutch.
I have a table of database that hold the 2 columns, which are en and Nl.
I load this value of columns using a Lov
When I click on the en button, Lov sholud load according to valus in the database column in and when I click on Nl it touches sholud charge Lov according to the values in the Nl column.

I use a managed Session bean that allows to set the locale.

I've implemented this scenario, but I had some bad problems.
(1) my implemented method is not recommended as a best practice
(2) lov dosagesn can't change until I click a value to this topic.

In the query select lov, I used the link variable and value as adf.context.expressionEvaluator.evaluate('#{UserPreferences.language}')

It is not recommended, so please help me to do this with best practices.
Thank you.

in your bean writing managed code below

        FacesContext facesContext = getFacesContext();
        Application app = facesContext.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
        ValueExpression valueExp =
            elFactory.createValueExpression(elContext, "#{data." +"APPLICATION_MODULE_NAME" +".dataProvider}",Object.class);

            AppModuleImpl am =(AppModuleImpl)valueExp.getValue(elContext);       // here AppModuleImpl is the application module Impl class name
            ViewObject myVO = am.findViewObject("VIEW_OBJECT_NAME");
            myVO.setNamedWhereClauseParam("BIND_VARIABLE_NAME", "VALUE_OF_BINDVARIABLE");
           myVO.executeQuery();

and test, hopefully this solves the problem :)

Tags: Java

Similar Questions

Maybe you are looking for