* Are the javascripts embedded into the Castle DLLs, or are they meant
to be provided by me in my content/js directory (and if the latter,
what is the convention for directory layout?)?

Not for jQuery AFAIK

* How do I provoke MonoRail into spitting out a jQuery script include
inside of the head of the rendered page?

There is some InstallScripts methods in Form and Ajax helpers, but
seems legacy code that work with prototype only.

Better do that explicitely

* My first objective is to get up and running with jQuery-provided
client-side validation

here is the steps I've followed to make this work with jQuery:
- implement IMonoRailConfigurationEvents and register jquery
validation helper see below
- Setup your validation attributes on your "dto"
- Put an empty dto in your property bag
- build the form with the helper:
 * FormTag (you may pass jquery validate options:
http://docs.jquery.com/Plugins/Validation/validate#options)
 * Push("propertybag_dto_instance_itemname")
 * build the form with the helper
 * Pop
 * EndFormTag

the client side validation will be generated on the FormHelper.EndForm

Validator configuration

configuration
        .JSGeneratorConfiguration
        .AddLibrary("jquery",
typeof(JQueryValidator.JQueryValidationGenerator))
        .BrowserValidatorIs(typeof(JQueryValidator))
        .SetAsDefault();

Tell us if it works for you.

On Oct 1, 12:58 pm, petemounce <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I'm running on Castle's trunk, and am at the stage where I have some
> functional controllers, views (using Spark), server-side validation
> going on.  I'd now like to hook in client-side validation but using
> jQuery + jQuery's validate plugin, not Prototype/fValidate.  I've had
> a look around, here, on the dev list, and the internet in general
> (including hammet's blog where he talks about how this works in donjon
> a little), but not found a resource that resembles a howto for it
> this; I realise it's only on the current trunk.  I also haven't
> gleaned much from reading the test-cases around jQuery that exist in
> the test projects.
>
> I've seen a post talking about implementing IMonoRailConfiguration on
> my HttpApplication then adding code like:
>                         
> configuration.JSGeneratorConfiguration.AddLibrary("jquery-1.2.6",
> typeof (JQueryGenerator))
>                                 .AddExtension(typeof (CommonJSExtension))
>                                 .ElementGenerator
>                                 .AddExtension(typeof (JQueryElementGenerator))
>                                 .Done
>                                 .BrowserValidatorIs(typeof (JQueryValidator))
>                                 .SetAsDefault();
> but to be honest, I don't know what I should expect after that - for
> example, my Form.InstallScripts() method call in my layout seems to
> still output prototype's validation script (or, well, one that uses
> Prototype); Ajax.InstallScripts() outputs prototype.
>
> So I've got a bunch of questions re: Javascript in MonoRail in
> general:
> * Are the javascripts embedded into the Castle DLLs, or are they meant
> to be provided by me in my content/js directory (and if the latter,
> what is the convention for directory layout?)?
> * How do I provoke MonoRail into spitting out a jQuery script include
> inside of the head of the rendered page?
> * Can I register other script includes, conditionally - I guess I 
> wanthttp://using.castleproject.org/display/Contrib/JavascriptComponent?
> * If I use JavascriptComponent, how do I leverage Ajax/Form/etc helper
> to generate JS for me rather than write it manually?
>
> My first objective is to get up and running with jQuery-provided
> client-side validation, but after that I'll be looking at more general
> Javascript usage...  Thanks in advance!
>
> Regards
> Pete
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to