Tomas Jelinek has posted comments on this change.
Change subject: webadmin: Disable new Pools popup when no Templates are
available
......................................................................
Patch Set 2:
(3 comments)
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
Line 1158: public void eventRaised(Event ev, Object sender,
EventArgs args) {
Line 1159: Boolean enabled =
object.getEditingEnabled().getEntity();
Line 1160: if (Boolean.FALSE.equals(enabled)) {
Line 1161: disableAllTabs();
Line 1162:
generalWarningMessage.setText(object.getEditingEnabled().getMessage()/*constants.notAvailableWithNoUpDC()*/);
please remove the commented out part
Line 1163: }
Line 1164: }
Line 1165: });
Line 1166:
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewPoolModelBehavior.java
Line 78: return parentValidation;
Line 79: }
Line 80:
Line 81: @Override
Line 82: protected void templateValidate() {
Simpler would be to call this method from the overridden initialize() method
from this class. That way you will not need the templateValidate() method in
the upper class at all.
Line 83: AsyncDataProvider.getAllVmTemplates(new AsyncQuery(getModel(),
new INewAsyncCallback() {
Line 84: @Override
Line 85: public void onSuccess(Object model, Object returnValue) {
Line 86: List<VmTemplate> templates = (List<VmTemplate>)
returnValue;
Line 79: }
Line 80:
Line 81: @Override
Line 82: protected void templateValidate() {
Line 83: AsyncDataProvider.getAllVmTemplates(new AsyncQuery(getModel(),
new INewAsyncCallback() {
I would still vote for creating a new query just for this which would return
just a boolean. This is a quite expensive operation to do it just to find out
one boolean.
Line 84: @Override
Line 85: public void onSuccess(Object model, Object returnValue) {
Line 86: List<VmTemplate> templates = (List<VmTemplate>)
returnValue;
Line 87: if(templates.size() <= 1) {
--
To view, visit http://gerrit.ovirt.org/21579
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iacb121d2e89922b04b8331db92e437cefc8b6b5c
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[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