Thursday, February 28, 2013
Sunday, February 24, 2013
Workaround for p:column colspan
Recently, I was facing a problem with the p:datatable colspan attribute.
I wanted to conditionally colspan the table cell, but I failed to do that. And I found its impossible to do it now from the Primefaces forum.
Finally, I came out with a workaround with jQuery.
Instead of the colspan attribute, I used the styleClass attribute to dynamically adjust the table's colspan.
I wanted to conditionally colspan the table cell, but I failed to do that. And I found its impossible to do it now from the Primefaces forum.
Finally, I came out with a workaround with jQuery.
Instead of the colspan attribute, I used the styleClass attribute to dynamically adjust the table's colspan.
Tuesday, February 19, 2013
How to setup Liferay Remote IDE Connector
Liferay Remote IDE Connector provides remote development and deployment support from Liferay IDE. With the help of this plugin, we may also enable the remote development and deployment to non-tomcat Liferay bundled.
This post shows the steps to setup the Liferay Remote IDE Connector and the target Liferay with JBoss bundled.
Theoretically, it should works fine with other server bundled as well.
Platform:
Liferay 6.1.1
Eclipse Juno
1. Make sure Liferay development environment is setup.
2. Download Server Manager Web plugin
Steps:
1. Start the Remote Liferay instance or local non-tomcat Liferay instance.
2. Deploy the Server Manger Web plugin into the target Liferay instance.
put the downloaded lpkg file into the <TARGET_LIFERAY>/deploy folder
Friday, February 15, 2013
How to change portlet title's icon in Liferay
When we create a new portlet in Liferay with Liferay SDK, there come with a default icon in front of the portle title.
We can actually change the icon, so that it is more precise to present our portlet.
The purpose to change the default icon is to differentiate our custom portlet with Liferay's portle, we can change the icon to our flagship logo, to increase users' awareness.
It is pretty simple to change the default title icon, below are the steps.
We can actually change the icon, so that it is more precise to present our portlet.
The purpose to change the default icon is to differentiate our custom portlet with Liferay's portle, we can change the icon to our flagship logo, to increase users' awareness.
It is pretty simple to change the default title icon, below are the steps.
Wednesday, February 13, 2013
How to integrate OpenAM with Liferay for single sign on (SSO)
the objective of this post is to show the steps of how to enable SSO in Liferay with OpenAM.
Assumption:
1. OpenDJ is installed as LDAP for Liferay
2. OpenAM is installed.
Required software:
1. Liferay 6.1.1
2. OpenDJ 2.5
3. OpenAM 10.2
Steps:
1. login to Liferay as Administrator
2. Go to > Control Panel > Portal Settings > Authentication > Open SSO
3. Fill in the following details
Assumption:
1. OpenDJ is installed as LDAP for Liferay
2. OpenAM is installed.
Required software:
1. Liferay 6.1.1
2. OpenDJ 2.5
3. OpenAM 10.2
Steps:
1. login to Liferay as Administrator
2. Go to > Control Panel > Portal Settings > Authentication > Open SSO
3. Fill in the following details
Saturday, February 9, 2013
rendered attribute in Primefaces
There is a known issue with the rendered attribute in Primefaces -- the element can't be updated if it doesn't exist in DOM.
Thus, there could be problem to render it with ajax.
eg,
<h:panelGroup id="pg" rendered="#{testBean.flag}">
<h:outputLabel value="this is a panel group" />
</h:panelGroup>
above sample can't be render with ajax.
There are 2 workarounds to resolve the above situation.
Saturday, February 2, 2013
jQuery selector in JSF2
Ajax support is one of the major upgrade of JSF2 over JSF1.2.
with ajax support in JSF2, we can decide the list of components to be rendered with the "render" attribute, and the list of components to be executed on the server with the "execute" attribute.
eg,
in some situations, we may want to execute or render many components. Thus, the list could be very long. and reduce development efficiency.
in this case, jQuery selector could be used to find components based on classes, types, id, etc instead of specifying a long list of component ids.
With jQuery selector, it could find only input components, or by element type, eg text, select.
Performance could be slightly improved because only required components are rendered or executed.
with ajax support in JSF2, we can decide the list of components to be rendered with the "render" attribute, and the list of components to be executed on the server with the "execute" attribute.
eg,
<f:ajax listener="#{testBean.listener}" execute="id1 id2 id3" render="id1 id4" />
in some situations, we may want to execute or render many components. Thus, the list could be very long. and reduce development efficiency.
in this case, jQuery selector could be used to find components based on classes, types, id, etc instead of specifying a long list of component ids.
With jQuery selector, it could find only input components, or by element type, eg text, select.
Performance could be slightly improved because only required components are rendered or executed.
Dynamic Include
Dynamic include is a technique to programmatically include or toggle content into predefined position of a page. It can also uses to create wizard like application by toggle the contents of the wizard.
Benefits of dynamic include
- save bandwidth
- reduce page size
- reduce server memory with smaller component tree
- reduce page loading time
Disadvantages of dynamic include
- increase complexity
Example
- How to create layout with dynamic include
- dynamic include in Richfaces tabPanel
- How to create wizard with dynamic include in JSF2
- Dynamic include with richfaces popupPanel
Benefits of dynamic include
- save bandwidth
- reduce page size
- reduce server memory with smaller component tree
- reduce page loading time
Disadvantages of dynamic include
- increase complexity
Example
- How to create layout with dynamic include
- dynamic include in Richfaces tabPanel
- How to create wizard with dynamic include in JSF2
- Dynamic include with richfaces popupPanel
Labels:
dynamic include,
Facelets,
JSF,
JSF2,
Primefaces,
Richfaces
Subscribe to:
Posts (Atom)
Popular Posts
- How to handle multilingual error messages for jQuery validation plugins
- How to use jQuery validation plugin in JSF
- How to switch EJB client to local or remote interface without changing code
- How to display dynamic PDF document with <p:media /> component
- Getting started with Oracle SQL developer Data modeler
- Hacking the JBoss JNDI Datasource configuration
- java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE from [Module "deployment.ROOT.war:main" from Service Module Loader]
- How to load file(s) in the same directory
- How to increase console line number in Eclipse
- How to verify jQuery in Richfaces 4 is working