0% found this document useful (0 votes)
12 views

Exercises Dojo Dijit

This document provides 9 problems to practice using Dojo and Dijit widgets. The problems involve creating buttons, text fields, dialog boxes, calendars and sliders both declaratively using markup and programmatically. When buttons or fields are interacted with, some problems involve making AJAX requests to retrieve data from a server and display it.

Uploaded by

David Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Exercises Dojo Dijit

This document provides 9 problems to practice using Dojo and Dijit widgets. The problems involve creating buttons, text fields, dialog boxes, calendars and sliders both declaratively using markup and programmatically. When buttons or fields are interacted with, some problems involve making AJAX requests to retrieve data from a server and display it.

Uploaded by

David Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Dojo and 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.

Repeat problem 1, but use the programmatic approach.

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.

Make a ValidationTextBox that accepts only 5-digit ZIP codes.

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.

Make a slider that accepts numbers from 1 to 100. Do it both ways.

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

You might also like