[s2] Custom field validator with params containing OGNL expression

View: New views
2 Messages — Rating Filter:   Alert me  

[s2] Custom field validator with params containing OGNL expression

by Cristian Peraferrer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I have implemented a field validator that validates the username is
not already in the database (to avoid overwriting).
But in the validator call (or configuration), I need to pass a
parameter that is another field in the form. Here my code:

<field-validator type="usernameavailable">
      <param name="userId">${enterprise.enterpriseId}</param>
      <message>This username is already taken.</message>
    </field-validator>

The 'userId' is a Long value. I have tested putting a hardcoded long
value (<param name="userId">34</param>) and it worked, but
it doesn't like the OGNL expression. What I'm doing wrong?

Thanks in advance,
Cristian.

--
GPG Key-ID: 0x564903FA - JID: corellian@...

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: [s2] Custom field validator with params containing OGNL expression

by Lukasz Lenart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/7/7 Cristian Peraferrer <corellian.c@...>:
> <field-validator type="usernameavailable">
>      <param name="userId">${enterprise.enterpriseId}</param>
>      <message>This username is already taken.</message>
>    </field-validator>

Do you have a getter called getEnteriprise() on an action?


Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

Mary Pickford  - "Adding sound to movies would be like putting
lipstick on the Venus de Milo." -
http://www.brainyquote.com/quotes/authors/m/mary_pickford.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...