Forums de discussion

<liferay-ui:icon> is not shown in JSF

Christopher Olbertz, modifié il y a 11 années.

<liferay-ui:icon> is not shown in JSF

Regular Member Publications: 107 Date d'inscription: 21/11/07 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.


<!--?xml version="1.0"?-->

<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:liferay-ui="http://liferay.com/faces/ui">
		
		<h:head></h:head>
		
		<h:form>	
			<liferay-ui:icon alt="#{i18n['delete']}" image="delete" />
		</h:form>
</f:view>


Thank you,

Christopher
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 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:

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

<context-param>
	<param-name>javax.faces.PROJECT_STAGE</param-name>
	<param-value>Development</param-value>
</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, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Regular Member Publications: 107 Date d'inscription: 21/11/07 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?
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 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, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Regular Member Publications: 107 Date d'inscription: 21/11/07 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.
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 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, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Regular Member Publications: 107 Date d'inscription: 21/11/07 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?
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: <liferay-ui:icon> is not shown in JSF

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 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.
thumbnail
Atif Hussain, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Junior Member Publications: 47 Date d'inscription: 03/04/12 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.
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Expert Publications: 315 Date d'inscription: 14/01/13 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
thumbnail
Atif Hussain, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Junior Member Publications: 47 Date d'inscription: 03/04/12 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
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Expert Publications: 315 Date d'inscription: 14/01/13 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
thumbnail
Atif Hussain, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Junior Member Publications: 47 Date d'inscription: 03/04/12 Publications récentes
Thats great, I am doing as you have told, will come back shortly.
thumbnail
Atif Hussain, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Junior Member Publications: 47 Date d'inscription: 03/04/12 Publications récentes
I tried compiling icefaces3-documents-portlet using maven but there is an error.

[ERROR] 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 -&gt;
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Expert Publications: 315 Date d'inscription: 14/01/13 Publications récentes
Atif Hussain:
[ERROR] 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:

<repository>
         <id>public-jboss</id>
         <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
</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
thumbnail
Atif Hussain, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Junior Member Publications: 47 Date d'inscription: 03/04/12 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
<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 ?
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: <liferay-ui:icon> is not shown in JSF

Expert Publications: 315 Date d'inscription: 14/01/13 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 :-)