dijit.form.ValidationTextBox
februari 23, 2011
In our 4-days XPages course we look at the several possible input validation strategies, client-side and server-side.
One of the students, Oscar Bout, expert on Dojo told me he was missing the client-side Dojo strategy using the dijit.form.ValidationTextBox control in combination with and dojo.form.Form.
We tried his code which gaves the error popup as shown in fig. 1
How to implement this?
- Select the Edit Box Control and select All Properties\dojo \dojoType and enter dijit.form.ValidationTextBox;
- Select All Properties \ Dojo \ dojoAttributes and click 3 time on the + button to create three attributes (see fig 2):
- Dojo attribute 1: name: invalidMessage, value: your error message
- Dojo attribute 2: name: required, value: true
- Dojo attribute 3: name: regExp, value (your regular expression to test the input):
[0-9]{4}[ a-zA-Z][a-zA-Z]{1,2}
- Select the XPage and select All Properties\dojo and enter the next values (see fig 3):
- dojoForm: true
- dojoParseOnLoad: false
- dojoThemo: true
5 reacties
leave one →
Hallo Rob,
Dank je wel dat je dit nog even op deze wijze duidelijk hebt uitgewerkt.
Was een mooie toevoeging aan de 4 daagse cursus.
Ben er mee aan het testen en het ziet er inderdaad mooi uit en het werkt stabiel.
En, ben je er al verder mee gekomen?
Ik heb ook een Dojo-cursus die gebaseerd is op clasic Domino webdevelopment. Maar om daar een nieuwe cursus van te maken? Misschien is ik beter in deze blog de diverse technieken en instellingen laten zien geënt op XPages. Moet er wel tijd voor maken.
Mocht jij al voorbeelden hebben dan houd ik mij aanbevolen. Eventueel geef ik je voldoende rechten om in deze blog te publiceren.
Nah, ik ben niet zon fanatieke blogger 🙂
Maarals je nog een eenvoudig Drag and Drop voorbeeld zoekt om op je Xpage te gebruiken:
http://oscoweb.quicksytes.com/oscoform/basicDND.html
Bekijk de sourcecode maar eens hoe eenvoudig het is.
Ik heb veel door mij gevonden dingen (veel Dojo) in mn blog gepost. Het is een beetje een rommeltje maar alles staat erop.
http://www.oscoweb.com/subdomains/blog/
Groetjes,
Oscar
Hi Rob,
great idea to enhance XPage validation. I have done a description which is even more easy
http://www.mmi-consult.de/FAQ/dx/alternative-validierung-von-eingabefeldern-in-xpages-mit-dijit.form.validationtextbox.htm
Manfred