我开始在Hibernate项目中使用带有primefaces库的JSF。我尝试使用向导组件来管理表单,但是,当我单击向导中的任何按钮时,我收到以下警告,并且未调用动作侦听器。
我认为问题在于,在向导中有一些p:commandButton,因为当我使用h:commandButton时,一切正常。 someine可以用什么方式解释primefaces commandButton与标准的不同,我怎么能面对这个问题呢?渲染过程中有什么不同?
感谢您的帮助! 这是警告:
9-ott-2012 9.50.43 org.apache.myfaces.trinidadinternal.context.PartialViewContextImpl getPartialResponseWriter
AVVERTENZA: getPartialResponseWriter() called during render_reponse. The returned writer is not integrated with PPRResponseWriter
以下是该页面的代码:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<h:outputScript name="jsf.js" library="javax.faces" target="head" />
</h:head>
<h:body>
<p:growl id="growl" showDetail="true" sticky="true" />
<h:form>
<p:wizard widgetVar="wiz"
flowListener="#{traduttoreBean.onFlowProcess}">
<p:tab id="personali" title="Info Personali">
<p:panel header="Informazioni Personali">
<h:messages errorClass="error"/>
<h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">
<h:outputText value="Nome: *" />
<p:inputText required="true" label="Nome"
value="#{traduttoreBean.info.nome}" />
<h:outputText value="Cognome: *" />
<p:inputText required="true" label="cognome"
value="#{traduttoreBean.info.cognome}" />
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab id="confirm" title="Confirmation">
<p:panel header="Confirmation">
<h:panelGrid id="confirmation" columns="6">
<h:outputText value="Nome: " />
<h:outputText styleClass="outputLabel"
value="#{traduttoreBean.info.nome}" />
<h:outputText value="Cognome: " />
<h:outputText styleClass="outputLabel"
value="#{traduttoreBean.info.cognome}" />
<h:outputText />
</h:panelGrid>
<p:commandButton value="Submit" update="growl" action="#{traduttoreBean.save}" ></p:commandButton>
</p:panel>
</p:tab>
</p:wizard>
</h:form>
</h:body>
</html>
关联的bean:
public class TraduttoreBean implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private Traduttore traduttore;
private InfoTraduttore info;
public TraduttoreBean(){
this.traduttore=new Traduttore();
this.info= new InfoTraduttore();
this.info.setTraduttore(traduttore);
}
public void save(ActionEvent actionEvent) {
PersistenzaUtenti pu= PersistenzaUtenti.getInstance();
PersistenzaInfoTraduttori pi= PersistenzaInfoTraduttori.getInstance();
try {
pu.insert(traduttore);
pi.insert(info);
} catch (Exception e) {
}
FacesMessage msg = new FacesMessage("Successful", "Welcome :" + info.getNome());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public String onFlowProcess(FlowEvent event) {
return event.getNewStep();
}
public Traduttore getTraduttore() {
return traduttore;
}
public void setTraduttore(Traduttore traduttore) {
this.traduttore = traduttore;
}
public InfoTraduttore getInfo() {
return info;
}
public void setInfo(InfoTraduttore info) {
this.info = info;
}
}
对于bean的声明,我已经尝试了注释@Managed bean和faces-config文件。 这是我的定义:
<managed-bean>
<managed-bean-name>traduttoreBean</managed-bean-name>
<managed-bean-class>guiBeans.TraduttoreBean</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
</managed-bean>
答案 0 :(得分:0)
评论提供的答案:
问题是特立尼达图书馆与之发生冲突 Primefaces。解决了删除Trinidad库的问题。