Saturday, March 29, 2014
Wednesday, March 26, 2014
How to generate styled PDF in Liferay PrimeFaces Portlet with iText
In the previous post,
How to generate PDF in Liferay PrimeFaces Portlet with iText shows how to generate a PDF document, unfortunately, the generated PDF is not able to handle style class.
How to generate PDF in Liferay PrimeFaces Portlet with iText shows how to generate a PDF document, unfortunately, the generated PDF is not able to handle style class.
eg,
<!DOCTYPE HTML><html><body>Generate <strong>PDF</strong> Test</body></html>
can be generated without any problem.
but,
<!DOCTYPE HTML><html><body>Generate <span style='color: red;'>PDF</span> Test</body></html>
is unable to generate the text with red color.
Sunday, March 23, 2014
JSTL namespace in JSF2.x
Remember to use "http://java.sun.com/jsp/jstl/core" instead of "http://java.sun.com/jstl/core" in JSF2.x
Done!!
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
................................
</ui:composition>
Done!!
How to support multiple languages for Portlet category in Liferay
Wednesday, March 12, 2014
java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE from [Module "deployment.ROOT.war:main" from Service Module Loader]
Where using Liferay 6.1.1 with JBoss AS 7.1.1, the following exception could be happen.
17:38:10,244 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[jsp]] (http-localhost-127.0.0.1-8080-2) Servlet.service() for servlet jsp threw exception: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE from [Module "deployment.ROOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
Tuesday, March 4, 2014
How to resolve jQuery conflict in Liferay
In some cases, we need to install jQuery in Liferay especially the custom theme to achieve some UI features.
But that could be conflict with jQuery that come along with custom portlet.
eg, RichFaces portlet, PrimeFaces portlet, IceFaces portlet.
as long as we add the following line of code in Liferay theme,
then the conflict could be resolved.
Done!!
But that could be conflict with jQuery that come along with custom portlet.
eg, RichFaces portlet, PrimeFaces portlet, IceFaces portlet.
as long as we add the following line of code in Liferay theme,
then the conflict could be resolved.
jQuery.noConflict(true)
Done!!
Sunday, March 2, 2014
How to pass parameters with <a4j:jsFunction />
<a4j:jsFunction /> allowed us to send JSF ajax request with javascript function.
sample
But the above implementation has a limitation,
where not allowed us pass parameter(s) to #{myBean.jsAction}
This issue could be resolved by adding <a4j:param /> under <a4j:jsFunction />
The <a4j:param /> associates to a property in managed bean, and inject the param value into managed bean before the action being fired.
Thus, the action (#{myBean.jsAction}) can get the param1 value from the getter.
sample
<a4j:commandButton
value="TEST"
action="#{myBean.action}"
oncomplete="myJsFunction();" />
<a4j:jsFunction name="myJsFunction" action="#{myBean.jsAction}" />
But the above implementation has a limitation,
where not allowed us pass parameter(s) to #{myBean.jsAction}
This issue could be resolved by adding <a4j:param /> under <a4j:jsFunction />
The <a4j:param /> associates to a property in managed bean, and inject the param value into managed bean before the action being fired.
Thus, the action (#{myBean.jsAction}) can get the param1 value from the getter.
Subscribe to:
Comments (Atom)
Popular Posts
- How to create database view with Oracle SQL Developer Data Modeler
- How to add/remove row in datatable
- How to easily embed a Google Map in your website
- Velocity without template(.vm) file
- How to create relational data model with Oracle SQL Developer Data Modeler
- How to edit Liferay email notification templates
- How to add Sequence Generator to a table in Oracle SQL Developer Data Modeler
- How to backup Oracle SQL Developer Data Modeler project
- How to export data model to DDL with Oracle SQL Developer Data Modeler
- How to switch EJB client to local or remote interface without changing code

