6.18.  < a4j:portlet >

6.18.1. Description

The <a4j:portlet> can be used in portals. The main component purpose is realization of possibility to create several instances the same portlet on one page.

Table 6.35. a4j : portlet attributes

Attribute NameDescription
bindingThe attribute takes a value-binding expression for a component property of a backing bean
idEvery component may have a unique id that is automatically created if omitted
renderedIf "false", this component is not rendered

Table 6.36. Component identification parameters

NameValue
component-typeorg.ajax4jsf.Portlet
component-familyorg.ajax4jsf.component.Portlet
component-classorg.ajax4jsf.component.html.HtmlPortlet

6.18.2. Creating the Component with a Page Tag

To create the simplest variant on a page use the following syntax:



<f:view>
    <a4j:portlet>
    ...
    </a4j:portlet>
</f:view>

6.18.3. Creating the Component Dynamically Using Java



import org.ajax4jsf.component.html.HtmlPortlet;
...
HtmlPortlet myPortlet = new HtmlPortlet();
...

6.18.4. Key attributes and ways of usage

Portal page can include some instances of the same portlet but clientId of elements should be different for each window. In that case namespace is used for each portlet. The <a4j:portlet> implemets NaimingContainer interface and adds namespace to all componets on a page. All portlet content should be wrapped by <a4j:portlet> for resolving problems mentioned before.

6.18.5. Relevant resources links

Here you can found some additional information for <a4j:portlet> component usage.

The aditional information about component usage you can find here: Ajax4Jsf Users Forum.

Portlet Sample could be checked out from JBoss SVN: portal-echo application.

Usage instructions for this demo could be found at the corresponding: portal-echo application.