Databases Reference
In-Depth Information
af:outputText
af:outputText
is used to display the text in the page. The component supports styles and
the escaped text.
af:message
To display a message inside a popup we use the
af:message
component. To display global
messages for the page, we use the
af:messages
component with the
globalOnly
atribute
set to
true
. The
af:message
type can be configured as
fatal
,
info,
error,
warning
,
and
confirmation
. The
for
atribute will idenify the component for which the message has
to be shown. The
message
atribute will hold the message that is displayed to the user.
Showing the message programmatically
ADF allows you to programmaically show a message. ADF uses the JSF messaging API to
display the messages.
FacesMessage
is added to the
FacesContext
object by adding the
message using the
addMessage(String clientId,FacesMessage message)
method.
Use the following snippet to show the
af:message
component globally. If we pass a client
of the component, the message will be shown for the component.
String messageString="Info Message";
FacesMessage fm = new FacesMessage(messageString);
fm.setSeverity(FacesMessage.SEVERITY_INFO);
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, fm);
//to show for the component use this code
context.addMessage(getInputComponent().getClientId(context),
fm); // getInputComponent is the binding for the component
that you would like to show the message.
af:outputFormatted
The
af:outputFormatted
component is just like the
af:outputText
component but
supports the HTML mark-ups and formated results.
Layout components
Layout components are mainly used to arrange the content of the page in a standard way
so that the view of the content is presentable and fits perfectly for the user. The layout
components someime act as a container to hold the elements collecively or separately
to uilize the space in the page uniformly.
Search WWH ::
Custom Search