Opened 15 years ago

Closed 11 years ago

Last modified 10 years ago

#3945 closed bug (fixed)

DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro

Reported by: canthonyza Owned by:
Priority: major Milestone: 1.8.22
Component: ui.datepicker Version: 1.6rc5
Keywords: Cc:
Blocked by: Blocking:

Description

The DatePicker renders perfectly with Themeroller also disappears when out of focus, but seems like none of the click events are being fired. Can't move to next or previous month/year.

Please let me know if there is any other info I can give you.

Attachments (1)

index.html (661 bytes) - added by hackfrag 15 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 15 years ago by Scott González

Milestone: TBD1.next
Priority: minorblocker

We're going to aim for full AIR support in 1.7.

Changed 15 years ago by hackfrag

Attachment: index.html added

comment:2 Changed 15 years ago by hackfrag

i got the exactly same problem. I attached my stripped 'index.html' of my AIR app.

comment:3 Changed 15 years ago by hackfrag

Any news about this bug yet? 1.next = 1.9 or 1.8? Thanks! :)

comment:4 Changed 15 years ago by sosensible

Same here... doesn't work in AIR yet. (Not as of 1.7) Will this be working in 1.7.1?

comment:5 Changed 14 years ago by Jörn Zaefferer

Most likeley related to this security restriction of the AIR sandbox:

Supports dynamically loading strings as code after the load event: eval() function, setTimeout('string', milis), javascript: URLs, attribute handlers on elements such as onclick='myClick()') that are inserted via innnerHTML, and so on.

See http://help.adobe.com/en_US/AIR/1.5/air_html_security/WS5b3ccc516d4fbf351e63e3d11c0f598320-7ffc.html

comment:6 Changed 14 years ago by ckng

I thought 1.7 suppose to have full Air support? Still not working in 1.7.1.

comment:7 Changed 14 years ago by calum.moore

Hi

For some strange reason Adobe AIR refuses to accept dynamically created onclick="" attributes. For example div.innerHTML='<a onclick="[javascript code]"> ' would not work.

You have to dynamically add the click's back in. You have two options.

Option 1: You can change the ui.datepicker.js file by putting:

AFTER THIS CODE (around line 620):

if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
			$(inst.input[0]).focus();

PUT THIS CODE

id = "#"+$(inst).attr("id");

		$(".ui-datepicker-next").click(function() {
			DP_jQuery.datepicker._adjustDate(id, +1, 'M');
		});	
		
		$(".ui-datepicker-prev").click(function() {
			DP_jQuery.datepicker._adjustDate(id, -1, 'M');
		});	
		drawMonth = inst.drawMonth;
		drawYear = inst.drawYear;
		$(".ui-datepicker-calendar").find("tr > td").each(function() {
			$(this).click(function() {
				DP_jQuery.datepicker._selectDay(id,drawMonth,drawYear, this);
			});
		});

Option Two: Adjust the above code around the onChangeMonthYear event. I'll let you figure it out.

comment:8 Changed 14 years ago by snover

Patch for jQuery UI 1.8: http://zetafleet.com/dev/jui/jquery.ui.datepicker.js.air-fix.patch

This patch is fully tested.

comment:10 Changed 13 years ago by ankur

I am unable to verify this fix with latest rev 1.8 sources.

Built a bare-bones AIR app (using Aptana studio) with jquery-1.4.2.min.js and jquery-ui-1.8.min.js. Used the default demo code from JQuery website -

<script type="text/javascript">
	$(function() {
		$("#datepicker").datepicker();
	});
	</script>
<p>Date: <input type="text" id="datepicker"></p>

The datepicker shows up on the input box but does not allow for selection of any date from the drop-down, the prev and next buttons do not work either. Tried listening to onSelect event for this datepicker and noticed that it never gets fired. Am i missing something?

comment:11 Changed 13 years ago by snover

The patch was not merged back into the trunk for whatever reason, so yeah, if you use the official source you will still not be able to use datepicker.

comment:12 Changed 13 years ago by Scott González

Priority: blockermajor

comment:13 Changed 11 years ago by metaweta

The same underlying problem prevents datepicker from working on Google Sites' HTMLBox.

comment:14 Changed 11 years ago by metaweta

comment:15 Changed 11 years ago by Scott González

#8239 is a duplicate of this ticket.

comment:16 Changed 11 years ago by Scott González

#8290 is a duplicate of this ticket.

comment:17 Changed 11 years ago by Scott González

Summary: DatePicker does not respond to any click events in AIRDatePicker does not respond to any click events in AIR, Google Sites, Windows Metro

comment:18 Changed 11 years ago by metaweta

Given the longstanding demand for this bug and the existence of a fix, can we get the status returned to blocker?

comment:19 Changed 11 years ago by Mike Stay

Resolution: fixed
Status: newclosed

Datepicker: Pulled event handlers into static code. Fixed #3945 - DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro.

Changeset: 6dcc5c14c824ae9d653b1bc293680f6af6baf1b4

comment:20 Changed 11 years ago by Mike Stay

Datepicker: Pulled event handlers into static code. Fixed #3945 - DatePicker does not respond to any click events in AIR, Google Sites, Windows Metro. (cherry picked from commit 6dcc5c14c824ae9d653b1bc293680f6af6baf1b4)

Changeset: 831333a10aebad00b30d51cb274f463240c56814

comment:21 Changed 11 years ago by Scott González

Milestone: 1.next1.8.22

comment:22 Changed 11 years ago by mikesherov

#7826 is a duplicate of this ticket.

comment:23 Changed 10 years ago by vovina

I didnt get the final solution How can I modify the date picker to be able to use click event. thanks

Note: See TracTickets for help on using tickets.