FAQ Database Discussion Community


Omnifaces - ListIndexConverter, principle of operation

jsf,converter,omnifaces
I try to understand the principle of operation of the omnifaces.converter.ListIndexConverter @FacesConverter("omnifaces.ListIndexConverter") public class ListIndexConverter implements Converter { private static final String ERROR_LIST_INDEX_BOUNDS = "Index {0} for value {1} in component {2} is out of bounds."; private static final String ERROR_VALUE_NOT_IN_LIST = "Object {0} in component {1} does not appear...

Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”

primefaces,filter,datatable,omnifaces,http-request-parameters
this is an issue following this one: Primeface datatable.filter() and url parameter is use PrimeFaces-5.1 and omnifaces-2.1 to render a datatable with pagination, filtering and sorting while using request parameters. my datatable is constructed like this: <o:form includeRequestParams="true"> <p:dataTable id="hostStateHistoryTable" value="#{HostHistoryBean.hostStateHistoryList}" var="status" widgetVar="statusTable" filteredValue="#{HostHistoryBean.filteredHostStateHistoryList}" rowStyleClass="#{status.state eq 0 ? 'up' :...

Error Omnifaces o:validateOrder with Rich Faces Calendar component

jsf,richfaces,omnifaces
I have a problem when try to validate the rich:calendar component with o:validateOrder. Code: <!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:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets"...

Inject @ViewScope cdi bean into JAX-RS resource

jsf,jsf-2,jax-rs,cdi,omnifaces
I'm using MyFaces Apache 2.0.3 JSF, WAS 8.0.0.10 Currently I'm trying to inject an @ViewScope cdi bean, @ViewScope in JSF 2.0 provided by OmniFaces's library. But I get an error: WebBeans context with scope type annotation @ViewScoped does not exist within current thread. When I try to inject an @SessionScope...

java.io.NotSerializableException: org.omnifaces.taghandler.Validator

jsf-2,myfaces,omnifaces
I'm trying to use Omnifaces's validator in the following lines of code: <p:inputText value="#{createEventBean.newGuest.name}"> <o:validator validatorId="javax.faces.Required" message="Numbers only" /> </p:inputText> But I get the following error: DefaultFacele E Exiting serializeView - Could not serialize state: org.omnifaces.taghandler.Validator java.io.NotSerializableException: org.omnifaces.taghandler.Validator The most close SO discussion to this issue I find here: java.io.NotSerializableException...

Facelets error page works during ajax request with FullAjaxExceptionHandler, but does not evaluate EL during synchronous request

jsf,error-handling,web.xml,omnifaces
I am trying to configure a normal (non-ajax) request error page using Omnifaces library. I am able to use the FullAjaxExceptionHandler and with ajax request error and its page as shown in the demo. When I use the same error page with normal request the error page is shown, but...

Perhaps your web.xml contains a typo? omnifaces 1.8.1

jsf-2,web.xml,omnifaces
I am using Omnifaces 1.8.1 and I got this error while starting Tomcat 7 WebXml failed to initialize. Perhaps your web.xml contains a typo? java.lang.ClassNotFoundException: at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.omnifaces.config.WebXml.parseErrorPageLocations(WebXml.java:434) at org.omnifaces.config.WebXml.init(WebXml.java:147) at org.omnifaces.facesviews.FacesViewsInitializerListener.contextInitialized(FacesViewsInitializerListener.java:63) at...

OmniFaces UnmappedResourceHandler seems to leak resources when composite components are used

jsf-2,memory-leaks,composite-component,omnifaces,unmappedresourcehandler
It seems UnmappedResourceHandler is loading composite components xhtml files within the resources folder. The result seems a gradually increasing memory leak. The leak can be found within FaceletViewHandlingStrategy.metadataCache. It relies on a hashmap and when above handler is used UnmappedResources are used as the key for CompositeComponentBeanInfo instances. If the...

Can't get Omnifaces resource handlers to work: Unable to find resource

jsf,omnifaces
I've tried both org.omnifaces.resourcehandler.CDNResourceHandler and org.omnifaces.resourcehandler.UnmappedResourceHandler. It must be some misconfiguration, but I can't find what's wrong: faces-config-xml: <faces-config ...> <application> .... <resource-handler>org.omnifaces.resourcehandler.CDNResourceHandler</resource-handler> <resource-handler>org.omnifaces.resourcehandler.UnmappedResourceHandler</resource-handler> ... web.xml: <web-app ...> ... <context-param>...

When I use o:graphicImage, the image is not displayed

jsf,jsf-2.2,omnifaces,graphicimage
I can´t display images from my database, they are stored as bytea and I am mapping them like this: @Entity @Table(name = "photograph", schema = "public") public class Photograph{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "photograph_id", unique = true, nullable = false) private Long id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name =...

Avoid rendering empty byte array with

jsf,omnifaces,graphicimage,conditional-rendering
I got two <o:graphicImage> to display the stored image and a dummy image if there is no image. Actually, the size of the stored images can be zero. If so, the first <o:graphicImage is rendered, but the image is empty and not rendered properly. <o:graphicImage id="image" alt="Image" lastModified="#{userProfile.user.lastModified}" rendered="#{not empty...

OmniFaces Extensionless URLs and login redirect

jsf,omnifaces
I have configured my application to use OmniFaces's Extensionless URLs feature, but now that I enabled security in my web.xml, the extensionless requests do not get caught by the <security-constraint>. web.xml <!-- JSF configuration --> <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param> <context-param> <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>...

How can I embed an SVG image using JSF/OmniFaces/PrimeFaces?

jsf,jsf-2.2,omnifaces
Here's what I'm trying to do: I have a @ViewScoped JSF bean in which I call a JAX-RS service using Jersey. The resource I'm requesting returns a response with content-type image/svg+xml. Display it in a Facelet page. My research so far has lead me to believe: * h:graphicImage (Core JSF)...

o:graphicImage throws java.lang.IllegalArgumentException: argument type mismatch

jsf,jsf-2.2,omnifaces,graphicimage
I can´t display images from my database, they are stored as bytea and I am mapping them like this: @Entity @Table(name = "photograph", schema = "public") public class Photograph{ private PhotographId id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "diagnostic_id", nullable = false, insertable = false, updatable = false) private Diagnostic diagnostic;...

java.util.ServiceConfigurationError when running tests using arquillian+omnifaces

java,jsf,jboss-arquillian,omnifaces
I am getting the following error "java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.omnifaces.ApplicationInitializer not found" when running Arquillian tests. I have put the most basic test case I could here: https://www.dropbox.com/s/kou5v8kqs5g4g4m/test.zip?dl=0...

Passing argument to Resource file in o:validateOrder OmniFaces 2.0

validation,jsf,omnifaces
Hi I'm developing and application with: .JSF 2.1 .OmniFaces 2.0 I have a resource file with placeholder comun.abm.fecha.factura.menor.ultimo.comprobante=La fecha de la Factura tiene que ser mayor o igual a la ultima fecha de emision del ultimo comprobante: {0} and I have this validation: <h:outputLabel value="#{msgs['facturacion.abm.generacion.padron.fecha.factura']}" for="fechaFactura"/> <rich:calendar id="fechaFactura" datePattern="dd/MM/yyyy" showWeeksBar="false"...

omnifaces starting before openwebbeans 1.5.0?

tomcat,omnifaces,openwebbeans
I am using Java 8 / Tomcat 8 / OpenWebBeans 1.5.0 / MyFaces 2.2.8 / DeltaSpike 1.3.0. As I want to use the openwebbeans-tomcat7 module, I placed the following jars in tomcat/lib : openwebbeans-web-1.5.0.jar openwebbeans-tomcat7-1.5.0.jar openwebbeans-spi-1.5.0.jar openwebbeans-resource-1.5.0.jar openwebbeans-jsf-1.5.0.jar openwebbeans-impl-1.5.0.jar openwebbeans-el22-1.5.0.jar xbean-finder-shaded-4.1.jar xbean-asm5-shaded-4.1.jar myfaces-impl-2.2.8.jar myfaces-api-2.2.8.jar geronimo-atinject_1.0_spec-1.0.jar...

In Primefaces picklist, how to find that an item is moved from TARGET to SOURCE, Using Omnifaces Converter

jsf,jsf-2,primefaces,omnifaces
I have looked around and could not find a solution. I am using Omnifaces listConverter in the PickList component of Primefaces. When I move an item from SOURCE to TARGET. In the backing bean i get the new item ONLY on dualList.getTarget(). However when I move an item from TARGET...

Error Omnifaces 2.0 o:massAttribute with o:validateOrder

jsf-2,richfaces,omnifaces
Hi Im having this error when i try to combine o:massAttribute with o:validateOrder, i saw that o:validateOrder had the attribute disabled, any ideas what is causing this issue. I have this code: <!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:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core"...