PeteM,<br><br>The two places to look for server-side management of these is Jifty::Action and you can look through Jifty::Action::Record. Particularly the _canonicalize_argument method of Jifty::Action. The work in Jifty::Action::Record is primarily just some connective tissue to make Jifty::Record canonicalizers become Jifty::Action canonicalizers.
<br><br>The canonicalization code in JavaScript for the client-side can be found in share/web/static/js/jifty.js. Here you can look for the validate method of the Action object. Canonicalization takes place by scanning for XML nodes named "canonicalizeaction", so searching for that should get you to the client-side code that is most specific to what you're looking for.
<br><br>You may also want to look at share/web/templates/__Jifty/webservices/xml if you think there might be something wonky with the transport mechanism between the action code on the server and the client-side code.<br>
<br>I hope that gets you started.<br><br>Cheers,<br>Andrew<br><br><div><span class="gmail_quote">On 1/5/08, <b class="gmail_sendername">Peter Mottram</b> <<a href="mailto:peter@sysnix.com">peter@sysnix.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I'm seeing some weirdness when using canonicalize_ inside my model as<br>there is a difference between how the ajax call handles things (badly) and
<br>how the final POST request handles things (correctly).<br><br>Here's an extract of the relevant parts of my model:<br><br><code><br>package MyApp::Model::Product;<br>use base qw(MyApp::Record);<br>use Jifty::DBI::Schema;
<br><br>use MyApp::Record schema {<br> column partnumber =><br> type is 'text',<br> label is 'Product Number',<br> max_length is 12,<br> is mandatory,<br> is distinct;<br>}<br><br>
sub canonicalize_partnumber {<br> my $self = shift;<br> my $value = shift;<br> $value =~ s/[\s\W]+//g;<br> Jifty->log->info(qq(x${value}x));<br> return uc($value);<br>}<br></code><br><br>And here is an extract from the log during a session in which I set the
<br>partnumber to ';s' (the semi-colon should be removed and then the string<br>then uc'd):<br><br><log><br>INFO - GET request for /__jifty/validator.xml<br>INFO - xx<br>INFO - POST request for /product<br>
INFO - xsx<br>INFO - xSx<br></log><br><br>So the ajax validator sees an empty value! If I enter somthing nice and<br>simple like '45th e4' then the result via ajax is correct as it returns<br>'45THE4'.
<br><br>Could someone please point me in the right direction as to where to start<br>poking around in the Jifty code?<br><br>Cheers<br>PeteM<br>_______________________________________________<br>jifty-devel mailing list<br>
<a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br><a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br></blockquote>
</div><br>