cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Rauscher <...@blue-elephant-systems.com>
Subject Re: pass repeater from database to the form
Date Fri, 01 Aug 2008 17:19:30 GMT
Use

var row = repeater.addRow();

instead of

var row = repeater.getRow(i);


Мария Григорьева wrote:
>
> I'm trying to pass the parameters from the database to the repeater in
> the form.
>
>  
>
> var repeater=form.getChild("test");
>
>                 for (var i = 0; i < comp_in_composition.size(); i++) {
>
>                                var row = repeater.getRow(i);
>
>                                var type = row.getChild("type");
>
>                                var amount = row.getChild("amount");
>
>                                var select = row.getChild("select");
>
>                               
> type.setValue(comp_in_composition.get(i).get("type"));
>
>                               
> amount.setValue(comp_in_composition.get(i).get("amount"));
>
>                                select.setValue(false);
>
>                 }
>
>  
>
> But, I've got an exception:  java.lang.IndexOutOfBoundsException:
> Index: 1, Size: 1
>
>  
>
> What's the problem? How to pass this params to the form repeater?
>



Mime
View raw message