Jugal wrote:
Hello All, I am using Struts 2.0.11 for development of my application. I am using datetimepicker tag and I want to trap onchange event of
datetimepicker tag. After exploring for a while I found that there is
already a  https://issues.apache.org/struts/browse/WW-1867 bug  raised for
the issue. So as per the solution mentioned I am using the valueNotifyTopics
instead of onchange attribute to trap the event; but using valueNotifyTopics
gives me compilation error for my jsp saying that attribute
valueNotifyTopicsis invalid according to struts-tags.tld. After checking the
tld, I found that there is no such entry for this attribute. Also the use of
this attribute is mentioned in the docs provided along with the 2.0.11
distribution.

I have been searching on this for quite a while, but not hitting on any
solution. Can any one please throw me some light on this? Do I need to do
some special configuration to get this working? Any help is appreciated.

Thanks and Regards,
Jugal
Hi Jugal,
The Struts2.0x datatimepicker is a Dojo 0.4x DatePicker widget of type "dropdowndatepicker".
Once you get a reference to the widget you can access Dojo's event model.

The javascript below will lookup a datepicker with id "myDatePickerId" and connect "myListener" to its onValueChanged event:

function init() {
  var datePicker = dojo.widget.byId("myDatePickerId");
  dojo.event.connect(datePicker, "onValueChanged", myListener);
}

dojo.addOnLoad(init);

The dojo.addOnLoad(init) line ensures the init function is called when the page is loaded.

regards,
Jeromy Evans


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to