Reputation:
Im developing an application with JSF2, PrimeFaces, Spring, Hibernate. In Console DOES NOT present/show any error. However, some of PrimeFaces components are not working. I think it is incompatibility with a Library, but I did not discover which one(s). Here follows my libraries:
aspectjrt-1.6.8.jar
c3p0-0.9.1.jar
commons-beanutils-1.8.0.jar
commons-codec-1.7.jar
commons-collections-3.2.1.jar
commons-digester-1.8.1.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
ehcache-core-2.4.3.jar
ejb3-persistence.jar
hibernate-c3p0-4.1.7.Final.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.1.7.Final.jar
hibernate-ehcache-4.1.7.Final.jar
hibernate-entitymanager-4.1.7.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
itext-2.1.7.jar
javassist-3.15.0-GA.jar
javax.faces-2.1.17.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
jstl.jar
jta-1.1.jar
org.springframework.aop-3.1.2.RELEASE.jar
org.springframework.asm-3.1.2.RELEASE.jar
org.springframework.aspects-3.1.2.RELEASE.jar
org.springframework.beans-3.1.2.RELEASE.jar
org.springframework.context-3.1.2.RELEASE.jar
org.springframework.core-3.1.2.RELEASE.jar
org.springframework.expression-3.1.2.RELEASE.jar
org.springframework.jdbc-3.1.2.RELEASE.jar
org.springframework.jms-3.1.2.RELEASE.jar
org.springframework.orm-3.1.2.RELEASE.jar
org.springframework.oxm-3.1.2.RELEASE.jar
org.springframework.transaction-3.1.2.RELEASE.jar
org.springframework.web-3.1.2.RELEASE.jar
poi-3.7.jar
postgresql-9.1-902.jdbc4.jar
primefaces-3.4.1.jar
rome-1.0.jar
slf4j-api-1.5.2.jar
slf4j-nop-1.5.2.jar
spring-security-acl-3.1.3.RELEASE.jar
spring-security-core-3.1.3.RELEASE.jar
spring-security-taglibs-3.1.3.RELEASE.jar
Thanks a lot! :)
EDIT
This is one of the components that is not working. It should return to me toner names and models:
<p:selectOneMenu id="modeloToner" value="#{tonerBean.modeloToner}">
<p:ajax update="form:impressorasCompativeis" listener="#tonerBean.findImpressorasCompativeis}" process="form:modeloToner" />
<f:selectItem itemLabel="Selecione..." itemValue="Nenhum" />
<f:selectItems value="#{tonerBean.listModeloToner}" />
</p:selectOneMenu>
Generated HTML, it has the values but is not working. Other components are not working either.
<select id="form:modeloToner_input" name="form:modeloToner_input">
<option value="Nenhum">Selecione...</option>
<option value="HP 530">HP 530</option>
<option value="HP 532" selected="selected">HP 532</option>
<option value="HP 53X">HP 53X</option>
<option value="Lexmark 12738826">Lexmark 12738826</option>
<option value="Samsung 208L">Samsung 208L</option>
</select>
Upvotes: 0
Views: 249
Reputation: 157
I think your p:selectOneMenu does not return the value because it does not have converter. Improve your question for other components and let us try to solve
<p:selectOneMenu id="modeloToner" value="#{tonerBean.modeloToner}" converter="converter">
<p:ajax update="form:impressorasCompativeis" listener="#tonerBean.findImpressorasCompativeis}" process="form:modeloToner" />
<f:selectItem itemLabel="Selecione..." itemValue="Nenhum" />
<f:selectItems value="#{tonerBean.listModeloToner}" />
</p:selectOneMenu>
and the converter class
@FacesConverter(value="converter")
public class Converter implements Converter {
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
YourObject o = new YourObject();
// some operations to set the parameters of Object based on the String
return location;
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
YourObject o = (YourObject) value;
String string;
// some operations to save the parameters of Object into a String
return string;
}
}
Upvotes: 1