Package javax.faces.el

Examples of javax.faces.el.VariableResolver


        assertEquals(TestPropertyResolver.class, propertyResolver.getClass());
        assertEquals(PropertyResolverImpl.class, ((TestPropertyResolver) propertyResolver).getDelegate().getClass());

        // VariableResolver
        VariableResolver variableResolver = application.getVariableResolver();

        assertEquals(TestVariableResolver.class, variableResolver.getClass());
        assertEquals(VariableResolverImpl.class, ((TestVariableResolver) variableResolver).getDelegate().getClass());


        // RuntimeConfig
View Full Code Here


public class OptionsController
{
    public String changeLocale()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        OptionsForm form = (OptionsForm)vr.resolveVariable(facesContext, "optionsForm");
        facesContext.getViewRoot().setLocale(form.getLocale());
        return "ok";
    }
View Full Code Here

    public void processAction(ActionEvent event) throws AbortProcessingException
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIComponent component = event.getComponent();

        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        CalcForm form = (CalcForm)vr.resolveVariable(facesContext, "calcForm");
        if (component.getId().equals("addButton") ||
            component.getId().equals("href1"))
        {
            form.add();
        }
View Full Code Here

    public void processAction(ActionEvent event) throws AbortProcessingException
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIComponent component = event.getComponent();

        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        UCaseForm form = (UCaseForm)vr.resolveVariable(facesContext, "ucaseForm");
        if (component.getId().equals("ucaseButton"))
        {
            form.uppercase();
        }
        else
View Full Code Here

public class OptionsController
{
    public String changeLocale()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        OptionsForm form = (OptionsForm)vr.resolveVariable(facesContext, "optionsForm");
        facesContext.getViewRoot().setLocale(form.getLocale());
        return "ok";
    }
View Full Code Here

        if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION)
        {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            UIComponent component = event.getComponent();

            VariableResolver vr = facesContext.getApplication().getVariableResolver();
            QuotationForm form = (QuotationForm)vr.resolveVariable(facesContext, "q_form");
            if (component.getId().equals("button1"))
            {
                form.quote();
            }
            else
View Full Code Here

    }

    @Test
    public void testGetVariableResolver() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        expect(_runtimeConfig.getVariableResolver()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here

    }

    @Test
    public void testGetVariableResolverChainHead() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        EasyMock.expect(_runtimeConfig.getVariableResolverChainHead()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here

                                                    String bundleName)
    {
        //TODO: Could be JSTL LocalizationContext bundle?

        //Lookup as attribute (try different scopes)
        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        ResourceBundle bundle = (ResourceBundle)vr.resolveVariable(facesContext, bundleName);

        return bundle;
    }
View Full Code Here

            roleMgr.addRole(roleToAddPath);
            // Get the newly added role.
            Role addedRole = roleMgr.getRole(roleToAddPath);
            // Resolve the tree table.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            VariableResolver vr = facesContext.getApplication().getVariableResolver();
            RoleTreeTable roleTree = (RoleTreeTable) vr.resolveVariable(facesContext, RoleTreeTable.ROLE_TREE_TABLE);
            // Get the listeners registered.
            Collection listeners = roleTree.getTreeModel().getTreeModelListeners();
            // TODO We could be more sophisticated and not rebuild the old tree.  For now this will do.
            roleTree.setTreeModel(SecurityApplicationUtils.buildRoleTreeModel());
            // Get the new tree model.
View Full Code Here

TOP

Related Classes of javax.faces.el.VariableResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.