Author: simoneg
Date: Fri Dec 18 02:30:24 2009
New Revision: 892112

URL: http://svn.apache.org/viewvc?rev=892112&view=rev
Log:
LABS-503 : Use id in forms after removing "."

Modified:
    
labs/magma/trunk/website-maps-google/src/main/java/org/apache/magma/website/htmlpieces/MapBeanHtmlFormPiece.java

Modified: 
labs/magma/trunk/website-maps-google/src/main/java/org/apache/magma/website/htmlpieces/MapBeanHtmlFormPiece.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/website-maps-google/src/main/java/org/apache/magma/website/htmlpieces/MapBeanHtmlFormPiece.java?rev=892112&r1=892111&r2=892112&view=diff
==============================================================================
--- 
labs/magma/trunk/website-maps-google/src/main/java/org/apache/magma/website/htmlpieces/MapBeanHtmlFormPiece.java
 (original)
+++ 
labs/magma/trunk/website-maps-google/src/main/java/org/apache/magma/website/htmlpieces/MapBeanHtmlFormPiece.java
 Fri Dec 18 02:30:24 2009
@@ -17,6 +17,8 @@
                if (value != null) {
                        md = value.getValue();
                }
+               id = id.replace('-','_');
+               id = id.replace('.', '_');
                ret.append("<input type=\"hidden\" id=\"" + id + "\" name=\"" + 
id + "\" value=\"" + StringEscapeUtils.escapeXml(md) + "\"/>");
                ret.append("<div class=\"MagmaMapEdit\" id=\"" + id + 
"edit\"></div>");
                ret.append("<div class=\"MagmaMapListContainer\">");
@@ -37,6 +39,8 @@
                head.addExternalScript("magma:/common/maps/mapDisplay.js");
                head.addExternalScript("magma:/common/maps/mapEditor.js");
                head.addCss("magma:/common/maps/mapEditor.css");
+               id = id.replace('-','_');
+               id = id.replace('.', '_');              
                PropertyInfo property = getProperty();
                String options = null;
                MapBeanValidator validator = null;
@@ -54,11 +58,8 @@
                        }
                }
 
-               String val = id;
-               val = val.replace('.', '_');
-               val = val.replace('-', '_');
-               head.addRawScript("init-edit-" + val, "function initedit" + val 
+ "() { new MapEditor('" + id + "edit','" + id + "editlist','" + id + "'" + 
(options == null ? "" : (",'" + options+ "'")) + "); }");
-               head.addDoOnload("initedit" + val);             
+               head.addRawScript("init-edit-" + id, "var mapeditor" + id + " = 
null; function initedit" + id + "() { mapeditor"+ id + "=new MapEditor('" + id 
+ "edit','" + id + "editlist','" + id + "'" + (options == null ? "" : (",'" + 
options+ "'")) + "); }");
+               head.addDoOnload("initedit" + id);              
        }
 
        public boolean handles(Class<?> clazz) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to