Vojtech Szocs has uploaded a new change for review. Change subject: userportal: Fix VM Basic item button element IDs ......................................................................
userportal: Fix VM Basic item button element IDs Element IDs for VM Basic item buttons (Run, Shutdown, Suspend) were not initialized correctly, since item View's add*Button methods are now called early on, as part of item PresenterWidget onBind method (setElementId is called later on). Change-Id: Ie3ec57e493ad3de36e5fa494d4fdc4d3eefbc9da Signed-off-by: Vojtech Szocs <vsz...@redhat.com> --- M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/tab/basic/MainTabBasicListItemView.java 1 file changed, 7 insertions(+), 11 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/12754/1 diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/tab/basic/MainTabBasicListItemView.java b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/tab/basic/MainTabBasicListItemView.java index 67dbe1f..1ed9ddc 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/tab/basic/MainTabBasicListItemView.java +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/tab/basic/MainTabBasicListItemView.java @@ -32,7 +32,6 @@ import com.google.gwt.text.shared.AbstractRenderer; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.LayoutPanel; @@ -117,8 +116,6 @@ private final ApplicationConstants constants; private final ErrorPopupManager errorPopupManager; - private String elementId = DOM.createUniqueId(); - private MainTabBasicListItemActionButton runButton; private MainTabBasicListItemActionButton shutdownButton; private MainTabBasicListItemActionButton suspendButton; @@ -152,9 +149,7 @@ MainTabBasicListItemActionButton button = new MainTabBasicListItemActionButton( null, resources.playIcon(), resources.playDisabledIcon(), style.runButtonAdditionalStyle()); - button.setElementId(ElementIdUtils.createElementId(elementId, "runButton")); //$NON-NLS-1$ this.runButton = button; - addButtonToPanel(button); return button; } @@ -170,9 +165,7 @@ MainTabBasicListItemActionButton button = new MainTabBasicListItemActionButton( constants.shutdownVm(), resources.stopIcon(), resources.stopDisabledIcon(), style.shutdownButtonAdditionalStyle()); - button.setElementId(ElementIdUtils.createElementId(elementId, "shutdownButton")); //$NON-NLS-1$ this.shutdownButton = button; - addButtonToPanel(button); return button; } @@ -187,9 +180,7 @@ MainTabBasicListItemActionButton button = new MainTabBasicListItemActionButton( constants.suspendVm(), resources.pauseIcon(), resources.pauseDisabledIcon(), style.suspendButtonAdditionalStyle()); - button.setElementId(ElementIdUtils.createElementId(elementId, "suspendButton")); //$NON-NLS-1$ this.suspendButton = button; - addButtonToPanel(button); return button; } @@ -292,12 +283,17 @@ @Override public void setElementId(String elementId) { - this.elementId = elementId; - vmName.getElement().setId( ElementIdUtils.createElementId(elementId, "name")); //$NON-NLS-1$ vmStatus.getElement().setId( ElementIdUtils.createElementId(elementId, "status")); //$NON-NLS-1$ + + runButton.setElementId( + ElementIdUtils.createElementId(elementId, "runButton")); //$NON-NLS-1$ + shutdownButton.setElementId( + ElementIdUtils.createElementId(elementId, "shutdownButton")); //$NON-NLS-1$ + suspendButton.setElementId( + ElementIdUtils.createElementId(elementId, "suspendButton")); //$NON-NLS-1$ } } -- To view, visit http://gerrit.ovirt.org/12754 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3ec57e493ad3de36e5fa494d4fdc4d3eefbc9da Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vojtech Szocs <vsz...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches