You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ralph Rauscher <rr...@blue-elephant-systems.com> on 2006/02/28 20:53:19 UTC

CForms multivalue field breaks if used within union widget with AJAX enabled??

Hi,

I'm having trouble using a multivalue field within a union - at least 
with mozilla based browsers and AJAX enabled I'm getting JavaScript 
errors and the multivalue field stops working.

Attached is a very simple example that reproduces the problem. The tar 
is intended to be extracted into a default cocoon installation in the 
folder where the main cocoon sitemap resides and is then accessible via 
http://localhost:xxxx/..../uniontest/uniontest. I'm using Cocoon 2.1.8.

The attached example lets you swich cases via a drop down box - very 
similar to Datasource chooser sample in cocoon. Case 1 has a multivalue 
field in it, case 2 has a simple field. Upon first loading, the default 
case (the multivalue field) is displayed. Everything's fine so far. You 
can now swich to case 2, so the simple field gets displayed. However, 
from now on it is not possible to swich back to the multivalue field - 
at least not with Mozilla or Firefox, IE works fine...

In the Javascript console I can see the following error when trying to 
switch back:

Error: this.entry has no properties
Source File: 
http://localhost:8080/cocoon2.1.8/policyeditnew/resources/forms/js/forms-lib.js
Line: 234

This is located in the FormsMultiValueEditor JavaScript class that gets 
instanciated as part of the multivalue field on the bowser side. Also 
this is perfectly working upon first loading the page, it seems that the 
partial AJAX updates that Mozilla / Firefox retrieves are not 
immediatelly accessible via getElementById. Thus, the first lookup in 
FormsMultiValueEditor() fails and causes Mozilla / Firefox cancelling 
the new FormsMultiValueEditor() call together with the complete div 
replacement and things stop working.

(By the way: The same behaviour occurs when using a multivalue field 
within a repeater that has move actions associated with the repeater 
rows. As soon as a move has been triggered, the multivalue field stops 
working.)

Is this a known problem or is it possible to work around this? I've 
dived into this somewhat, but my knowledge of JavaScript is still very 
limited. Any help is greatly appreciated.

Thanks!

Ralph


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Ralph Rauscher <rr...@blue-elephant-systems.com>.

Antonio Gallardo wrote:

> Ralph Rauscher wrote:
>
>> Yes, there is a sample. The datasource chooser in the cforms samples 
>> section shows the problem. When switching union cases, the values are 
>> being remembered when using a cocoon 2.1.8. Using 2.1.9-dev values 
>> entered (or values initially loaded via binding) are lost when 
>> switching.
>
>
> Hi Ralph, many thanks for your feedaback!
>
> I used the online cocoon demo site for 2.1.9-dev [1] and I can confirm 
> this bug.
> Step to reproduce:
>
> 1- Selected type 'SQL' and added some text in the 3 fields.
> 2- Selected type 'file'.
> 3- Select typw 'SQL' again
> Result: All the original info in the 3 fields is lost.
> Expected: the form must remember the values of the 3 fields for type 
> 'SQL' and show then again after step '3'.
> Is this correct?
> Question: Have you tried to turn off ajax to see if this is an ajax 
> issue at all?
>
> Best Regards,
>
> Antonio Gallardo.
>
> [1] 
> http://cocoon.zones.apache.org/demos/21branch/samples/blocks/forms/do-datasourceChooser.flow 
>
>
Antonio,

you're right! I've tried it - this behaviour has nothing to do with 
AJAX. The values are lost in 2.1.9-dev with AJAX enabled as well as with 
AJAX disabled.

Thanks again for your help.

Wish you a nice weekend.
Ralph





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Antonio Gallardo <ag...@agssa.net>.
Ralph Rauscher wrote:

> Yes, there is a sample. The datasource chooser in the cforms samples 
> section shows the problem. When switching union cases, the values are 
> being remembered when using a cocoon 2.1.8. Using 2.1.9-dev values 
> entered (or values initially loaded via binding) are lost when switching.

Hi Ralph, many thanks for your feedaback!

I used the online cocoon demo site for 2.1.9-dev [1] and I can confirm 
this bug.
Step to reproduce:

1- Selected type 'SQL' and added some text in the 3 fields.
2- Selected type 'file'.
3- Select typw 'SQL' again
Result: All the original info in the 3 fields is lost.
Expected: the form must remember the values of the 3 fields for type 
'SQL' and show then again after step '3'.
Is this correct?
Question: Have you tried to turn off ajax to see if this is an ajax 
issue at all?

Best Regards,

Antonio Gallardo.

[1] 
http://cocoon.zones.apache.org/demos/21branch/samples/blocks/forms/do-datasourceChooser.flow 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Ralph Rauscher <rr...@blue-elephant-systems.com>.
Antonio Gallardo wrote:

> Ralph Rauscher wrote:
>
>>
>> Thanks! The 2.1.9-dev fixes the problem - the javascript error is 
>> gone and switching cases now works.
>
>
> Great to hear that!
>
>> However, there's a new problem. If I switch back and forth between 
>> union cases the values entered are not being remembered any more.
>
>
> Did it work before?
>

It did. At least with the Cocoon 2.1.8 release.


>> Is this already being addressed - if not, maybe someone can point me 
>> into the right direction so I can have a look into this myself.
>
>
> I don't know. But of course it needs to be addresed. Is a sample is 
> cocoon code that shows this problem? If not, can you provide a simple 
> sample?
>

Yes, there is a sample. The datasource chooser in the cforms samples 
section shows the problem. When switching union cases, the values are 
being remembered when using a cocoon 2.1.8. Using 2.1.9-dev values 
entered (or values initially loaded via binding) are lost when switching.

> Best Regards,
>
> Antonio Gallardo.
>
>>
>> Best regards
>> Ralph
>>
>>
>> Antonio Gallardo wrote:
>>
>>> In cocoon 2.1.9-dev there are already fixed some ajax issues.
>>>
>>> Best Regards,
>>>
>>> Antonio Gallardo.
>>>
>>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Antonio Gallardo <ag...@agssa.net>.
Ralph Rauscher wrote:

>
> Thanks! The 2.1.9-dev fixes the problem - the javascript error is gone 
> and switching cases now works.

Great to hear that!

> However, there's a new problem. If I switch back and forth between 
> union cases the values entered are not being remembered any more.

Did it work before?

> Is this already being addressed - if not, maybe someone can point me 
> into the right direction so I can have a look into this myself.

I don't know. But of course it needs to be addresed. Is a sample is 
cocoon code that shows this problem? If not, can you provide a simple 
sample?

Best Regards,

Antonio Gallardo.

>
> Best regards
> Ralph
>
>
> Antonio Gallardo wrote:
>
>> In cocoon 2.1.9-dev there are already fixed some ajax issues.
>>
>> Best Regards,
>>
>> Antonio Gallardo.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Ralph Rauscher <rr...@blue-elephant-systems.com>.
Thanks! The 2.1.9-dev fixes the problem - the javascript error is gone 
and switching cases now works. However, there's a new problem. If I 
switch back and forth between union cases the values entered are not 
being remembered any more. Is this already being addressed - if not, 
maybe someone can point me into the right direction so I can have a look 
into this myself.

Best regards
Ralph


Antonio Gallardo wrote:

> In cocoon 2.1.9-dev there are already fixed some ajax issues.
>
> Best Regards,
>
> Antonio Gallardo.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms multivalue field breaks if used within union widget with AJAX enabled??

Posted by Antonio Gallardo <ag...@agssa.net>.
In cocoon 2.1.9-dev there are already fixed some ajax issues.

Best Regards,

Antonio Gallardo.

Ralph Rauscher wrote:

> Hi,
>
> I'm having trouble using a multivalue field within a union - at least 
> with mozilla based browsers and AJAX enabled I'm getting JavaScript 
> errors and the multivalue field stops working.
>
> Attached is a very simple example that reproduces the problem. The tar 
> is intended to be extracted into a default cocoon installation in the 
> folder where the main cocoon sitemap resides and is then accessible 
> via http://localhost:xxxx/..../uniontest/uniontest. I'm using Cocoon 
> 2.1.8.
>
> The attached example lets you swich cases via a drop down box - very 
> similar to Datasource chooser sample in cocoon. Case 1 has a 
> multivalue field in it, case 2 has a simple field. Upon first loading, 
> the default case (the multivalue field) is displayed. Everything's 
> fine so far. You can now swich to case 2, so the simple field gets 
> displayed. However, from now on it is not possible to swich back to 
> the multivalue field - at least not with Mozilla or Firefox, IE works 
> fine...
>
> In the Javascript console I can see the following error when trying to 
> switch back:
>
> Error: this.entry has no properties
> Source File: 
> http://localhost:8080/cocoon2.1.8/policyeditnew/resources/forms/js/forms-lib.js 
>
> Line: 234
>
> This is located in the FormsMultiValueEditor JavaScript class that 
> gets instanciated as part of the multivalue field on the bowser side. 
> Also this is perfectly working upon first loading the page, it seems 
> that the partial AJAX updates that Mozilla / Firefox retrieves are not 
> immediatelly accessible via getElementById. Thus, the first lookup in 
> FormsMultiValueEditor() fails and causes Mozilla / Firefox cancelling 
> the new FormsMultiValueEditor() call together with the complete div 
> replacement and things stop working.
>
> (By the way: The same behaviour occurs when using a multivalue field 
> within a repeater that has move actions associated with the repeater 
> rows. As soon as a move has been triggered, the multivalue field stops 
> working.)
>
> Is this a known problem or is it possible to work around this? I've 
> dived into this somewhat, but my knowledge of JavaScript is still very 
> limited. Any help is greatly appreciated.
>
> Thanks!
>
> Ralph
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org