From: Marco Zanon Date: Sun, 26 Aug 2012 10:09:26 +0000 (+0000) Subject: Replaced Javascript properties null assignments with .removeAttribute(). X-Git-Tag: 2.0~6 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=8f699bcf6581c136265cb4c905a2e43ca71ceb7f;p=Macaco Replaced Javascript properties null assignments with .removeAttribute(). --- diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebCellWidget.java b/src/java/com/marcozanon/macaco/web/ui/MWebCellWidget.java index 2df7704..d8ec016 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebCellWidget.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebCellWidget.java @@ -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())); } } } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebComboBox.java b/src/java/com/marcozanon/macaco/web/ui/MWebComboBox.java index e448128..b3befb5 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebComboBox.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebComboBox.java @@ -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())); } } } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java b/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java index e2fe448..0ec0cc3 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebDisplayWidget.java @@ -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())); } } } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebLabel.java b/src/java/com/marcozanon/macaco/web/ui/MWebLabel.java index f589ce8..13ef9ea 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebLabel.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebLabel.java @@ -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())); } } } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebTextBox.java b/src/java/com/marcozanon/macaco/web/ui/MWebTextBox.java index 11401a4..4cb6bec 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebTextBox.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebTextBox.java @@ -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())); } }