TBean
- Type of the bean class required for this user interface.public interface IPluginGenericCustomGUI<TBean extends IPluginGenericCustomGUIBean>
Modifier and Type | Method and Description |
---|---|
Iterable<Class<? extends TBean>> |
getUnmanagedBeans()
This must return a list of backing bean classes that control the user interface and are required by the
getXhtmlView() . |
URL |
getXhtmlView()
This method must return the path to the XHTML page for the custom user interface.
|
Iterable<Class<? extends TBean>> getUnmanagedBeans()
getXhtmlView()
. A new instance of the bean will be created automatically when the view is opened. Make
sure each bean has got a no-argument constructor or it cannot be instantiated.
Please note that the beans are unmanaged - functionality specific to managed bean is not
available. This means, for example, that annotations such as PostConstruct
and ManagedProperty
are
not supported and will not work:
PostConstruct
, you can use
IPluginGenericCustomGUIBean.initialize(de.xima.fc.interfaces.plugin.lifecycle.IPluginInitializeBeanData)
ManagedProperty
, you can access beans you need via the current FacesContext etc.
Each bean should be annotated with ManagedBean
and specify a ManagedBean.name()
. If this annotation
is not present or no name is specified, the name defaults to the simple name of the bean class.
Also, each bean needs to be annotated one of the following scopes: RequestScoped
,
ViewScoped
, SessionScoped
or ApplicationScoped
. Note that it depends on the type of plugin
which scopes are actually supported. In case you do not specify a scope, an appropriate scope will be determined
automatically.
Certain features of managed beans may be supported partially, depending on the type of plugin, but may work differently. This includes, but is not limited to:
PostConstruct
and PreDestroy
are called may differ.ManagedProperty
may not work with all values allowed by the Java Beans specification, and may not
perform checks such as the check for circular dependencies. It will also not create new beans when those beans have
not been created yet as part of the current page.Iterable
over the unmanaged bean classes required by the viewURL getXhtmlView()
jar:file:/...
) like so:
@Override public URL getXhtmlView() { return getClass().getResource("/path/to/view.xhtml"); }
null
. If you do return null
, it will be treated as
an error.Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.