Alexander Wels has uploaded a new change for review.

Change subject: userportal,webadmin: GWT debug showing error
......................................................................

userportal,webadmin: GWT debug showing error

- While running the GWT debugger, it kept throwing exceptions
  that the <div id=" was an incomplete HTML expression which
  is true. So I reworked it a little bit to use a template which
  generates a complete expression.

Change-Id: I02fc61fd82fa8fa6f59a6218c561697b36ee28be
Signed-off-by: Alexander Wels <aw...@redhat.com>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/StatusCompositeCellWithElementId.java
1 file changed, 19 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/99/34399/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/StatusCompositeCellWithElementId.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/StatusCompositeCellWithElementId.java
index ac37cd7..a454a8f 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/StatusCompositeCellWithElementId.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/StatusCompositeCellWithElementId.java
@@ -10,6 +10,8 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.CssResource;
+import com.google.gwt.safehtml.client.SafeHtmlTemplates;
+import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
 
 public class StatusCompositeCellWithElementId extends 
CompositeCellWithElementId<VM> implements CellWithElementId<VM>{
@@ -22,9 +24,16 @@
         String divInlineBlock();
     }
 
+    public interface ContentTemplate extends SafeHtmlTemplates {
+        @Template("<div class=\"{0}\">")
+        SafeHtml id(String id);
+    }
+
     private static final StatusCompositeCellResources RESOURCES = 
GWT.create(StatusCompositeCellResources.class);
     private final StatusCompositeCellCss style;
     private final List<HasCell<VM, ?>> hasCells;
+
+    private ContentTemplate template;
 
     public StatusCompositeCellWithElementId(List<HasCell<VM, ?>> hasCells) {
         super(hasCells);
@@ -33,11 +42,17 @@
         style.ensureInjected();
     }
 
+    ContentTemplate getTemplate() {
+        if (template == null) {
+            template = GWT.create(ContentTemplate.class);
+        }
+        return template;
+    }
+
     @Override
     public void render(Cell.Context context, VM value, SafeHtmlBuilder sb) {
-        sb.appendHtmlConstant("<div id=\""); //$NON-NLS-1$
-        
sb.appendEscaped(ElementIdUtils.createTableCellElementId(getElementIdPrefix(), 
getColumnId(), context));
-        sb.appendHtmlConstant("\">"); //$NON-NLS-1$
+        sb.append(getTemplate().id(ElementIdUtils.createTableCellElementId(
+                getElementIdPrefix(), getColumnId(), context)));
 
         for (HasCell<VM, ?> hasCell : hasCells) {
             render(context, value, sb, hasCell);
@@ -46,6 +61,7 @@
         sb.appendHtmlConstant("</div>"); //$NON-NLS-1$
     }
 
+    @Override
     protected <T> void render(Cell.Context context, VM value,
                               SafeHtmlBuilder sb, HasCell<VM, T> hasCell) {
         Cell<T> cell = hasCell.getCell();


-- 
To view, visit http://gerrit.ovirt.org/34399
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02fc61fd82fa8fa6f59a6218c561697b36ee28be
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <aw...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to