Vojtech Szocs has posted comments on this change. Change subject: userportal, webadmin: add element ids to vm general subtab ......................................................................
Patch Set 1: (3 comments) http://gerrit.ovirt.org/#/c/34287/1/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/AbstractModelBoundFormWidget.java File frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/AbstractModelBoundFormWidget.java: Line 47: */ Line 48: protected abstract void doEdit(T model); Line 49: Line 50: /** Line 51: * Set elementId prefixes any any children that need it. ... to any children :-) Line 52: */ Line 53: public void setElementIdPrefixes() { Line 54: this.formPanel.setElementIdPrefix(this.getElement().getId()); Line 55: } http://gerrit.ovirt.org/#/c/34287/1/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/virtualMachine/SubTabVirtualMachineGeneralView.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/virtualMachine/SubTabVirtualMachineGeneralView.java: Line 37: // We need this in order to find the icon for alert messages: Line 38: private final ApplicationResources resources; Line 39: Line 40: @UiField(provided = true) Line 41: @WithElementId("form") If field name and field ID are same, you can omit the annotation value, for example: @WithElementId // will default to "form" VmGeneralModelForm form; Line 42: VmGeneralModelForm form; Line 43: Line 44: // This is the panel containing the alerts label and the Line 45: // potential alert, this way we can hide the panel Line 64: initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Line 65: clearAlerts(); Line 66: Line 67: generateIds(); Line 68: this.form.setElementIdPrefixes(); Instead of manually invoking form.setElementIdPrefixes(), you could make AbstractModelBoundFormWidget implement HasElementId interface, with implementation doing following: * get widget's DOM element and set ID on it * execute code in setElementIdPrefixes (no need for separate method now) This way, manually invoking form.setElementIdPrefixes() wouldn't be needed anymore, because HasElementId.setElementId() is called as part of generateIds(). Line 69: } Line 70: Line 71: @Override Line 72: protected void generateIds() { -- To view, visit http://gerrit.ovirt.org/34287 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d2c6843c61a1d9364a36e8d4d3b5b64a1726f69 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Sheremeta <[email protected]> Gerrit-Reviewer: Alexander Wels <[email protected]> Gerrit-Reviewer: Einav Cohen <[email protected]> Gerrit-Reviewer: Greg Sheremeta <[email protected]> Gerrit-Reviewer: Vojtech Szocs <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
