Re: Re: [Netwindows-cvs-notify] netWindows/docs/widget_test_pages validator_test.html, 1.2, 1.3
Michael Flanagan <[email protected]> Mon, 15 Sep 2003 12:43:13 -0700
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
Alex Russell wrote: > On Monday 15 September 2003 13:45, Michael Flanagan wrote: > >>diff -u -r1.133 netWindows.js >>--- netWindows.js 14 Sep 2003 01:26:01 -0000 1.133 >>+++ netWindows.js 15 Sep 2003 18:40:41 -0000 >>@@ -1247,6 +1247,7 @@ >>+ this.addIncURL(this.widgetPath+"validators.js"); > > > I REALLY don't like this solution. validators.js is not a core file an doesn't > deserve to be loaded in every page. This is a band-aid and not one I'm > comfortable with. I'll try to debug the real problem this evening. > I'm not as convinced as you are. Before getting the why, I'll outline functionality I think was lost in the import. I use to be able to do the following to apply a mask to an arbitrary piece of data: __meta__.phone.apply(varUnformattedData); and __meta__.phone.remove(varFormattedData); AFAICT, the new __validators__ singelton doesn't provide any mechanism to arbitrarily call any of the registered validators. You have to instantiate it on the DOM Node and call DOMNode.changed(); if you want the mask applied. Seems a little heavy to me. Have I just missed where that functionality moved to? The primary reason I think __validators__ (with the functionality outlined above) should be included in the core files, is that it's a helper class that lets you apply format strings to arbitrary pieces of data. Ya, you could include validators.js in nwWrapper.js so that it was loaded on every page, but we don't have to do that with tooltips.js or utility_core.js I know there's a boolean __config__.includeTooltips, but it defaults to true. If that's loaded by default, I see no reason why somthing that can provide just as much utility for formatting data isn't loaded by default. IMO, anyone using nw in some kind of serious manner where they're trying to reduce the screen refresh's as much as possible are going to be operating with direct DOM Nodes a lot. If that's the case, then they'll need to be doing formatting of data on the front end as upposed to on the server side. It's the amount of use I see the class getting that justifies its inclusion into the core files. Just my $0.02 _______________________________________________ The netWindows developers list: [email protected] http://netwindows.org/mailman/listinfo/devel_netwindows.org