Hello,

I tried using the latest Ajax and Forms block from the BRANCH_2_1_X svn
branch. The issue appears to have been partially fixed, but the
double-listbox styling still won't work in combination with repeaters and
Ajax.

I've now reported that issue, and a crude, Cocoon 2.1.8 specific fix, on
JIRA:

  http://issues.apache.org/jira/browse/COCOON-1738


Best regards,
Fabrizio


> Hi Fabrizio,
>
> I did some fixes in the AJAX block after 2.1.8 release, can you try to
> from the lastest SVN code and report back if the issue is already fixed?
>
> Best Regards,
>
> Antonio Gallardo.
>
> Fabrizio Sitzia wrote:
>
>>Hello,
>>
>>I've digged a bit in the source myself ...and found out two things:
>>
>>1. The "optNxxxxx is not defined" Javascript error is apparently caused
>> by
>>the optNxxxxx variable being initialised in a local scope instead of the
>>document's global scope.
>>( For non-IE browsers, this can be fixed by replacing the line containing
>>"eval(scripts[i]);" in cocoon-ajax.js with "setTimeout(scripts[i], 10);"
>> )
>>
>>
>>2. But even if the optNxxxxx variable is initialised all right, you will
>>stumble upon other stuff not being initialised correctly:
>>
>>The 'double-listbox' widget relies on an object (OptionTransfer) that is
>>normally initialised by a document onLoad() handler.
>>That is fine for full page reloads, but with partial updates via Ajax,
>> the
>>onLoad() handler for a freshly added 'double-listbox' widget is never
>>going to be executed!
>>
>>
>>I've looked at the bug report you mention below (COCOON-1718), and have
>>merged the changes to my 'cocoon-ajax.js' file, but it doesn't appear to
>>fix the global var-, nor the onLoad- issues with the 'double-listbox'
>>widget.
>>
>>
>>I'm currently working on a fix, tbc.
>>
>>Thanks for your reply,
>>Fabrizio
>>
>>
>>
>>
>>>Looking at the source, I believe this is due to the fact that
>>><script></script> contents received via AJAX requests are executed
>>>before they are added to the main page's DOM, not after.  The styling
>>>for double-listbox includes a snippet of script that calls a global
>>>function to hook up event listeners etc., and this fails because at the
>>>time it is run the elements aren't yet part of the document.
>>>
>>>There is a bug report in Jira [1] about scripts being run too soon;
>>>someone attached a preliminary approach for a fix but it seems there are
>>>still issues with it.  Not sure if that helps or not.
>>>
>>>[1] http://issues.apache.org/jira/browse/COCOON-1718
>>>


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