掲示板

Sample Richfaces 4 JSF 2.1 portlet available

thumbnail
12年前 に Balazs Zsoldos によって更新されました。

Sample Richfaces 4 JSF 2.1 portlet available

Junior Member 投稿: 41 参加年月日: 06/04/12 最新の投稿
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
10年前 に Krishnananda K によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member 投稿: 11 参加年月日: 14/03/24 最新の投稿
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
10年前 に Neil Griffin によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
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.
10年前 に Krishnananda K によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member 投稿: 11 参加年月日: 14/03/24 最新の投稿
I used the sample portlet and implemented the same in my application. It worked.

Thanks.
thumbnail
10年前 に Neil Griffin によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
You're very welcome Krishnananda. Thanks for using Liferay Faces emoticon
10年前 に Krishnananda K によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member 投稿: 11 参加年月日: 14/03/24 最新の投稿
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
10年前 に Juan Gonzalez によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Some code snippets? (xhtml and managed bean where action/actionListener is located)
10年前 に Krishnananda K によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

New Member 投稿: 11 参加年月日: 14/03/24 最新の投稿
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
10年前 に Juan Gonzalez によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

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

It's working fine for me. Did you change anything from the original richfaces 4 portlet demo?
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Sample Richfaces 4 JSF 2.1 portlet available

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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