掲示板

Primefaces rowexpansion not working with LR 6.2

10年前 に Micael Ericsson によって更新されました。

Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
I have a JSF portlet where p:datatable and rowexpansion works in Liferay 6.1.2 but not in Liferay 6.2. Both latest CE.

In Liferay 6.2 when clicking arrow to expand row nothing happens. Clicking arrow again removes row visally. F5 and table is back.

I have tried with PrimeFaces 3.5 and 4.0. Same problem. Suggestions why this fails in LR 6.2 ?

Code snippet

<!--?xml version="1.0" encoding="UTF-8"?-->
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 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:aui="http://liferay.com/faces/aui" xmlns:poaa="http://portletfaces.org/alloyfaces/aui" xmlns:p="http://primefaces.org/ui" template="testPrimeFacesTemplate.xhtml">
    <ui:define name="content">
                <p:datatable id="playerTable" var="player" value="#{testPrimeFacesController.resultList}" style="width: 570px;">  
                    <p:column style="width:2%">  
                        <p:rowtoggler />  
                    </p:column>  
                    <p:column style="width:5%; text-align: center;">  
                        <f:facet name="header">  
                            Pos
                        </f:facet>  
                        <h:outputtext value="#{player.position}" />  
                    </p:column>  
                    <p:rowexpansion>  
                        <div style="width: 60%;display:inline-block">
                            <h:outputlabel value="Poängserie: " for="ra" style="font-weight: bold" />  
                            <h:outputtext value="#{player.resultatAlla}" id="ra" />  
                        </div>
                    </p:rowexpansion>
                </p:datatable>
    </ui:define>
</ui:composition>
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Micael,

did you set

<requires-namespaced-parameters>false</requires-namespaced-parameters>


in liferay-portlet.xml?
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Juan Gonzalez:
Hi Micael,

did you set

<requires-namespaced-parameters>false</requires-namespaced-parameters>


in liferay-portlet.xml?


No. This is not set in either setup. What does it do? Is this something new for Liferay 6.2?
This is my liferay-portlet.xml:
<liferay-portlet-app>
	<portlet>
		<portlet-name>TestPrimeFaces</portlet-name>
		<icon>/icon.png</icon>
		<instanceable>false</instanceable>
		<ajaxable>false</ajaxable>
		<header-portlet-css>/css/main.css</header-portlet-css>
	</portlet>
	<role-mapper>
		<role-name>administrator</role-name>
		<role-link>Administrator</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>guest</role-name>
		<role-link>Guest</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>power-user</role-name>
		<role-link>Power User</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>user</role-name>
		<role-link>User</role-link>
	</role-mapper>
</liferay-portlet-app>
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Micael Ericsson:

No. This is not set in either setup. What does it do? Is this something new for Liferay 6.2?


It's a new method due to an improvement for namespacing all parameters.

As you can see in all Liferay Faces demo apps, is a needed parameter.
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Juan Gonzalez:
Micael Ericsson:

No. This is not set in either setup. What does it do? Is this something new for Liferay 6.2?


It's a new method due to an improvement for namespacing all parameters.

As you can see in all Liferay Faces demo apps, is a needed parameter.



Thanks. I'll give it a try later today.
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
The parameter suggested didn't help me. But perhaps I missplaced it. I got the following error:
Error on line 11 of document : Element type "requires-namespaced-parameters" must be declared. Nested exception: Eleme
nt type "requires-namespaced-parameters" must be declared.
com.liferay.portal.kernel.xml.DocumentException: Error on line 11 of document : Element type "requires-namespaced-param
eters" must be declared. Nested exception: Element type "requires-namespaced-parameters" must be declared.
at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:426)
at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:444)
at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:161)
at com.liferay.portal.service.impl.PortletLocalServiceImpl._readLiferayPortletXML(PortletLocalServiceImpl.java:1
801)
at com.liferay.portal.service.impl.PortletLocalServiceImpl.initWAR(PortletLocalServiceImpl.java:793)


My liferay-portlet.xml is
<!--?xml version="1.0"?-->


<liferay-portlet-app>
    <portlet>
        <portlet-name>TestPrimeFaces</portlet-name>
        <icon>/icon.png</icon>
        <instanceable>false</instanceable>
        <ajaxable>false</ajaxable>
        <header-portlet-css>/css/main.css</header-portlet-css>
        <requires-namespaced-parameters>false</requires-namespaced-parameters>
    </portlet>
    <role-mapper>
        <role-name>administrator</role-name>
        <role-link>Administrator</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>guest</role-name>
        <role-link>Guest</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>power-user</role-name>
        <role-link>Power User</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>user</role-name>
        <role-link>User</role-link>
    </role-mapper>
</liferay-portlet-app>


But I wonder if you can supply och point out a working portlet project for Liferay 6.2. It must be a maven project and work in NetBeans 7.4. I have tried Eclipse and Liferay developer studio and I prefer NetBeans. I will have dependecies to other maven projects. Thus my "demands". Since I am using JSP and PrimeFaces in my portlet it would be nice to have their dependecies in the maven project also. Currently I am using PrimeFaces 3.5 JSF 2.1.21, but PrimeFaces 4.0 will work even better.
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Seems you are using the wrong DTD:


 3


you should use 6.2, not 6.1.

There are some liferay-portlet.xml samples in github:

https://github.com/liferay/liferay-faces/tree/3.2.4-ga5/demos
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
You can always use liferay faces maven archetypes (there are some available) or get some demo portlets as a template (from github in my previous message).
thumbnail
10年前 に Neil Griffin によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Juan is right -- also, order matters. So the element needs to be placed in the correct location. Here is the jsf2-portlet/src/main/webapp/liferay-portlet.xml file as an an example.
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Neil Griffin:
Juan is right -- also, order matters. So the element needs to be placed in the correct location. Here is the jsf2-portlet/src/main/webapp/liferay-portlet.xml file as an an example.


I have been developing portlets for Liferay 6.1.x for over a year. In this project we have a "base" maven project we start from when creating new portlets.

I thought it would be easy to use this "template" to create a portlet for Liferay 6.2. Now I have been struggeling for plenty of hours. In the start of this thread I had a portlet whichs worked with 6.2 but didn't display correct - now unfortunately I have nothing.

I tried to use demo portlet from github as suggested. I started with demo/portal/primefaces4-user-portlet. Didn't get it to work. At first the versions of liferay-faces-alloy and more had versions not possible to download - at least NetBeans could not do it. After I changed dependency back to latest possible to find (3.2.4-GA5) I could get project to compile. But upon deploy I get resource listeners error and other.

I tried with maven archetype for liferay portlet jsf. Project created and some dependencies had missing version ids. Added as below, but then compilation failed with "Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.0-RC5:build-css (default) on project MvnArchTestJsf: null: MojoExecutionException: NullPointerException -> [Help 1]"

I also tried "liferay-portlet-primefaces-archetype" but same error messages after updateing version ids.

pom.xml for liferay-portlet-jsf-archetype
<!--?xml version="1.0"?-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelversion>4.0.0</modelversion>
    <groupid>se.adherrgolf</groupid>
    <artifactid>MvnArchTestJsf</artifactid>
    <packaging>war</packaging>
    <name>MvnArchTestJsf Portlet</name>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupid>com.liferay.maven.plugins</groupid>
                <artifactid>liferay-maven-plugin</artifactid>
                <version>6.2.0-RC5</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>build-css</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
                    <appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
                    <appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
                    <appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
                    <liferayversion>${liferay.version}</liferayversion>
                    <plugintype>portlet</plugintype>
                </configuration>
            </plugin>
            <plugin>
                <artifactid>maven-compiler-plugin</artifactid>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.7
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactid>maven-resources-plugin</artifactid>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupid>commons-fileupload</groupid>
            <artifactid>commons-fileupload</artifactid>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupid>commons-io</groupid>
            <artifactid>commons-io</artifactid>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.faces</groupid>
            <artifactid>liferay-faces-bridge-impl</artifactid>
            <version>3.2.4-ga5</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.faces</groupid>
            <artifactid>liferay-faces-portal</artifactid>
            <version>3.2.4-ga5</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.portal</groupid>
            <artifactid>portal-service</artifactid>
            <version>6.2.0-RC5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>com.liferay.portal</groupid>
            <artifactid>util-java</artifactid>
            <version>6.2.0-RC5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>com.sun.faces</groupid>
            <artifactid>jsf-api</artifactid>
            <version>2.1.21</version>
        </dependency>
        <dependency>
            <groupid>com.sun.faces</groupid>
            <artifactid>jsf-impl</artifactid>
            <version>2.1.21</version>
        </dependency>
        <dependency>
            <groupid>javax.el</groupid>
            <artifactid>el-api</artifactid>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>javax.portlet</groupid>
            <artifactid>portlet-api</artifactid>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>org.jboss.seam</groupid>
            <artifactid>jboss-el</artifactid>
            <version>2.0.0.GA</version>
            <exclusions>
                <exclusion>
                    <artifactid>el-api</artifactid>
                    <groupid>javax.el</groupid>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupid>org.primefaces</groupid>
            <artifactid>primefaces</artifactid>
            <version>3.5</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
        </repository>
        <repository>
            <id>maven2-repository.jboss.org</id>
            <name>JBoss Maven Repository</name>
            <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
        </repository>
        <repository>
            <url>http://repository.primefaces.org/</url>
            <id>PrimeFaces-maven-lib</id>
            <layout>default</layout>
            <name>Repository for library PrimeFaces-maven-lib</name>
        </repository>
    </repositories>
</project>


It would help a lot if you could provide me with a simple as possible NetBeans maven project for Liferay 6.2 with no parent pom.xml, From that I can work to get JSF and PrimeFaces into place. Or if you can get this archetype to work with correct version id for dependecies.
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Micael,

are you getting these examples from 3.2.4-ga5 github tag? This is pretty important.

If you want an easy example with no parent pom, then I suggest you to use latest Liferay IDE (2.0.1). There you can create a maven Liferay Faces project with one single pom.xml. It even lets you set all properties within the same pom.xml or change your user settings.xml. Then you can use this project in Netbeans.
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
My goal is to get this working from NetBeans with archetype. I am not interested in using Liferay studio nor Eclipse.
I have upgraded to newly released NetBeans 8.0. Still using Liferay 6.2.0 ce ga1 with Ms Sql Server 2008R2.

Simple scenario which ends in exception passing through settings error.
1) From NetBeans new project, maven archetype. Selecting "liferay-portlets-primefaces-archetype". Version: 6.2.0-RC5 from repo.maven.paache.org/maven2.
2) Clean/Build in NB gives following error:
'dependencies.dependency.version' for com.liferay.portal:portal-service:jar must be a valid version but is '${liferay.version}'. @ line 75, column 13
'dependencies.dependency.version' for com.liferay.portal:util-java:jar must be a valid version but is '${liferay.version}'. @ line 81, column 13
'build.plugins.plugin.version' for com.liferay.maven.plugins:liferay-maven-plugin must be a valid version but is '${liferay.maven.plugin.version}'. @ line 15, column 14
3) Correcting by setting "liferay.version" to "6.2.0-RC5" as suggested latest version by NB autocomplete. And setting "liefary.maven.plugin.version" to "6.2.0-RC5" also suggested.
4) Clean/Build again gives:
Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.0-RC5:build-css (default) on project MvnAchPrimeTest2: null: MojoExecutionException: NullPointerException -> [Help 1]


And then I am stuck. I can't find any clues on how to proceed. Please help.
Current pom.xml
<!--?xml version="1.0"?-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelversion>4.0.0</modelversion>
    <groupid>se.adherrgolf</groupid>
    <artifactid>MvnAchPrimeTest2</artifactid>
    <packaging>war</packaging>
    <name>MvnAchPrimeTest2 Portlet</name>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupid>com.liferay.maven.plugins</groupid>
                <artifactid>liferay-maven-plugin</artifactid>
                <version>6.2.0-RC5</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>build-css</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
                    <appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
                    <appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
                    <appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
                    <liferayversion>${liferay.version}</liferayversion>
                    <plugintype>portlet</plugintype>
                </configuration>
            </plugin>
            <plugin>
                <artifactid>maven-compiler-plugin</artifactid>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.7
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactid>maven-resources-plugin</artifactid>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupid>commons-fileupload</groupid>
            <artifactid>commons-fileupload</artifactid>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupid>commons-io</groupid>
            <artifactid>commons-io</artifactid>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.faces</groupid>
            <artifactid>liferay-faces-bridge-impl</artifactid>
            <version>3.2.4-ga5</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.faces</groupid>
            <artifactid>liferay-faces-portal</artifactid>
            <version>3.2.4-ga5</version>
        </dependency>
        <dependency>
            <groupid>com.liferay.portal</groupid>
            <artifactid>portal-service</artifactid>
            <version>6.2.0-RC5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>com.liferay.portal</groupid>
            <artifactid>util-java</artifactid>
            <version>6.2.0-RC5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>com.sun.faces</groupid>
            <artifactid>jsf-api</artifactid>
            <version>2.1.21</version>
        </dependency>
        <dependency>
            <groupid>com.sun.faces</groupid>
            <artifactid>jsf-impl</artifactid>
            <version>2.1.21</version>
        </dependency>
        <dependency>
            <groupid>javax.el</groupid>
            <artifactid>el-api</artifactid>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>javax.portlet</groupid>
            <artifactid>portlet-api</artifactid>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupid>org.jboss.seam</groupid>
            <artifactid>jboss-el</artifactid>
            <version>2.0.0.GA</version>
            <exclusions>
                <exclusion>
                    <artifactid>el-api</artifactid>
                    <groupid>javax.el</groupid>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupid>org.primefaces</groupid>
            <artifactid>primefaces</artifactid>
            <version>3.5</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
        </repository>
        <repository>
            <id>maven2-repository.jboss.org</id>
            <name>JBoss Maven Repository</name>
            <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
        </repository>
        <repository>
            <id>maven2-repository.primefaces.org</id>
            <name>PrimeFaces Maven Repository</name>
            <url>http://repository.primefaces.org</url>
        </repository>
    </repositories>
</project>
thumbnail
10年前 に Neil Griffin によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Hi Micael,

I just now wrote in this other post that I think it is safe for developers to remove the following from the pom.xml descriptor, provided that the developer does not make utilize the <header-portlet-css> feature of the WEB-INF/liferay-portlet.xml descriptor:

<executions>
    <execution>
        <phase>generate-sources</phase>
        <goals>
            <goal>build-css</goal>
        </goals>
    </execution>
</executions>


Also, I would recommend that you use version 6.2.0-ga1 from repository.liferay.com.

Kind Regards,

Neil
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Neil Griffin:
Hi Micael,

I just now wrote in this other post that I think it is safe for developers to remove the following from the pom.xml descriptor, provided that the developer does not make utilize the <header-portlet-css> feature of the WEB-INF/liferay-portlet.xml descriptor:

<executions>
    <execution>
        <phase>generate-sources</phase>
        <goals>
            <goal>build-css</goal>
        </goals>
    </execution>
</executions>


Also, I would recommend that you use version 6.2.0-ga1 from repository.liferay.com.

Kind Regards,

Neil


Thanks for the information.

Regarding CSS which is best practice if you will keep style specific info in portlet.
- Using <h:outputStylesheet library="css" name="/main.css" /> in portlets jsf pages
- Using <header-portlet-css>
thumbnail
10年前 に Neil Griffin によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
For JSF portlets, I would recommend using the JSF way:

<h:outputstylesheet library="css" name="main.css" />


The main benefits are:

1. Works in both a JSF webapp and a JSF portlet
2. When running as a portlet, it generates a portlet ResourceURL which is fully compatible with WSRP
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Neil Griffin:
For JSF portlets, I would recommend using the JSF way:

<h:outputstylesheet library="css" name="main.css" />


The main benefits are:

1. Works in both a JSF webapp and a JSF portlet
2. When running as a portlet, it generates a portlet ResourceURL which is fully compatible with WSRP


Hi Neil

In my Liferay 6.1 project all my portlets has "<header-portlet-css>/css/main.css</header-portlet-css>" in liferay-portlet.xml. It works fine.

But according to your suggestion I tried to change this by removing entry from liferay-portlet.xml and add the following to xhtml file:
<!--?xml version="1.0" encoding="utf-8"?-->
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:portlet="http://java.sun.com/portlet_2_0" xmlns:jsp="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions">

	<f:event type="preRenderView" listener="#{minaHandlingarController.initPage}" />

	<h:head>
		<script type="text/javascript">
			if ('#{minaHandlingarController.errorUrl}') {
				window.location.href = ("#{minaHandlingarController.errorUrl}");
			}
		</script>		
		<h:outputstylesheet library="css" name="main.css" />
	</h:head>

	<h:body>
		<h:messages class="se-trm-web" />            
		<h:panelgroup layout="block" styleclass="rm-info">
...
</h:panelgroup></h:body></f:view>


Rebuilt and redeployed portlet and now styling is gone and if I use view page source I can't find main.css reference - it was there in the old solution.

I tried to put "h:outputStylesheet" in different places without any luck. I also played around with library and name but no luck.

My css is located at "[project root]\src\main\webapp\css\main.css".

Suggestions why this doesn't work?
thumbnail
10年前 に Neil Griffin によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
My css is located at "[project root]\src\main\webapp\css\main.css"


If your library name is "css" then the default location that JSF expects the resources would be under src/main/webapp/resources/css

The jsf2-portlet demo has a css in the "examples" library. The file is located under the src/main/webapp/resources/example folder.
10年前 に Micael Ericsson によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Regular Member 投稿: 169 参加年月日: 12/12/11 最新の投稿
Neil Griffin:
My css is located at "[project root]\src\main\webapp\css\main.css"


If your library name is "css" then the default location that JSF expects the resources would be under src/main/webapp/resources/css

The jsf2-portlet demo has a css in the "examples" library. The file is located under the src/main/webapp/resources/example folder.


So settings in Liferay and in JSF points to different base. Why?

I guess this would work. I move my main.css to "[project root]\src\main\webapp\resource\css\"

If I want to access from lifera-portlet.xml I have:
- <header-portlet-css>/resource/css/main.css</header-portlet-css>

If I want to access from setting in xhtml-fil I have:
- <h:outputStylesheet library="css" name="main.css" />

Correct?
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Primefaces rowexpansion not working with LR 6.2

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Micael Ericsson:

So settings in Liferay and in JSF points to different base. Why?


This is the "convention" applied in JSF 2.x. If you want to have your custom resources path, then you have two options:


* Upgrade to JSF 2.2 and use this new context-param:

https://javaserverfaces.java.net/nonav/docs/2.2/javadocs/javax/faces/application/ResourceHandler.html#WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME

* Use your own ResourceHandler and get resources in that base path by default.

Micael Ericsson:

Correct?


Yes, seems correct.
thumbnail
10年前 に Neil Griffin によって更新されました。

Moved to Liferay Faces - English sub-category.

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Moved to Liferay Faces - English sub-category.