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:
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