webtier@glassfish.java.net

Problem with f:validateRegex - Bug?

From: <webtier_at_javadesktop.org>
Date: Mon, 30 Nov 2009 08:17:28 PST

Hi,
I try to generate a formular with JSF 2.01 and I want to use the regex validator for my input. The regex changes according to a value in the bean. But I can't realize it in JSF... I tried the following code:
                <ui:repeat value="#{GrammarBean.indexOfInputs}" var="indexOfInputs">
                    <h:inputText id="input" label="#{GrammarBean.namesOfInputs[indexOfInputs]}"
                                 value="#{GrammarBean.inputs[indexOfInputs]}" required="true">
                        <f:validateRegex pattern="#{GrammarBean.regEx[indexOfInputs]}" />
                    </h:inputText>
                    <h:message for="input" styleClass="errorMessage" /><br/>
                </ui:repeat>

But this generates the ErrorMessage "Regex pattern must be set to non-empty value."

everything workes fine if I changed <f:validateRegex pattern="#{GrammarBean.regEx[indexOfInputs]}" /> to <f:validateRegex pattern="#{GrammarBean.regEx[0]}" />. But this should be the same for my example. I already checked that indexOfInputs is 0 and #{GrammarBean.regEx[indexOfInputs]} is "[a-z]*". This must be a bug in the JSF API.
[Message sent by forum member 'lorion42' ]

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