Rafez Noorullah commented on Sep 20, 2010

Client Side JavaScript Libraries in XPages

Rafez Noorullah commented on Sep 20, 2010

Client Side JavaScript Libraries in XPages

There seems to be a Typo for the code for Example 1: Adding a Dojo widget to an XPage.

DdjoType should actually be dojoType

Thus the code should read

Paul S. Withers commented on Sep 1, 2009

Conflict of functionality

If you use XSP.attachValidator with a xp:radioGroup, xp:checkBoxGroup or xp:listBox control, the validation throws an error with e.select. Presumably this is because the control cannot be selected.

Also, attachValidator always triggers client-side validation, regardless of the setting on the control or the database. Is there a way to override this?

Teresa Monahan commented on Jan 9, 2009

Response to "Error in code?"

Thanks for your comment. Yes, there is indeed an error in the code.

As you correctly pointed out EmployeeIDValidator is not an extension of the XSP class so the correct code to use this function is

new EmployeeIDValidator("Error, incorrect employee number entered"));

I have updated the code sample in the article to reflect this and have also replaced the special character you mentioned with a simple double quote.

Thanks again for pointing this out.

Jens H Polster commented on Jan 2, 2009

Error in code?

Thanks, great tutorial!

In the Output Script for the Employee ID it says

XSP.addOnLoad(

function addEmployeeIDValidator() {

XSP.attachValidator("#{id:employeeID}",new XSP.RequiredValidator("You must enter an employee number"), null,

new XSP.EmployeeIDValidator(“Error, incorrect employee number entered"));

}

);

From what I can see the EmployeeIDValidator is not an extension of the XSP class, so shouldn't it be

XSP.addOnLoad(

function addEmployeeIDValidator() {

XSP.attachValidator("#{id:employeeID}",new XSP.RequiredValidator("You must enter an employee number"), null,

new EmployeeIDValidator("Error, incorrect employee number entered"));

}

);

instead?

Oh, and to make it easier to copy&paste it would be nice if the starting quote before "Error, incorrect..." would be changed to a simple double quote. It currently is a special character.

Thanks

Stephan H. Wissel commented on Oct 29, 2008

Nice tutorial

2 Questions:

a) when you have defined you own client validator could you link it to a input element in the properties instead of onload code?

b) How to overwrite the client validator routine. I rather have a Dojo Dialog showing all problems in one go... or use the ErrorControls like the backend.