I'm trying to build a Jenkins plugin with multiple fields
inside repeatable tag. I'm facing an issue with replenishing the values
inside repeatable tag.
I did some searching and found that adding advanced block helped a
little. Now first time I open the config page, It's getting loaded
properly (no JavaScript error).
But once on adding values to repeatable tag fields. Next time, config
page gets stuck at "Loading" overlay.
I'm suspecting somehow data binding during refilling the repeatable
values is causing this issue.
My config.jelly code snippet looks like this
<f:entry>
<f:advanced title="Add Properties" align="left">
<f:entry title="Add Properties" field="packageProperty">
<f:repeatable name="packageProperty" items="${instance.packageProperty}" var="packages" minimum = "1" add="Add Properties">
<table width="100%">
<tr>
<td width="7%" align="right">${%Package ID}</td>
<td width="20%">
<f:textarea name="packages.id" value="${!empty packages.id?packages.id:''}"/>
</td>
<td width="7%" align="right">${%Property Name}</td>
<td width="20%">
<f:textarea name="packages.name" value="${!empty packages.name?packages.name:''}"/>
</td>
<td width="7%" align="right">${%Property Value}</td>
<td width="20%">
<f:textarea name="packages.val" value="${!empty packages.val?packages.val:''}"/>
</td>
<td width="10%" align="right" ><f:repeatableDeleteButton/></td>
</tr>
</table>
</f:repeatable>
</f:entry>
</f:advanced>
</f:entry>
In back-end java file, I've created a List named packageProperty of type packages(class defined by me)
Here is the 'packages' class
public static class packages implements Cloneable {
private final String id;
private final String name;
private final String val;
@DataBoundConstructor
public packages(String id, String name, String val) {
this.id = id;
this.name = name;
this.val = val;
}
@Override
public Object clone() {
return new packages(getId(), getName(), getVal());
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public String getVal() {
return val;
}
}
If I manually remove the Loading Overlay, I can see the values in the repeatable block filled.
I hope this is enough information about the problem. Any suggestions
(even if they aren't complete answers) are really appreciated.