尝试实现插件的配置文件时遇到问题。
我使用现有的SideBar插件启动了我的程序,但是当我将List<String>
作为变量添加到class Action
时遇到了问题:private List<String> projects;
如何在果冻文件中填写这样的列表?
我试过这样做:
<f:entry>
<f:optionalBlock title="Project to be considered :">
<f:repeatable var="project" items="${link.projects}" name="projects" add="Add a project">
<f:entry title="Project 1 :">
</f:entry>
</f:repeatable>
</f:optionalBlock>
</f:entry>
我在links.jelly文件中添加了这些行,但它不起作用。
如果有人知道怎么做,那就太好了。
谢谢
答案 0 :(得分:3)
您的操作中的列表应该有一个类型(也是为了更好的阅读)
private List<YourObject> projects
然后你的config.jelly看起来像这样:
<f:repeatable var="projectInList" name="projects" items="${instance.projects}" noAddButton="true" minimum="0">
<fieldset>
<f:entry title="${%Project}" description="Project desc."
field="variableInProjectObject">
<f:textbox value="${projectInList.variableInProjectObject}" default="" />
</f:entry>
</fieldset>
</f:repeatable>
答案 1 :(得分:0)
<f:entry title="Parameters" field="projects">
<f:repeatableProperty field="projects" minimum="1" />
</f:entry>