Search in sources :

Example 16 with ValueBinding

use of javax.faces.el.ValueBinding in project ma-core-public by infiniteautomation.

the class JsfCreator method getInstance.

/* (non-Javadoc)
     * @see org.directwebremoting.Creator#getInstance()
     */
public Object getInstance() throws InstantiationException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext == null) {
        log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
        return null;
    }
    Application application = facesContext.getApplication();
    Object resolvedObject = null;
    if (isVBExpression(getManagedBeanName())) {
        ValueBinding vb = application.createValueBinding(getManagedBeanName());
        if (vb != null) {
            resolvedObject = vb.getValue(facesContext);
        }
    } else {
        VariableResolver resolver = application.getVariableResolver();
        resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
    }
    return resolvedObject;
}
Also used : FacesContext(javax.faces.context.FacesContext) ValueBinding(javax.faces.el.ValueBinding) VariableResolver(javax.faces.el.VariableResolver) Application(javax.faces.application.Application)

Aggregations

ValueBinding (javax.faces.el.ValueBinding)16 UIInput (javax.faces.component.UIInput)3 FacesContext (javax.faces.context.FacesContext)3 MethodBinding (javax.faces.el.MethodBinding)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 UICommand (javax.faces.component.UICommand)2 UIComponent (javax.faces.component.UIComponent)2 ResponseWriter (javax.faces.context.ResponseWriter)2 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)2 UIListItems (org.alfresco.web.ui.common.component.UIListItems)2 IOException (java.io.IOException)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 Iterator (java.util.Iterator)1 Application (javax.faces.application.Application)1 FacesMessage (javax.faces.application.FacesMessage)1 UIOutput (javax.faces.component.UIOutput)1 UISelectBoolean (javax.faces.component.UISelectBoolean)1 UISelectItems (javax.faces.component.UISelectItems)1