Question

I have a portlet application in a WebCenter env. This application is made using JSF (with the ADF implementation), so I have a field like that:

<af:inputText visible="#{CadastrarFormularioContato.showCodigoEc}"
                        label="#{msg.CODIGODOEC}" id="it2" required="true"
                        requiredMessageDetail="#{msg.INFORMECODIGOEC}"
                        showRequired="true"
                        value="#{CadastrarFormularioContato.item.cdEstabelecimento}">                        
                        <af:validateRegExp messageDetailNoMatch="#{msg.CODIGOECSOMENTENUMEROS}" pattern="^[0-9]{1,}$"/>              
                        <af:convertNumber type="number"/>
                        </af:inputText>

But, when I invoke the form submit i receive the follow error:

javax.portlet.faces.BridgeException: java.lang.IllegalArgumentException: 'value' is not of type java.lang.String.

My Object.longField is:

private Long longField

(with its getters/setters)

I try to use convert, convertNumber etc but with no sucess.

The problem is about the "validateRegExp" tag (if i remove it, works) So, why?

Any suggestion?

Was it helpful?

Solution

The validateRegExp only accepts Strings. If you can change the java class, then adding a String field to shadow the Long is an easy fix. If not, you can write your own regex validator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top