From: <die...@us...> - 2010-06-21 08:23:26
|
Revision: 2694 http://openutils.svn.sourceforge.net/openutils/?rev=2694&view=rev Author: diego_schivo Date: 2010-06-21 08:23:17 +0000 (Mon, 21 Jun 2010) Log Message: ----------- CONTROLS-31 combo column type Modified Paths: -------------- trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl Modified: trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java =================================================================== --- trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2010-06-18 17:11:17 UTC (rev 2693) +++ trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2010-06-21 08:23:17 UTC (rev 2694) @@ -33,9 +33,23 @@ /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") public String drawSupportHtml(String propertyName, Map colmap) { - return StringUtils.EMPTY; + StringBuilder sb = new StringBuilder(); + sb.append("<select id=\"combo-" + + propertyName + + "\" name=\"combo-" + + propertyName + + "\" style=\"display: none;\">"); + Map optionMap = (Map) colmap.get("options"); + for (Object optionValue : optionMap.values()) + { + Map option = (Map) optionValue; + sb.append("<option value=\"" + option.get("value") + "\">" + option.get("label") + "</option>"); + } + sb.append("</select>"); + return new String(sb); } /** Modified: trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl =================================================================== --- trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2010-06-18 17:11:17 UTC (rev 2693) +++ trunk/openutils-mgnlcontrols/src/main/resources/dialogs/grid.ftl 2010-06-21 08:23:17 UTC (rev 2694) @@ -77,16 +77,11 @@ </div> [#list configuration.columns?values as colmap] - [#if (colmap.type?? && colmap.type = 'combo')] - <select id="combo-${name}" name="combo-${name}" style="display: none;"> - [#list colmap.options?values as option] - <option value="${option.value}">${option.label}</option> - [/#list] - </select> + [#if (colmap.type?? && gridColumnTypes[colmap.type]??)] + ${gridColumnTypes[colmap.type].drawSupportHtml(name, colmap)} [/#if] [/#list] - <script type="text/javascript"> // <![CDATA[ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |