Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Christopher Olbertz
<liferay-ui:icon> is not shown in JSF
29 juin 2012 00:05
Réponse

Christopher Olbertz

Rang: Regular Member

Publications: 102

Date d'inscription: 21 novembre 2007

Publications Récentes

Good morning,

I am working with LiferayFaces and now I want to use <liferay-ui:icon> and followed the documentation to LiferayFaces. But it does not work. The image is not shown. Does anybody know, what I am doing wrong?

This is my xhtml page.

 1
 2<?xml version="1.0"?>
 3
 4<f:view xmlns:f="http://java.sun.com/jsf/core"
 5     xmlns:h="http://java.sun.com/jsf/html"
 6    xmlns:ui="http://java.sun.com/jsf/facelets"
 7    xmlns:p="http://primefaces.org/ui"
 8    xmlns:liferay-ui="http://liferay.com/faces/ui">
 9       
10        <h:head></h:head>
11       
12        <h:form>   
13            <liferay-ui:icon alt="#{i18n['delete']}" image="delete" />
14        </h:form>
15</f:view>


Thank you,

Christopher
Neil Griffin
RE: <liferay-ui:icon> is not shown in JSF
29 juin 2012 04:00
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2228

Date d'inscription: 26 juillet 2005

Publications Récentes

Hi Christopher,

Very nice to hear from you -- glad to see that you're still working with JSF portlets emoticon

I just tried adding the following markup to applicant.xhtml inside the primefaces3-portlet demo and it worked OK:

1<liferay-ui:icon alt="#{i18n['delete']}" image="delete" />


Do you see any error messages in the browser or server log?

You might want to add the following to your WEB-INF/web.xml descriptor:

1<context-param>
2    <param-name>javax.faces.PROJECT_STAGE</param-name>
3    <param-value>Development</param-value>
4</context-param>


At first had forgotten to add the liferay-faces-portal dependency to the project, and javax.faces.PROJECT_STAGE=Development caused a nice meaningful error message to appear in the browser.

Neil
Christopher Olbertz
RE: <liferay-ui:icon> is not shown in JSF
29 juin 2012 05:39
Réponse

Christopher Olbertz

Rang: Regular Member

Publications: 102

Date d'inscription: 21 novembre 2007

Publications Récentes

Hi Neil,

thank you for your answer. And you remember me? That's nice emoticon

I haven't worked with portlets for a long time, but then I finished my studies and now I am working with the university where I studied. And we want to create a portal for our students - with Liferay and JSF (PrimeFaces ) of course.

I tried adding the line in die PrimeFaces example too, but now, I am getting the warning: This page calls for XML namespace http://liferay.com/faces/ui declared with prefix liferay-ui but no taglibrary exists for that namespace.

Is there anything missing?
Neil Griffin
RE: <liferay-ui:icon> is not shown in JSF
29 juin 2012 06:32
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2228

Date d'inscription: 26 juillet 2005

Publications Récentes

Congrats on the new job -- that's the school near Lutherstadt Wittenberg right?

Yes that's the same error message that I saw. Make sure that the liferay-faces-portal dependency is added to your pom.xml
Christopher Olbertz
RE: <liferay-ui:icon> is not shown in JSF
2 juillet 2012 05:02
Réponse

Christopher Olbertz

Rang: Regular Member

Publications: 102

Date d'inscription: 21 novembre 2007

Publications Récentes

Hi Neil,

thanks. No, it is in Saarbrücken, Saarland.

I think, I won't use <liferay-ui:icon> any more. I wanted to try portlet action buttons with JSF, but I think I will abdicate JSF for the admin portlets.
Neil Griffin
RE: <liferay-ui:icon> is not shown in JSF
2 juillet 2012 06:15
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2228

Date d'inscription: 26 juillet 2005

Publications Récentes

Oh that's right -- I remember now that you were close to the border of Germany and France.

Just curious, did you ever get liferay-ui:icon working in your JSF admin portlet?
Christopher Olbertz
RE: <liferay-ui:icon> is not shown in JSF
2 juillet 2012 08:17
Réponse

Christopher Olbertz

Rang: Regular Member

Publications: 102

Date d'inscription: 21 novembre 2007

Publications Récentes

Yes, 10 minutes with the bus and I am in France emoticon

No, I didn't. It does not work. But I had some other work to do and I didn't try it again. Now I want to try a new simple example.

But is it possible to build something like the portlet action buttons with JSF or is it better to create single <h:commandButton> for each function? I jope you know, what I mean.

Is it possible to use JSF portlets and MCV portlets in one single war file or will this cause troubles?
Neil Griffin
RE: <liferay-ui:icon> is not shown in JSF
2 juillet 2012 08:44
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2228

Date d'inscription: 26 juillet 2005

Publications Récentes

I would recommend that you look at the source code for the icefaces3-users-portlet demo which uses liferay-ui:icon to show a delete button for deleting the user in the list of users.

Also the icefaces3-documents-portlet demo uses liferay-ui:icon for add document, etc.
Atif Hussain
RE: <liferay-ui:icon> is not shown in JSF
14 octobre 2013 00:10
Réponse

Atif Hussain

Rang: Junior Member

Publications: 47

Date d'inscription: 3 avril 2012

Publications Récentes

Hi Neil, I tried all the solutions you told above, I am facing the same problem.
I am using liferay-portal-6.1.1-ce-ga2 and liferay-plugins-sdk-6.1.1-ce-ga2.
Vernon Singleton
RE: <liferay-ui:icon> is not shown in JSF
14 octobre 2013 05:30
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 226

Date d'inscription: 14 janvier 2013

Publications Récentes

Hello Atif,

Atif Hussain:
Hi Neil, I tried all the solutions you told above, I am facing the same problem.
I am using liferay-portal-6.1.1-ce-ga2 and liferay-plugins-sdk-6.1.1-ce-ga2.

So, you tried the icefaces3-document-portlet that Neil mentions above? When I tried that portlet just now in liferay-portal-6.1.1-ce-ga2, the liferay-ui:icon shows up just fine when adding a document.

What is the exact error that you are getting?

- Vernon
Atif Hussain
RE: <liferay-ui:icon> is not shown in JSF
15 octobre 2013 07:11
Réponse

Atif Hussain

Rang: Junior Member

Publications: 47

Date d'inscription: 3 avril 2012

Publications Récentes

hi Vernon, There is a correction, I did not use the sample portlet rather rather I copied the xhtml name spaces from the sample portlet.
I created ice faces portlet using Eclipse SDK, and liferay:ui is not even giving any suggestions.
Below are libs and xhtml snapshots
Attachement

Attachement

Pièces jointes: 10-15-2013 7-04-01 PM.png (5,9k), 10-15-2013 7-06-43 PM.png (31,6k)
Vernon Singleton
RE: <liferay-ui:icon> is not shown in JSF
15 octobre 2013 08:13
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 226

Date d'inscription: 14 janvier 2013

Publications Récentes

Atif Hussain:
Below are libs and xhtml snapshots
...
jsf-api-2.1.3-b02.jar
jsf-impl-2.1.3-b02.jar
...


So, again, you will probably want to try the demo, and make sure that it is working with your instance of the Liferay Portal first.
The version you are using of the liferay-faces-bridge-impl-3.1.2-ga3.jar, for example, was tested and released to be used with mojarra's jsf-impl-2.1.21 as you can see here, not to be used with jsf-api-2.1.3-b02 as you have tried.

My best advice is that you follow the version scheme for Liferay Faces here, and try out the demo portlets, which will give you working examples with all of the correct versions of every jar.

That way, when you go to construct your own portlet, you can either start with a working portlet using the source code of one of the demos, or at least know the expected versions of every jar you will need in your project which should play nicely with the version of the Liferay Portal you are running.

Hope that helps,
Vernon
Atif Hussain
RE: <liferay-ui:icon> is not shown in JSF
15 octobre 2013 10:15
Réponse

Atif Hussain

Rang: Junior Member

Publications: 47

Date d'inscription: 3 avril 2012

Publications Récentes

Thats great, I am doing as you have told, will come back shortly.
Atif Hussain
RE: <liferay-ui:icon> is not shown in JSF
15 octobre 2013 12:26
Réponse

Atif Hussain

Rang: Junior Member

Publications: 47

Date d'inscription: 3 avril 2012

Publications Récentes

I tried compiling icefaces3-documents-portlet using maven but there is an error.

1[ERROR] Failed to execute goal on project icefaces3-documents-portlet: Could not resolve dependencies for project com.liferay.faces.demos:icefaces3-do
2cuments-portlet:war:3.1.3-ga4: Failure to find org.jboss.seam:jboss-el:jar:2.0.0.GA in http://repo.maven.apache.org/maven2 was cached in the local rep
3ository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced ->
Vernon Singleton
RE: <liferay-ui:icon> is not shown in JSF
15 octobre 2013 18:45
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 226

Date d'inscription: 14 janvier 2013

Publications Récentes

Atif Hussain:
Failed to execute goal on project icefaces3-documents-portlet: Could not resolve dependencies for project com.liferay.faces.demos:icefaces3-do
cuments-portlet:war:3.1.3-ga4: Failure to find org.jboss.seam:jboss-el:jar:2.0.0.GA in http://repo.maven.apache.org/maven2 was cached in the local rep
ository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced ->

Did you put the repository entries from the settings.xml file into your own settings.xml file? To get rid of that error you will need this entry in your ~/.m2/settings.xml file:

1<repository>
2         <id>public-jboss</id>
3         <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
4</repository>


And you will want to now, remove the directory called "~/.m2/repository/org/jboss/seam/jboss-el" from your local .m2/repository, and then re-execute the "mvn clean package" command. All of the directories I have mentioned here may be named something different, especially if you are on windows, or if you have configured maven in some non-default way.

Also, you should be able to just try the icefaces-documents-portlet war that you can download from this page here. Just make sure that you get the right version of the demo for your version of Liferay Portal following this version scheme. That way you can go to the Liferay Control Panel, and see the working portlet for yourself, to make sure that you are starting with the right versions of everything.

- Vernon
Atif Hussain
RE: <liferay-ui:icon> is not shown in JSF
3 décembre 2013 11:20
Réponse

Atif Hussain

Rang: Junior Member

Publications: 47

Date d'inscription: 3 avril 2012

Publications Récentes

Hi Vernon, At last after a long time and long effort I am able to resolve the issue I mentioned above. Things mentioned by you and Neil in above posts are correct definitely.
The only issue was that my Eclipse IDE was not giving suggestions for liferay-ui.
Now I have figured out that liferay-ui tags were already working but I never try to use them because Eclipse was not giving me suggestion, and I was assuming that there were some issues.
So today I just copied and pasted
1<liferay-ui:info message="Hello" />
and checked if it displays some thing, and luckily it worked emoticon
I dont know if it is really IDE fault or there is any ticket in jirra for this or not. Can you suggest how can I fix my IDE ?
Vernon Singleton
RE: <liferay-ui:icon> is not shown in JSF
3 décembre 2013 12:23
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 226

Date d'inscription: 14 janvier 2013

Publications Récentes

Not sure what to say about the tag completion in the IDE ... i'm looking into it.

Glad to hear that you got things working.

Welcome to the Liferay Faces development community :-)