Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java @ 630:40d3039f85ac
ISSUE-40 (part I/II) Write values that the user had former selected / inserted into DESCRIBE document to preselect such data in the UI.
flys-artifacts/trunk@1995 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 24 May 2011 12:58:55 +0000 |
parents | 929137ee8154 |
children | acf3b49ec31f |
comparison
equal
deleted
inserted
replaced
629:65e4e42b4b03 | 630:40d3039f85ac |
---|---|
136 | 136 |
137 data = data != null ? data : getData(name); | 137 data = data != null ? data : getData(name); |
138 | 138 |
139 Element select = createData(creator, artifact, data, context); | 139 Element select = createData(creator, artifact, data, context); |
140 | 140 |
141 String defValue = (String) data.getValue(); | |
142 String defDesc = null; | |
143 | |
144 if (defValue != null && defValue.length() > 0) { | |
145 defDesc = Resources.getMsg( | |
146 context.getMeta(), | |
147 defValue, | |
148 defValue); | |
149 } | |
150 | |
151 if (defValue != null && defDesc != null) { | |
152 creator.addAttr(select, "defaultValue", defValue, true); | |
153 creator.addAttr(select, "defaultLabel", defDesc, true); | |
154 } | |
155 | |
141 Element choices = ProtocolUtils.createArtNode( | 156 Element choices = ProtocolUtils.createArtNode( |
142 creator, "choices", null, null); | 157 creator, "choices", null, null); |
143 | 158 |
144 select.appendChild(choices); | 159 select.appendChild(choices); |
145 ui.appendChild(select); | 160 ui.appendChild(select); |