Exercises Dojo Dijit
Exercises Dojo Dijit
1.
Make a Dijit Button that, when pressed, shows the current browser time in an alert
box. (Recall that in JavaScript, you can output new Date() to show the current
time.) Use explicit HTML markup, but remember that you will still need
dojo.require(...) in your JavaScript.
2.
3.
Make a Dijit Button that, when pressed, makes an Ajax request to the server, gets a
random number, and displays it in a Dijit Dialog box. You can use whatever approach
you prefer for the Button, but it will probably be easier to use the programmatic version of the Dialog to simplify inserting dynamic text into it. (However, if you are
clever, you can also use the markup version of the Dialog, but insert into it before
exposing it.)
4.
Make a textfield with a label that says Choose a Date. When the user clicks in the
textfield, a calendar should pop up. Try it both the markup way and the programmatic
way.
5.
Repeat the previous problem (using whichever approach you prefer: declarative or
programmatic), but add in a pushbutton that sends the date to the server. The server
should return a string that says something like Your trip is confirmed for some
date. Insert the server result into the page below the textfield.
6.
7.
If you have used regular expressions before, make a ValidationTextBox that accepts
an HTML start or end tag, with no whitespace. That is, the user should be able to
enter <blah> or </blah>, with any alphabetic characters inside.
8.
9.
Repeat the previous problem (using whichever approach you prefer: declarative or
programmatic), but add in a pushbutton that sends the number to the server. A random number in that range should be returned and inserted into the page. Recall that
in Java, Double.parseDouble turns a String into a double.
http://www.coreservlets.com