ManagedBean Demo

This demo explains how ManagedBeans can be used in Html Dialogs.

In an Html Dialog it is possible to interact with normal Java classes by declaring them as ManagedBeans.

In this demo ivy project we have a ManagedBean class under ch.ivyteam.htmldialog.demo.other.managedBean.ApplicationDemoBean.java .
We use the bean to show and store a simple String value in the description field of the class. Therefore we bind the value of the input text to: #{applicationDemoBean.description}

The property of this managed bean will be shared with all users on this server as it is annotated with @ApplicationScoped. Open another browser and check the property value.

Scopes

MangedBeans can be annotated with a scope. The scope defines the lifecycle of a ManageBean. Currently three scopes for ivy project beans are supported:

ScopeLifetime
@ApplicationScopedLives as long as an ivy application. They are only destroyed if the server shut's down or if the declaring project (PMV) is deleted.
@SessionScopedLives as long as the browser session.
@RequestScopedLives as long as the view request. This is the default Scope which is assumed if no scope annotation was declared.