Foren

problem with jsf forms in liferay portal 6.1

thumbnail
Rachid EL MAAZOUZ, geändert vor 11 Jahren.

problem with jsf forms in liferay portal 6.1

New Member Beiträge: 14 Beitrittsdatum: 11.03.13 Neueste Beiträge
Hi all I have a problem with a JSF+Primefaces portlet,

the form is not well presented some elements are missing, but when I change the fields's bean it just wok fine


Here is the form:


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

<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:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
	<h:head />
	<h:body>

		<h:form>
			<p:panel id="panel" header="Application inscription">


				<h:panelgrid columns="2">
					<h:outputlabel value="Code*" />
					<p:inputtext id="code" value="#{applicationInscriptionBean.code}" required="true" style="width:300px;" />

					<h:outputlabel value="Name*" />
					<p:inputtext value="#{applicationInscriptionBean.name}" required="true" style="width:300px;" />

					<h:outputlabel value="Abreviated name" />
					<p:inputtext value="#{applicationInscriptionBean.abrevName}" required="true" style="width:300px;" />

					<h:outputlabel value="Status" />
					<p:selectonemenu value="#{applicationInscriptionBean.status}" style="width:300px;">
						<f:selectitems var="status" value="#{constantes.applicationStatusValues}" itemLabel="#{status.description}" itemValue="#{status}" />

					</p:selectonemenu>

				</h:panelgrid>

				<p:commandbutton value="Add" onclick="confirmation.show()" type="button" />

				<p:commandbutton value="Return" action="application-list.xhtml?faces-redirect=true" ajax="false" immediate="true" />
			</p:panel>

			<p:confirmdialog id="confirmationDialog" message="adding a new application" severity="alert" widgetvar="confirmation" header="Application registration">


				<p:commandbutton id="confirm" value="Add" oncomplete="confirmation.hide()" ajax="false" action="#{applicationInscriptionBean.submit}" />
				<p:commandbutton id="decline" value="Return" onclick="confirmation.hide()" type="button" />
			</p:confirmdialog>
		</h:form>
	</h:body>
</f:view>



the bean causing problem is



import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class ApplicationInscriptionBean implements Serializable {

	private static final long serialVersionUID = 1L;

	@ManagedProperty(value = "#{applicationInscriptionService}")
	private ApplicationInscriptionRemote applicationInscriptionService;

	private Long id;
	private String code;
	private String name;
	private String abrevName;
	private ApplicationStatus status;

	public String submit() {
		ApplicationDTO applicationDTO = new ApplicationDTO(this.code,
				this.name, this.abrevName, this.status);
		applicationInscriptionService.subscribe(applicationDTO);
		System.out.println("after the interface call");
		return "application-list.xhtml?faces-redirect=true";

	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAbrevName() {
		return abrevName;
	}

	public void setAbrevName(String abrevName) {
		this.abrevName = abrevName;
	}

	public ApplicationStatus getStatus() {
		return status;
	}

	public void setStatus(ApplicationStatus status) {
		this.status = status;
	}

}




thanks for help

I am using Tomcat 7.0.26
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: problem with jsf forms in liferay portal 6.1

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
When you get a chance, please download the primefaces3-portlet WAR and try it in your environment. I'd be interested to know if the styling looks OK.