Foros de discusión

Liferay Faces + Primefaces Schedule not displaying

Chris Dailey, modificado hace 9 años.

Liferay Faces + Primefaces Schedule not displaying

Junior Member Mensajes: 30 Fecha de incorporación: 24/11/14 Mensajes recientes
I'm quite new to portals and portlets and Liferay (ETA: and likewise with Liferay Faces JSF portlet bridge), but I've done a fair amount of programming with JSF and Primefaces on Tomcat. I'm working on displaying some data from a database inside a portlet using a Primefaces p:schedule. I've had some luck, but also some problems. I think I've solved all I can solve by going through the documentation.

Here's the relevant part of the view:

	<h:form>
		<p:schedule value="#{calendarBean.eventModel}" initialdate="#{calendarBean.initialDate}" timezone="GMT" id="monthlySchedule" showheader="true" view="month">
		</p:schedule>
	</h:form>


This results in:



As you can see, I'm able to load events and display them (I put a <Resource...> entry in the server's context.xml, and then used DataAccess.getConnection("jdbc/someDBresource"); to get the DB Connection) and I even managed to figure where to put the styles, and it all loads fine and shows up (I cut off the contents but you can see the tops of the first row of events). However, much of the styling is missing!

Here's the interesting part. When I add the test portlet I previously made that uses just <p:calendar> to the page, all of the <p:schedule>'s headers and buttons have the right appearance/style! This is what I get:



Apparently the use of the regular p:calendar in the test portlet forces Primefaces to load something or another that is not being loaded by the portlet/view that uses p:schedule.

I'm using the Liferay 6.2 Tomcat bundle, which has Primefaces 3.5 included. According to its manifest, the Liferay JSF bridge is: 3.2.4-ga5 (Ephesus / Feb 15, 2014 AD).

Any ideas why the <p:schedule> would not load resources on its own? Is this a Primefaces bug? Should I try a newer version of Primefaces, perhaps 5.0 or 5.1 (and if so where would I update it)? Any other ideas to try?
thumbnail
Juan Gonzalez, modificado hace 9 años.

RE: Liferay Faces + Primefaces Schedule not displaying (Respuesta)

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Chris,

I've made a quick test and is working fine for me using your same environment:

  • single p:schedule
  • Liferay Faces 3.2.4
  • Primefaces 3.5
  • Liferay 6.2


Can you simplify your managed beans getters (calendarBean.eventModel) to not use DB access, so we can delimit where the error comes from?

Did you followed the right xml configuration from here?

https://github.com/liferay/liferay-faces/tree/3.2.4-ga5/demos/bridge/primefaces3-portlet/src/main/webapp/WEB-INF
Chris Dailey, modificado hace 9 años.

RE: Liferay Faces + Primefaces Schedule not displaying

Junior Member Mensajes: 30 Fecha de incorporación: 24/11/14 Mensajes recientes
Juan, ¡Gracias para la respuesta! Muchas cosas buenas para considerar.

Summary: Since you were able to create a new project without problems, I'm trying to compare a new portlet project with the existing portlet project to see if I can get this behavior to repeat. So far the new project is working. If the new project continues to work as I add features and configurations from the one that is not working, I'll just recreate the original project. If I find at some point what in the new project is different from the old one, I'll let you know.

Juan Gonzalez:
Can you simplify your managed beans getters (calendarBean.eventModel) to not use DB access, so we can delimit where the error comes from?


I verified there were no errors in the methods getting the events for the schedule. However, I removed the value="..." line altogether, and still had the problem.

Juan Gonzalez:
Did you followed the right xml configuration from here?

https://github.com/liferay/liferay-faces/tree/3.2.4-ga5/demos/bridge/primefaces3-portlet/src/main/webapp/WEB-INF


I think I'm pretty close overall to what is there.

1. faces-config.xml
I don't have a bundle, but I don't think that it would make a difference.
Missing ViewScopePhaseListener. Added it:
<phase-listener>com.liferay.faces.util.lifecycle.ViewScopePhaseListener</phase-listener>
It did not seem to help.

2. liferay-display.xml
Only the portlet ID differs, which I presume is not an issue.

3. liferay-plugin-package.properties
I don't have one of these. It looks more like something that would have affect packaging up the portlet.

4. liferay-portlet.xml
Lots of differences, naturally. I have instanceable, remoteable, requires-namespaced-parameters, and ajaxable all set the same. I also have render-weight, header-portlet-css, footer-portlet-javascript, css-class-wrapper, and add-default-resource set.

5. portlet.xml
Looks mostly similar. I have no help page, and I have an expiration-cache set to 0.

6. web.xml
I don't have a com.liferay.faces.bridge.primeFileUploadForceResourceURL context param and I map to *.jsf instead of *.xhtml; I also don't have any security constraints or roles defined.

7. weblogic.xml - I'm not using weblogic so I don't think it matters. But I do have an extra "<wls:library-ref> <wls:library-name>jsf</wls:library-name> </wls:library-ref>" section in there.

NEXT STEPS:

  • I tried creating a new Liferay plugin project, and creating a new JSF portlet with a simple p:schedule in it.
  • Dragged the test project into the server.
  • Went to a page without any other items on it, added the new JSF portlet and it looked fine.
  • Looked for differences in configuration files.
  • liferay-portlet.xml: Added instanceable, remoteable, requires-namespaced-parameters, render-weight, ajaxable, and add-default-resource as in the project that is not working, and it still worked.
  • portlet.xml: the new one did not have an edit mode, so I added it, but it continued working.


I'm continuing on this path. I'll post updates with what I find out.
thumbnail
Juan Gonzalez, modificado hace 9 años.

RE: Liferay Faces + Primefaces Schedule not displaying

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Chris Dailey:

  • I tried creating a new Liferay plugin project, and creating a new JSF portlet with a simple p:schedule in it.
  • Dragged the test project into the server.
  • Went to a page without any other items on it, added the new JSF portlet and it looked fine.
  • Looked for differences in configuration files.
  • liferay-portlet.xml: Added instanceable, remoteable, requires-namespaced-parameters, render-weight, ajaxable, and add-default-resource as in the project that is not working, and it still worked.
  • portlet.xml: the new one did not have an edit mode, so I added it, but it continued working.


I'm continuing on this path. I'll post updates with what I find out.


Glad to hear it's working for your now.

Thanks.
Chris Dailey, modificado hace 9 años.

RE: Liferay Faces + Primefaces Schedule not displaying (Respuesta)

Junior Member Mensajes: 30 Fecha de incorporación: 24/11/14 Mensajes recientes
Hi, Juan,

I couldn't find a definitive cause for the problem. I'm now thinking that the problem arose because I ran the ANT script at one time in the project. That made a number of changes, including copying a bunch of files into WEB-INF/lib that are already in the Ivy library. There were probably other changes that I can't track down, and I've now spent way too much time on that and need to move on. But your prodding me to create a new project got me on the path of being able to move forward again, so thank you very much!.

In summary, creating a fresh project worked around this problem.

Chris
thumbnail
Kyle Joseph Stiemann, modificado hace 9 años.

Moved.

Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Moved to Home » Liferay Faces » Liferay Faces - English.