XPage can't use custom validators and converter and partial refresh all together, or can it?

Hi - just want to know if you are able to use all of these things at once in the same Edit Box Control:

  1. Custom Converter, run this in getAsString to remove all spaces:

return value.replace(/ /gi,“”);

getAsObject is:

return(value);

(another side problem I have found, is that ONLY the variable name “value” works here…change it and it fails!)

  1. Validator 0 is validateRequired, set on the Validation tab

  2. Validator 1 is validateConstraint, which uses a simple email pattern match:

[\w-]+@([\w-]+.)+[\w-]+

with this message:

return(‘Email2 uses invalid format.’);

  1. validator 2 is customValidator:

if (getComponent(‘email1’).getValue()!=getComponent(‘email2’).getValue())

{

return ('Sorry the two emails must be the same.');

}

The Edit box has partial refresh turned on, pointing to itself, email2.

Using server side validation with Error Message Controls.

The set up is that there are two email fields that must match, with the converter stripping out all the spaces and the validator making sure the field is required, uses a valid format, and matches the other email field. The idea is when the user tabs out after changing either of the fields the email address is stripped of spaces, validated, and compared to the other one.

For test purposes I have all the events in the XPage doing print statements and find that the converter never runs but the validateConstraint and customValidator both run. Also noticed that neither the onblur or onchange events run either. So ignoring the fact that the converter never runs and the two events don’t run, with Partial refresh turned on for the onblur and onclick events, the validators don’t run when user clicks out of the field. But if I turn on Full refresh then they work.

If I remove the validators the converter runs fine both during refresh/submit as well as from onblur/onchange (partial refresh turned on).

It has taken me all day (yes, one of THOSE days when everything comes to a halt) to decide that maybe something is broken here, or several things. I think the custom validators are causing trouble, breaking partial refresh and running before the custom converter/thereby not giving it a chance to run and also stopping the onblur and onchange events from running.

What is your experience? I would like to hear that I am wrong about this so I don’t have to go back to the old way of coding translation and validation.

Thanks.