提交 6641190b 编写于 作者: R Robert Sandell

Merge pull request #1926 from rsandell/rsandell-enum-default

Added default attribute to enum.jelly
......@@ -32,10 +32,13 @@ THE SOFTWARE.
<st:attribute name="field">
Used for databinding. TBD.
</st:attribute>
<st:attribute name="default">
The name of the enum to set as default value for the first configuration.
</st:attribute>
</st:documentation>
<select class="setting-input" name="${field}">
<j:forEach var="it" items="${descriptor.getPropertyType(instance,field).enumConstants}">
<f:option value="${it.name()}" selected="${it==instance[field]}">
<f:option value="${it.name()}" selected="${instance != null ? it==instance[field] : it.name()==default}">
<d:invokeBody />
</f:option>
</j:forEach>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册