You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agssa.net> on 2005/05/25 13:05:26 UTC

Small AJAX bugs inside repeaters

Hi:

I tried to use AJAX inside a repeater. I have there 3 combos, but this
does not matter. Everything works good, but now the Add row button does
not work. I saw cocoon works, but the new line does not show. The same
apply while trying to remove a row.

Am I missing something?

Please help.

Best Regards,

Antonio Gallardo.

Re: Small AJAX bugs inside repeaters

Posted by Antonio Gallardo <ag...@agssa.net>.
On Mie, 25 de Mayo de 2005, 12:16, Sylvain Wallez dijo:
> Antonio Gallardo wrote:
>
>>Hi:
>>
>>I tried to use AJAX inside a repeater. I have there 3 combos, but this
>>does not matter. Everything works good, but now the Add row button does
>>not work. I saw cocoon works, but the new line does not show. The same
>>apply while trying to remove a row.
>>
>>Am I missing something?

Thanks for the reply!

> Two important points:
> - update the stylesheets. For AJAX to work, every widget must translate
> to an element having the widget's full id. I added a few <span> and
> <div> in the XSLs to achieve this.

Already done before posting.

> - you cannot use <ft:repeater-widget> with AJAX, but two new
> <ft:repeater> and <ft:repeater-rows> instructions (see e.g.
> dynamicrepeater_template.xml). Having an enclosing tag around the row
> iterator was needed to be able to produce the id mentioned below.

Seems like this was the problem. :-) Thanks again.

But, now, I am facing another problem:

Inside a repeater there are 3 combo boxes. The current behavior is:

1- On a new row, we present only combo1.
2- When the user select a non-null value from combo1, then we show combo2.
3. When the user select a non-null value from combo2, then we show combo3.

This seems to work good, but I found another weird problem there:

1-Select a valid value for combo1. => shows combo2
2-Select the null value for combo1 => invisible combo2.
3.Select the same value for combo1 as in step 1. => nothing happens! But
combo2 mustr to be showed again.

I wonder why I am getting this error.

If in step 3. I select a diferent value (not equal as selected in step 1)
then it works.

I think this is really weird. Seems like for some reasons the value is not
"cleaned up" in combo1. Maybe this is the reason of the trouble in this
chain for combo1:

null --> selectXposition --> null --> selectXposition

But this works:

null --> selectXposition --> null --> selectYposition  (X != Y)

It is weird, right?

Am I missing something again?

Best Regards,

Antonio Gallardo.


Re: Small AJAX bugs inside repeaters

Posted by Sylvain Wallez <sy...@apache.org>.
Antonio Gallardo wrote:

>Hi:
>
>I tried to use AJAX inside a repeater. I have there 3 combos, but this
>does not matter. Everything works good, but now the Add row button does
>not work. I saw cocoon works, but the new line does not show. The same
>apply while trying to remove a row.
>
>Am I missing something?
>  
>

Two important points:
- update the stylesheets. For AJAX to work, every widget must translate 
to an element having the widget's full id. I added a few <span> and 
<div> in the XSLs to achieve this.
- you cannot use <ft:repeater-widget> with AJAX, but two new 
<ft:repeater> and <ft:repeater-rows> instructions (see e.g. 
dynamicrepeater_template.xml). Having an enclosing tag around the row 
iterator was needed to be able to produce the id mentioned below.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director