webtier@glassfish.java.net

Re: [webtier] f:ajax event attribute won't accept expression

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Tue, 02 Jun 2009 21:14:54 -0700

On 6/2/09 12:42 PM, Paulo Cesar Reis wrote:
> Hi, thanks for the answer.
>
> I cannot use the simple way 'cause I'm creating a complex composite
> application that automatically add validators for field. See my attached
> sample.
>
> So I really need to use f:param (or something that can do what I need) for
> validators and also for converters (whether available).

Looking at your code, what it looks like is that you're passing the
validators as an attribute to the component. Couldn't you instead add
the attributes to the component itself? For example:

in the using page,

instead of :

<comp:component validators=#{validatorList}/>

do:

<comp:component id="one">
<f:validateLength for="two" minimum="3" maximum="5"/>
</comp:component>

Would that work? I haven't tested this (still at the conference), but
if it will fulfill your need, I can see what's required to make that
work (or, if pressed for time, you could try it and see).

Jim


> Thanks.
>
> On 6/2/09 1:38 PM, "Jim Driscoll"<Jim.Driscoll_at_Sun.COM> wrote:
>
>> Sorry I was so terse earlier - I was waiting for the train, and wasn't
>> sure when I'd get to email again.
>>
>> But to answer the second part of your question:
>>
>>> On Jun 2, 2009, at 8:01 AM, Paulo Cesar Reis<casmeiron_at_gmail.com
>>> <mailto:casmeiron_at_gmail.com>> wrote:
>>>> Also I¹m wondering whether I can use f:param tag to define properties
>>>> for validators, like:
>>>> <f:validator validatorId=²javax.faces.Length²>
>>>> <f:param name=²minimum² value=²1² />
>>>> <f:param name=²maximum² value=²3² />
>>>> </f:validator>
>>>>
>>>> Whether not, how can I accomplish the desired behavior?
>> I'm not really sure what you're trying to do. Shouldn't
>> <f:validateLength maximum="15" minimum="6"/> work?
>>
>> But, though I'm not 100% positive, I don't think validate handles
>> params. But that isn't necessary in your example, is it?
>>
>> Jim
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>>
>