<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Plone, KSS, Javascript, field validation and the cup of WTF</title>
	<atom:link href="http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Mon, 19 Sep 2011 19:02:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: tareq</title>
		<link>http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/comment-page-1/#comment-4841</link>
		<dc:creator>tareq</dc:creator>
		<pubDate>Tue, 17 May 2011 05:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.redinnovation.com/?p=46#comment-4841</guid>
		<description>In the Archetype Field.py have noticed the comment like this:
 # insert isEmpty validator at position 0 if first validator
 # is not isEmpty
Then the idea just came out in my mind. I changed the validators in schema like this:

validators=((&#039;isEmpty&#039;, V_REQUIRED),(&#039;yourCustomValidator&#039;,V_SUFFICIENT),),
and now it calls the custom validator
I have tried this on save of form. haven&#039;t tried on kss validator. But it should work.
Same problem in both case
Tareq</description>
		<content:encoded><![CDATA[<p>In the Archetype Field.py have noticed the comment like this:<br />
 # insert isEmpty validator at position 0 if first validator<br />
 # is not isEmpty<br />
Then the idea just came out in my mind. I changed the validators in schema like this:</p>
<p>validators=((&#8216;isEmpty&#8217;, V_REQUIRED),(&#8216;yourCustomValidator&#8217;,V_SUFFICIENT),),<br />
and now it calls the custom validator<br />
I have tried this on save of form. haven&#8217;t tried on kss validator. But it should work.<br />
Same problem in both case<br />
Tareq</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subhash</title>
		<link>http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/comment-page-1/#comment-424</link>
		<dc:creator>subhash</dc:creator>
		<pubDate>Wed, 27 Aug 2008 10:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.redinnovation.com/?p=46#comment-424</guid>
		<description>this for validation i want dissallowed to string or characters and i only allowed numbers can you sallow this problem



package com.stl.kps.web.validator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import com.stl.kps.web.data.ManageFieldForm;

public class ManageFieldValidator  implements Validator {

    protected final Log logger = LogFactory.getLog(getClass());

    @SuppressWarnings(&quot;unchecked&quot;)
	public boolean supports(Class clazz) {
        return clazz.equals(ManageFieldForm.class);
    }

    public void validate(Object obj, Errors errors)
    
    {
    	ManageFieldForm pc = (ManageFieldForm) obj;
        if (pc ==null) 
        {
            errors.rejectValue(&quot;number&quot;, &quot;error.not-specified&quot;, null, &quot;Value required.&quot;);
        }
        else    
        	
        {
        	logger.info(&quot;Validating with &quot; + pc);
        	 if (pc.getNumber() == null &#124;&#124; pc.getNumber().length() =5)
         	{
                 errors.rejectValue(&quot;number&quot;, &quot;error.number&quot;, &quot;value is maximum 5 characters&quot;);
         	}
         	
            
        }
    }
}</description>
		<content:encoded><![CDATA[<p>this for validation i want dissallowed to string or characters and i only allowed numbers can you sallow this problem</p>
<p>package com.stl.kps.web.validator;</p>
<p>import org.apache.commons.logging.Log;<br />
import org.apache.commons.logging.LogFactory;<br />
import org.springframework.validation.Errors;<br />
import org.springframework.validation.Validator;</p>
<p>import com.stl.kps.web.data.ManageFieldForm;</p>
<p>public class ManageFieldValidator  implements Validator {</p>
<p>    protected final Log logger = LogFactory.getLog(getClass());</p>
<p>    @SuppressWarnings(&#8220;unchecked&#8221;)<br />
	public boolean supports(Class clazz) {<br />
        return clazz.equals(ManageFieldForm.class);<br />
    }</p>
<p>    public void validate(Object obj, Errors errors)</p>
<p>    {<br />
    	ManageFieldForm pc = (ManageFieldForm) obj;<br />
        if (pc ==null)<br />
        {<br />
            errors.rejectValue(&#8220;number&#8221;, &#8220;error.not-specified&#8221;, null, &#8220;Value required.&#8221;);<br />
        }<br />
        else    </p>
<p>        {<br />
        	logger.info(&#8220;Validating with &#8221; + pc);<br />
        	 if (pc.getNumber() == null || pc.getNumber().length() =5)<br />
         	{<br />
                 errors.rejectValue(&#8220;number&#8221;, &#8220;error.number&#8221;, &#8220;value is maximum 5 characters&#8221;);<br />
         	}</p>
<p>        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Aspeli</title>
		<link>http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/comment-page-1/#comment-392</link>
		<dc:creator>Martin Aspeli</dc:creator>
		<pubDate>Thu, 12 Jun 2008 07:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.redinnovation.com/?p=46#comment-392</guid>
		<description>&quot;if you hadn’t been armed with 8 years of web development experience...&quot;

... you would&#039;ve reported a bug or asked for help.

Don&#039;t pretend like computer systems don&#039;t have bugs, and don&#039;t pretend like bugs aren&#039;t sometimes hard to find, regardless of which platform you happen to use.

Martin</description>
		<content:encoded><![CDATA[<p>&#8220;if you hadn’t been armed with 8 years of web development experience&#8230;&#8221;</p>
<p>&#8230; you would&#8217;ve reported a bug or asked for help.</p>
<p>Don&#8217;t pretend like computer systems don&#8217;t have bugs, and don&#8217;t pretend like bugs aren&#8217;t sometimes hard to find, regardless of which platform you happen to use.</p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Balazs Ree</title>
		<link>http://blog.mfabrik.com/2008/06/12/plone-kss-javascript-field-validation-and-the-cup-of-wtf/comment-page-1/#comment-391</link>
		<dc:creator>Balazs Ree</dc:creator>
		<pubDate>Thu, 12 Jun 2008 05:02:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.redinnovation.com/?p=46#comment-391</guid>
		<description>Many thanks for tracking this down!

We are aware that the cooperation of Archetypes and  KSS has several problems - the main reason for this is that AT was not originally designed for the KSS / Ajax uses cases. We are applying a bunch of hacks and workarounds to make it work (like, in the case of field validation) but we always keep on encountering edge cases like the current one, that make it fail.

Obviously, the number of these problems will be greatly reduced once AT is replaced by an alternative, but till then, the workarounds will stay.

If this issue is solved it would be great to
create a Selenium test for it to assure that it
stays fixed - for more info please visit:

http://kssproject.org/docs/tutorial/kss-testing-how-to-for-plone-3.1


Best wishes,</description>
		<content:encoded><![CDATA[<p>Many thanks for tracking this down!</p>
<p>We are aware that the cooperation of Archetypes and  KSS has several problems &#8211; the main reason for this is that AT was not originally designed for the KSS / Ajax uses cases. We are applying a bunch of hacks and workarounds to make it work (like, in the case of field validation) but we always keep on encountering edge cases like the current one, that make it fail.</p>
<p>Obviously, the number of these problems will be greatly reduced once AT is replaced by an alternative, but till then, the workarounds will stay.</p>
<p>If this issue is solved it would be great to<br />
create a Selenium test for it to assure that it<br />
stays fixed &#8211; for more info please visit:</p>
<p><a href="http://kssproject.org/docs/tutorial/kss-testing-how-to-for-plone-3.1" rel="nofollow">http://kssproject.org/docs/tutorial/kss-testing-how-to-for-plone-3.1</a></p>
<p>Best wishes,</p>
]]></content:encoded>
	</item>
</channel>
</rss>

