From hedley at upfrontsystems.co.za Mon Jan 14 09:19:38 2008 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Mon, 14 Jan 2008 10:19:38 +0200 Subject: [Kss-devel] replaceInnerHTML fails with IE7 with certain strings Message-ID: <478B1B1A.9040300@upfrontsystems.co.za> Hi all (A) s = '''some string''' (B) s = ''' bla''' The call core.replaceInnerHTML(someselector, s) works for A but not B. This affects only IE7 (not sure about IE6, FF is fine). The fix is trivial (strip s before the replace call), but why does this happen? This can really trip up people since IE doesn't give a Javascript error. Hedley From ree at ree.hu Mon Jan 14 09:40:16 2008 From: ree at ree.hu (Balazs Ree) Date: Mon, 14 Jan 2008 09:40:16 +0100 Subject: [Kss-devel] replaceInnerHTML fails with IE7 with certain strings References: <478B1B1A.9040300@upfrontsystems.co.za> Message-ID: Hi Hedley, On Mon, 14 Jan 2008 10:19:38 +0200, Hedley Roos wrote: > (A) > s = '''some string''' > > (B) > s = ''' > bla''' > > The call core.replaceInnerHTML(someselector, s) works for A but not B. > This affects only IE7 (not sure about IE6, FF is fine). The fix is > trivial (strip s before the replace call), but why does this happen? > This can really trip up people since IE doesn't give a Javascript error. Which version of kss.core does this happen with? In case you have not tried yet, can you please check if the same issue happens on the svn trunk of kss.core as well? Thanks in advance. Best wishes, -- Balazs Ree From hedley at upfrontsystems.co.za Mon Jan 14 10:46:06 2008 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Mon, 14 Jan 2008 11:46:06 +0200 Subject: [Kss-devel] replaceInnerHTML fails with IE7 with certain strings In-Reply-To: References: <478B1B1A.9040300@upfrontsystems.co.za> Message-ID: <478B2F5E.5080805@upfrontsystems.co.za> > > Which version of kss.core does this happen with? > 1.2.3 > In case you have not tried yet, can you please check if the > same issue happens on the svn trunk of kss.core as well? > Will do and let you know. From arnoblumer at gmail.com Thu Jan 31 07:48:33 2008 From: arnoblumer at gmail.com (Arno Blumer) Date: Thu, 31 Jan 2008 08:48:33 +0200 Subject: [Kss-devel] triggering kss change event when writing to a text input with javascript Message-ID: Hallo I am sending this message again, as the previous one bounced. (My apologies - I was sending from a different address than the one I subscribed with.) I have a listing of objects, and the fields are updated using kss. One of the fields is a DateField and the user can update it using a javascript "date picker": The date is picked from the calendar/date picker and then javascript updates a text input with the date. How can I cause this "change" of the text input to trigger the kss change event? It is triggered if I type the date manually into the text input, but not when its done by the javascript. This is what pops up the calendar: if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, null, onJsCalendarDateUpdate, function(cal) { cal.hide(); }); cal.time24 = true; cal.weekNumbers = true; mustCreate = true; } else { cal.hide(); } And this is what writes the date to the text input: function onJsCalendarDateUpdate(cal) { var daystr = '' + cal.date.getDate(); if (daystr.length == 1) daystr = '0' + daystr; var monthstr = '' + (cal.date.getMonth()+1); if (monthstr.length == 1) monthstr = '0' + monthstr; cal.params.inputField.value = '' + cal.date.getFullYear() + '/' + monthstr + '/' + daystr; } How do I get that last line, that writes the date string to the text input, to trigger the following kss change event?: input.title, input.detail, input.nextaction, input.person, input.due:change{ action-server: kss_test_change; kss_test_change-item: nodeAttr('id', true); kss_test_change-field: nodeAttr('class'); kss_test_change-value: currentFormVar(); } I need to update the objects "Due" field, along with the "Title", "Detail" etc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080131/e67ffb0c/attachment.htm From hedleyroos at gmail.com Thu Jan 31 07:59:45 2008 From: hedleyroos at gmail.com (Hedley Roos) Date: Thu, 31 Jan 2008 08:59:45 +0200 Subject: [Kss-devel] triggering kss change event when writing to a text input with javascript In-Reply-To: References: Message-ID: <776caf8b0801302259r20c0fddakb0a03e2288692663@mail.gmail.com> I assume this is with Plone 2.5.x and PloneAzax 1.1 (Plone 3 uses a newer kss and works as far as I know). The problem is that the Javascript that sets the inputs cannot trigger new onChange events. I would try to hook a kss rule onto the calendar popup widget. If each day in the calendar is a
then it should be easy. My guess is that the calendar widget implements onChange on the day-picker and then sets the inputs with Javascript. This Javascript should execute before the ajax fires, which means you will be able to read the date input values in your script. I'll have a look at this later. From hedley at upfrontsystems.co.za Thu Jan 31 16:14:15 2008 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Thu, 31 Jan 2008 17:14:15 +0200 Subject: [Kss-devel] triggering kss change event when writing to a text input with javascript In-Reply-To: <776caf8b0801302259r20c0fddakb0a03e2288692663@mail.gmail.com> References: <776caf8b0801302259r20c0fddakb0a03e2288692663@mail.gmail.com> Message-ID: <47A1E5C7.2010805@upfrontsystems.co.za> showJsCalendar is the js that creates and pops up the calendar. You must re-attach events after that function is called since older PloneAzax does not automatically attach events when new nodes are added to the DOM. So somewhere you'll have onClick="showJsCalendar(theparams);kukit.setupEvents" on an input. Then you have to define KSS to attach events to the calendar: tr.daysrow td.day: click {} You might need to get creative by setting a few hidden inputs with javascript.