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 &quot;canonicalizeaction&quot;, so searching for that should get you to the client-side code that is most specific to what you&#39;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> &lt;<a href="mailto:peter@sysnix.com">peter@sysnix.com</a>&gt; 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&#39;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&#39;s an extract of the relevant parts of my model:<br><br>&lt;code&gt;<br>package MyApp::Model::Product;<br>use base qw(MyApp::Record);<br>use Jifty::DBI::Schema;
<br><br>use MyApp::Record schema {<br>&nbsp;&nbsp; column partnumber =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; type is &#39;text&#39;,<br>&nbsp;&nbsp;&nbsp;&nbsp; label is &#39;Product Number&#39;,<br>&nbsp;&nbsp;&nbsp;&nbsp; max_length is 12,<br>&nbsp;&nbsp;&nbsp;&nbsp; is mandatory,<br>&nbsp;&nbsp;&nbsp;&nbsp; is distinct;<br>}<br><br>
sub canonicalize_partnumber {<br>&nbsp;&nbsp;&nbsp;&nbsp; my $self = shift;<br>&nbsp;&nbsp;&nbsp;&nbsp; my $value = shift;<br>&nbsp;&nbsp;&nbsp;&nbsp; $value =~ s/[\s\W]+//g;<br>&nbsp;&nbsp;&nbsp;&nbsp; Jifty-&gt;log-&gt;info(qq(x${value}x));<br>&nbsp;&nbsp;&nbsp;&nbsp; return uc($value);<br>}<br>&lt;/code&gt;<br><br>And here is an extract from the log during a session in which I set the
<br>partnumber to &#39;;s&#39; (the semi-colon should be removed and then the string<br>then uc&#39;d):<br><br>&lt;log&gt;<br>INFO - GET request for /__jifty/validator.xml<br>INFO - xx<br>INFO - POST request for /product<br>
INFO - xsx<br>INFO - xSx<br>&lt;/log&gt;<br><br>So the ajax validator sees an empty value! If I enter somthing nice and<br>simple like &#39;45th e4&#39; then the result via ajax is correct as it returns<br>&#39;45THE4&#39;.
<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>