[dev] Calendar Issue

Roman Geber geber at b1-systems.de
Wed Jan 16 13:41:14 UTC 2013


Hi :)

I'd like to resolve the JavaScript Problem within Horde date picker. I've already proposed a fix (see GIthub Pull Request 23). Jan wasn't satisfied with the way this was done and responded with a, for me, slightly cryptic message.

Before I get any deeper into that, this is the original problem:

Whenever a date/time field (or any other field attached to a date picker) is augmented with an onchange statement, that onchange is code is not executed if the date_picker changes the value of that field. The simple solution would be to trigger the change event manually. Thats what my patch does.

Example:

$myDateTime = $this->addVariable("label", "html_field_id", "datetime", true, false, null);
$myDateTime->setAction(Horde_Form_Action::factory('reload'));

Ralf Lang and I discussed a strategy and would like to have your opinion on 

The proposed patch involves nothing but the calendar.js file. The way I read Jan's reply he'd rather have that additional code located somewhere else. Our current idea would be to create a new JavaScript file within '''$HORDE_GIT/framework/Form/js/ ''' listening on the date picker, running the patch code whenever required.

While I'd include that JS file whenever a date picker is loaded through Horde_Form to avoid this problem from happening ever again, Ralf seems concerned that this would compromise the libraries standalone capabilities. I wonder, is there a safe way to find out if Horde_Form is used standalone or within a Horde Instance?

Are we on the right track here or does anyone have a better idea?

On top, I'd like to ask you how I'd listen on the date picker from an external script. Jan meant something about "Horde_Calendar:select". Since I'm no longer that well versed in Prototype these days and just starting out on Horde I need a bit of help there.

Thanks a lot in advance and take care.

cu
Roman

Github Pull Request 23: https://github.com/horde/horde/pull/23

--
Roman Geber
Linux Consultant
Tel: +49-172-4430229
Mail: geber at b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537






More information about the dev mailing list