Fórum

Sample Richfaces 4 JSF 2.1 portlet available

thumbnail
Balazs Zsoldos, modificado 12 Anos atrás.

Sample Richfaces 4 JSF 2.1 portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

After weeks of work I am happy to say that there is a sample portlet available at the Liferay community downloads.

Please read the readme file in the downloaded war file and apply the patch to Liferay in case of version 6.0.6. Also please register into JBoss and Liferay Jira and vote on the issues (mentioned in the readme) if you would like to have this solution out-of-the-box in the next versions of Liferay and JBoss technologies.

If you remove the richfaces jars from the war file this should be a simple JSF 2.1 portlet.

Regards,
Balazs
Krishnananda K, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member Postagens: 11 Data de Entrada: 24/03/14 Postagens Recentes
Hi,

I am working on Liferay 6.1 Richfaces 4 JSF 2.1. But when the portlet is deployed, I am getting the error on the developer console as "Uncaught ReferenceError: RichFaces is not defined ".

When I was searching for a sample portlet for Richfaces 4 + liferay 6.1, I came across your post. But the link for "Liferay community downloads." is not working anymore, can you please share the updated link for Sample Richfaces 4 JSF 2.1 portlet?

Regards,
Krishna
thumbnail
Neil Griffin, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
The original post in this forum thread was made before the Liferay Faces project was established. Since then we've developed a wide variety of JSF Portlet Demos including the richfaces4-portlet demo. I would recommend that you download deploy the richfaces4-portlet demo WAR in your environment and see if it works.
Krishnananda K, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member Postagens: 11 Data de Entrada: 24/03/14 Postagens Recentes
I used the sample portlet and implemented the same in my application. It worked.

Thanks.
thumbnail
Neil Griffin, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
You're very welcome Krishnananda. Thanks for using Liferay Faces emoticon
Krishnananda K, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member Postagens: 11 Data de Entrada: 24/03/14 Postagens Recentes
Hi Neil,

We took the source code from demo portlet of Richfaces4 url and imported same thing into my workspace and deployed in Liferay 6.2 CE version.
It deployed fine.But the command buttons are not working. There are no errors in the server log and developer console also.

Regards
Krishna
thumbnail
Juan Gonzalez, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Some code snippets? (xhtml and managed bean where action/actionListener is located)
Krishnananda K, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member Postagens: 11 Data de Entrada: 24/03/14 Postagens Recentes
Hi Juan,

The xhtml and managed bean are taken from the richfaces4-portlet demo.

Below is the snippet from the same

xhtml
---------
<a4j:commandButton action="#{applicantBackingBean.submit}" execute="@form" render="@all" value="#{i18n['submit']}" />

<h:commandButton action="/views/portletEditMode.xhtml?javax.portlet.faces.PortletMode=edit&amp;javax.portlet.faces.WindowState=maximized" immediate="true" value="#{i18n['edit-preferences']}" />


ManagedBean method
--------------------------------

public String submit() {

if (logger.isDebugEnabled()) {
logger.debug("firstName=" + applicantModelBean.getFirstName());
logger.debug("lastName=" + applicantModelBean.getLastName());
logger.debug("emailAddress=" + applicantModelBean.getEmailAddress());
logger.debug("phoneNumber=" + applicantModelBean.getPhoneNumber());
logger.debug("dateOfBirth=" + applicantModelBean.getDateOfBirth());
logger.debug("city=" + applicantModelBean.getCity());
logger.debug("provinceId=" + applicantModelBean.getProvinceId());
logger.debug("postalCode=" + applicantModelBean.getPostalCode());
logger.debug("comments=" + applicantModelBean.getComments());

List<UploadedFile> uploadedFiles = applicantModelBean.getUploadedFiles();

for (UploadedFile uploadedFile : uploadedFiles) {
logger.debug("uploadedFile=[{0}]", uploadedFile.getName());
}
}

// Delete the uploaded files.
try {
List<UploadedFile> uploadedFiles = applicantModelBean.getUploadedFiles();

for (UploadedFile uploadedFile : uploadedFiles) {
uploadedFile.delete();
logger.debug("Deleted file=[{0}]", uploadedFile.getName());
}

// Store the applicant's first name in JSF 2 Flash Scope so that it can be picked up
// for use inside of confirmation.xhtml
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().getFlash().put("firstName", applicantModelBean.getFirstName());

applicantModelBean.clearProperties();

return "success";

}
catch (Exception e) {
logger.error(e.getMessage(), e);
FacesMessageUtil.addGlobalUnexpectedErrorMessage(FacesContext.getCurrentInstance());

return "failure";
}
}
thumbnail
Juan Gonzalez, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Thanks.

It's working fine for me. Did you change anything from the original richfaces 4 portlet demo?
thumbnail
Juan Gonzalez, modificado 10 Anos atrás.

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Hi Krishnananda,

if you didn't use the whole downloaded richfaces 4 demo WAR, then maybe there are some wrong configuration for some files.

For example, did you added

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


to your liferay-portlet.xml files, as stated here?:

https://github.com/liferay/liferay-faces/blob/3.2.4-ga5/demos/bridge/richfaces4-portlet/src/main/webapp/WEB-INF/liferay-portlet.xml#L9