webtier@glassfish.java.net

JSF2 Nightly Build - Custom Component and Form Submit

From: <webtier_at_javadesktop.org>
Date: Tue, 31 Mar 2009 09:19:04 PDT

I made a simple component that only allows numbers in the inputText but it throws an invalid argument exception. It's pretty simple so i cant find any problem in it.

        <composite:interface>
            <composite:attribute name="value"/>
        </composite:interface>
        
        <composite:implementation>
                <script type="text/javascript">
                /* <![CDATA[ */
              function isNumberKey(evt)
              {
                 var charCode = (evt.which) ? evt.which : event.keyCode
                 if (charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;
        
                 return true;
              }
                /* ]]> */
                </script>
                <h:inputText value="#{compositeComponent.attrs.value}" onkeypress="return isNumberKey(event)"/>
        </composite:implementation>

The error:

javax.faces.component.UpdateModelException: javax.el.ELException: /resources/componentes/inputNumero.xhtml @23,98 value="#{compositeComponent.attrs.value}": /crud.xhtml @15,65 value="#{crudTeste.pessoa.idade}": java.lang.IllegalArgumentException: argument type mismatch

idade is a Integer.

Thks in advance,

Israel
[Message sent by forum member 'israelbgf' (israelbgf)]

http://forums.java.net/jive/thread.jspa?messageID=339890