I didn't found any solution.
Anyone have any idea?

2012/7/27 mpapo - Michaël Pailloncy <mpapo....@gmail.com>

>
>  Hi,
> I've a problematic concerning f:repeatable. I would like to add specifics
> action button on each element
> I've tried :
>
>                         <f:repeatable name="items" items="${it.items}"
> var="item" noAddButton="true" minimum="0">
>                             <table>
>                                 <f:entry title="title1">
>                                     <f:textbox field="text1" />
>                                 </f:entry>
>                                 <f:entry title="title2">
>                                     <f:textbox field="text2"/>
>                                 </f:entry>
>                                 <f:entry>
>                                     <div align="left">
>                                         <f:submit name="myButtonAction1"
> value="myButtonAction1"/>
>                                         <f:submit name="myButtonAction2"
> value="myButtonAction2"/>
>                                        </div>
>                                     <div align="right">
>                                         <input type="button"
> value="${%Delete}" class="repeatable-delete show-if-only"
> style="margin-left: 1em;" />
>                                        </div>
>                                 </f:entry>
>                                 <f:entry>
>                                     <div align="left">
>                                         <input type="button"
> value="${%Add}" class="repeatable-add repeated-chunk repeated-chunk.last
> show-if-last" />
>                                        </div>
>                                 </f:entry>
>                             </table>
>                         </f:repeatable>
>
> Unfortunatly, it doen't work because I'm not able to associate the pressed
> button (myButtonAction1 or myButtonAction2) with the Item object on server
> side.
>
> I've tried to add a specific id per item like this :
>                          <f:repeatable name="items" items="${it.items}"
> var="item" noAddButton="true" minimum="0">
>                             <table>
>                                 <f:entry title="title1">
>                                     <f:textbox field="text1" />
>                                 </f:entry>
>                                 <f:entry title="title2">
>                                     <f:textbox field="text2"/>
>                                 </f:entry>
>                                 <f:invisibleEntry>
>                                     <f:textbox field="item.id" value="${
> item.id}" />
>                                 </f:invisibleEntry>
>                                 <f:entry>
>                                     <div align="left">
>                                         <f:submit name="myButtonAction1_${
> item.id}" value="myButtonAction1_${item.id}"/>
>                                         <f:submit name="myButtonAction2_${
> item.id}" value="myButtonAction2_${item.id}"/>
>                                        </div>
>                                     <div align="right">
>                                         <input type="button"
> value="${%Delete}" class="repeatable-delete show-if-only"
> style="margin-left: 1em;" />
>                                        </div>
>                                 </f:entry>
>                                 <f:entry>
>                                     <div align="left">
>                                         <input type="button"
> value="${%Add}" class="repeatable-add repeated-chunk repeated-chunk.last
> show-if-last" />
>                                        </div>
>                                 </f:entry>
>                             </table>
>                         </f:repeatable>
>
> But it doesn't work if you add 3 items for example, the part of HTML
> inserted is just copied from the second item. So, the second and the third
> element have the same id.
> I've tried to search for information and I found
> https://wiki.jenkins-ci.org/display/JENKINS/Unique+IDs+for+Repeatable+Contentbut
>  it's not longer supported.
> I've also tried to search in a ten of plugins and does'nt find this kind
> of use of f:repeatable.
>
> Does anybody have any idea ?
>

Reply via email to