Java Code Examples for javax.faces.bean.ViewScoped

The following are top voted examples for showing how to use javax.faces.bean.ViewScoped. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: deltaspike   File: ViewScopedExtension.java   View source code 6 votes vote down vote up
/**
 * javax.faces.bean.ViewScoped is no CDI Scope.
 * We need to add it programmatically to CDI.
 */
public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
{
    isActivated = ClassDeactivationUtils.isActivated(getClass());

    if (isActivated)
    {
        //this extension is only needed if the cdi-based view-scope handling isn't delegated to jsf 2.2+
        isActivated = !JsfUtils.isViewScopeDelegationEnabled();
    }

    if (!isActivated)
    {
        return;
    }

    beforeBeanDiscovery.addScope(ViewScoped.class, true, true);
}
 
Example 2
Project: joinfaces   File: JsfClassFactory.java   View source code 5 votes vote down vote up
/**
 * Ignore ViewScoped, SessionScoped, RequestScoped and NoneScoped annotations
 * because spring will take care of them.
 * @return set of annotations to exclude from handlesType
 */
private Set<Class<? extends Annotation>> annotationsToExclude() {
	Set<Class<? extends Annotation>> result = new HashSet<>();
	if (this.jsfAnnotatedClassFactoryConfiguration.isExcludeScopedAnnotations()) {
		result.add(ViewScoped.class);
		result.add(SessionScoped.class);
		result.add(RequestScoped.class);
		result.add(NoneScoped.class);
	}
	return result;
}
 
Example 3
Project: PedidoVenda   File: ViewContextExtension.java   View source code 4 votes vote down vote up
public void addScope(@Observes final BeforeBeanDiscovery event) {
	event.addScope(ViewScoped.class, true, true);
}
 
Example 4
Project: PedidoVenda   File: ViewScopedContext.java   View source code 4 votes vote down vote up
@Override
public Class<? extends Annotation> getScope() {
	return ViewScoped.class;
}
 
Example 5
Project: goFitOne   File: ViewContextExtension.java   View source code 4 votes vote down vote up
public void addScope(@Observes final BeforeBeanDiscovery event)
{
	event.addScope(ViewScoped.class, true, true);
}
 
Example 6
Project: goFitOne   File: ViewScopedContext.java   View source code 4 votes vote down vote up
@Override
public Class<? extends Annotation> getScope() {
	return ViewScoped.class;
}
 
Example 7
Project: deltaspike   File: ViewScopedContext.java   View source code 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Class<? extends Annotation> getScope()
{
    return ViewScoped.class;
}