Replaced Javascript properties null assignments with .removeAttribute().
authorMarco Zanon <info@marcozanon.com>
Sun, 26 Aug 2012 10:09:26 +0000 (10:09 +0000)
committerMarco Zanon <info@marcozanon.com>
Sun, 26 Aug 2012 10:09:26 +0000 (10:09 +0000)
2.x/src/java/com/marcozanon/macaco/web/ui/MWebCellWidget.java
2.x/src/java/com/marcozanon/macaco/web/ui/MWebComboBox.java
2.x/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java
2.x/src/java/com/marcozanon/macaco/web/ui/MWebLabel.java
2.x/src/java/com/marcozanon/macaco/web/ui/MWebTextBox.java

index 2df770477e6bc37f50e4e6c255a148628cd1934c..d8ec0160ef41f45743f9e38e8cd9481580563587 100644 (file)
@@ -139,7 +139,7 @@ public abstract class MWebCellWidget extends MWebDisplayWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').verticalAlign = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('verticalAlign'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -152,7 +152,7 @@ public abstract class MWebCellWidget extends MWebDisplayWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').textAlign = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('textAlign'); }", this.getId(), this.getId()));
             }
         }
     }
index e4481285ccfe0d7cc6cd38ef47ee4417e985a056..b3befb5eeb2a28a1ca4419043c677cb6603be8e4 100644 (file)
@@ -281,7 +281,7 @@ public class MWebComboBox extends MWebDirectWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').textAlign = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('textAlign'); }", this.getId(), this.getId()));
             }
         }
     }
index e2fe448079e5b23f44d2e79da8b10451a44ed4ed..0ec0cc3f294a268ed0905afa10bd79f7ab330ccb 100644 (file)
@@ -746,7 +746,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').width = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('width'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -759,7 +759,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').height = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('height'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -772,7 +772,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').color = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('color'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -785,7 +785,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').backgroundColor = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('backgroundColor'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -823,7 +823,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
             }
             catch (MNullPropertyWebException exception) {
                 if (!directRefreshMode) {
-                    this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').border%s = null; }", this.getId(), this.getId(), temporaryBorderSide));
+                    this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('border%s'); }", this.getId(), this.getId(), temporaryBorderSide));
                 }
             }
         }
@@ -839,8 +839,8 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').font = null; }", this.getId(), this.getId()));
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').textDecoration = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('font'); }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('textDecoration'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -878,7 +878,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
             }
             catch (MNullPropertyWebException exception) {
                 if (!directRefreshMode) {
-                    this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').padding%s = null; }", this.getId(), this.getId(), temporaryPaddingSide));
+                    this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('padding%s'); }", this.getId(), this.getId(), temporaryPaddingSide));
                 }
             }
         }
@@ -892,7 +892,7 @@ public abstract class MWebDisplayWidget extends MWebWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').direction = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('direction'); }", this.getId(), this.getId()));
             }
         }
     }
index f589ce8b7d314007d71a906df5e2b4c2c74a5485..13ef9ea197cd36bbf690634dc44b43d4de90e80f 100644 (file)
@@ -140,7 +140,7 @@ public class MWebLabel extends MWebDirectWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').textAlign = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('textAlign'); }", this.getId(), this.getId()));
             }
         }
     }
index 11401a470dc4bbf2ac9d4079afc91bd3823fbf68..4cb6beca91a33190bc435e8d135515c2e37b7c77 100644 (file)
@@ -208,7 +208,7 @@ public abstract class MWebTextBox extends MWebDirectWidget {
         }
         catch (MNullPropertyWebException exception) {
             if (!directRefreshMode) {
-                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $S('%s').textAlign = null; }", this.getId(), this.getId()));
+                this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('textAlign'); }", this.getId(), this.getId()));
             }
         }
     }
@@ -220,7 +220,7 @@ public abstract class MWebTextBox extends MWebDirectWidget {
             this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').maxLength = '%s'; }", this.getId(), this.getId(), this.getFormattedMaximumLength()));
         }
         catch (MNullPropertyWebException exception) {
-            this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').maxLength = null; }", this.getId(), this.getId()));
+            this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').removeAttribute('maxLength'); }", this.getId(), this.getId()));
         }
     }