Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java @ 637:154d158238d3
Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
gnv-artifacts/trunk@720 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 01 Mar 2010 16:00:39 +0000 |
parents | 22cc12b1622c |
children | 078ba6799bd2 |
comparison
equal
deleted
inserted
replaced
636:22cc12b1622c | 637:154d158238d3 |
---|---|
712 String[] descriptions = data.getDescription(); | 712 String[] descriptions = data.getDescription(); |
713 int size = descriptions.length; | 713 int size = descriptions.length; |
714 | 714 |
715 for (int i = 0; i < size; i++) { | 715 for (int i = 0; i < size; i++) { |
716 Element itemNode = creator.create("item"); | 716 Element itemNode = creator.create("item"); |
717 String value = data.getValue(); | |
718 String desc = descriptions[i]; | |
719 desc = desc == null ? value : desc; | |
717 | 720 |
718 creator.addAttr(itemNode, "selected", "true"); | 721 creator.addAttr(itemNode, "selected", "true"); |
719 | 722 |
720 Element choiceLableNode = creator.create("label"); | 723 Element choiceLableNode = creator.create("label"); |
721 choiceLableNode.setTextContent(descriptions[i]); | 724 choiceLableNode.setTextContent(desc); |
722 itemNode.appendChild(choiceLableNode); | 725 itemNode.appendChild(choiceLableNode); |
723 | 726 |
724 Element choiceValueNode = creator.create("value"); | 727 Element choiceValueNode = creator.create("value"); |
725 choiceValueNode.setTextContent(data.getValue()); | 728 choiceValueNode.setTextContent(value); |
726 itemNode.appendChild(choiceValueNode); | 729 itemNode.appendChild(choiceValueNode); |
727 choiceNode.appendChild(itemNode); | 730 choiceNode.appendChild(itemNode); |
728 } | 731 } |
729 | 732 |
730 selectNode.appendChild(lableNode); | 733 selectNode.appendChild(lableNode); |