Skip to main content

Listener for dropdowndatepicker

3 replies [Last post]
Joined: 2007-04-18

I'm trying to create a listener in glue.js for the dropdownconatainer widget. This is my code:
jmaki.listeners.handleDropdowndatepicker = function(args) {
alert("glue.js : Dropdowndatepicker event");
// map topic dojo/datepicker to fisheye handler
jmaki.addGlueListener("/dojo/dropdowndatepicker*", "jmaki.listeners.handleDropdowndatepicker");

**JSF page**

The listener method doesn't get called, but the sample with fisheye widget works perfetly. Am I missing something?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-11-28

Sample working code for dropdowndatepicker:
In Index.jsp:

Departure date:
Arrival date:

<div id="msgCall-1">Debug message 1.</div>

In glue.js:
jmaki.addGlueListener({topic : "/dojo/dropdownDatePicker",action: "call", target: { object: "jmaki.glue",functionName: "eventDropdownDatePicker"}});

jmaki.glue = {
eventDropdownDatePicker : function(args) {
alert("Event id: "", value="+args.value);
document.getElementById('msgCall-1').innerHTML = "Event id: "", value="+args.value;

For complete working NetBeans project, download and unzip:
Project name: jMakiGlue1

For complete project instructions, goto:

Joined: 2007-04-18

Thanks for your replies!

Joined: 2005-02-10

HI Peter,

The topic name in the listener doesn't match the topic name the widget is publishing too.

The topic name for drop down date picker is: /dojo/dropdownDatePicker

To figure out the topic names the widgets publish to see the following page:

Alternatively, you can override the topic names so that you will know what the name is as follows:

The widget will use this value instead, also make sure your glue code uses this topic name.

You may also find the logging console useful when debugging events. In the jmaki.js file you will find 2 variables this.debugGlue and this.debug set both to 'true' and a small console will appear in the page. Each time an event is published a message is posted. It includes the topic name and payload that was sent. It also indicates if there is a listener for the topic.

hope this helps.