ItEr30S15RFVisualizacionMultiplesProxectosItEr29S18: Adding orders tab
This commit is contained in:
parent
0d156974d2
commit
2ba923e9ee
3 changed files with 98 additions and 6 deletions
|
|
@ -21,9 +21,12 @@ package org.navalplanner.web.planner.tabs;
|
|||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.navalplanner.business.orders.entities.Order;
|
||||
import org.navalplanner.web.common.Util;
|
||||
import org.navalplanner.web.planner.CompanyPlanningController;
|
||||
import org.navalplanner.web.planner.tabs.CreatedOnDemandTab.IComponentCreator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -36,6 +39,7 @@ import org.zkoss.zk.ui.Executions;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zkplus.databind.AnnotateDataBinder;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.Label;
|
||||
|
|
@ -182,10 +186,32 @@ public class MultipleTabsPlannerController {
|
|||
@Override
|
||||
public org.zkoss.zk.ui.Component create(
|
||||
org.zkoss.zk.ui.Component parent) {
|
||||
return withUpAndDownButton(new Label("on order view. mode: "
|
||||
+ mode.getType()));
|
||||
}
|
||||
});
|
||||
org.zkoss.zk.ui.Component result = Executions.createComponents(
|
||||
"/orders/_ordersTab.zul",
|
||||
parent,
|
||||
null);
|
||||
createBindingsFor(result);
|
||||
Util.reloadBindings(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void createBindingsFor(org.zkoss.zk.ui.Component result) {
|
||||
List<org.zkoss.zk.ui.Component> children = new ArrayList<org.zkoss.zk.ui.Component>(
|
||||
result.getChildren());
|
||||
for (org.zkoss.zk.ui.Component child : children) {
|
||||
createBindingsFor(child);
|
||||
}
|
||||
setBinderFor(result);
|
||||
}
|
||||
|
||||
private void setBinderFor(org.zkoss.zk.ui.Component result) {
|
||||
AnnotateDataBinder binder = new AnnotateDataBinder(result, true);
|
||||
result.setVariable("binder", binder, true);
|
||||
binder.loadAll();
|
||||
}
|
||||
|
||||
private ITab createOrderOrdersTab() {
|
||||
|
|
|
|||
68
navalplanner-webapp/src/main/webapp/orders/_ordersTab.zul
Normal file
68
navalplanner-webapp/src/main/webapp/orders/_ordersTab.zul
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<!--
|
||||
This file is part of ###PROJECT_NAME###
|
||||
|
||||
Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
Desenvolvemento Tecnolóxico de Galicia
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n"?>
|
||||
<?component name="list" inline="true" macroURI="_list.zul"?>
|
||||
<?component name="edition" inline="true" macroURI="_edition.zul"?>
|
||||
<?component name="orderElement" inline="true" macroURI="_editOrderElement.zul"?>
|
||||
<zk>
|
||||
<window apply="org.navalplanner.web.orders.OrderCRUDController">
|
||||
<vbox id="messagesContainer"></vbox>
|
||||
<list top_id="listWindow" />
|
||||
<edition top_id="createWindow" title="${i18n:_('Create')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}" />
|
||||
<edition top_id="editWindow" title="${i18n:_('Edit order')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}" />
|
||||
<orderElement top_id="editOrderElement" title="${i18n:_('Edit order element')}"
|
||||
back_button_label="${i18n:_('Back')}" />
|
||||
|
||||
<window visible="@{controller.confirmingRemove}"
|
||||
id="confirmRemove" title="${i18n:_('Confirm')}" width="500px"
|
||||
position="center">
|
||||
<vbox>
|
||||
<hbox>
|
||||
<i18n value="Confirm deleting {0} ?" arg0="@{controller.order.name}"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button label="${i18n:_('Yes')}"
|
||||
onClick="controller.remove(controller.order);" />
|
||||
<button label="${i18n:_('No')}"
|
||||
onClick="controller.cancelRemove();" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
|
||||
<window visible="@{controller.confirmingSchedule}"
|
||||
id="confirmSchedule" title="${i18n:_('Confirm')}" width="500px"
|
||||
position="center">
|
||||
<vbox>
|
||||
<hbox>
|
||||
<i18n value="Confirm scheduling {0} ?" arg0="@{controller.order.name}"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button label="${i18n:_('Yes')}"
|
||||
onClick="controller.schedule();" />
|
||||
<button label="${i18n:_('No')}"
|
||||
onClick="controller.cancelSchedule();" />
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
</window>
|
||||
|
||||
</zk>
|
||||
|
|
@ -34,8 +34,6 @@
|
|||
multipleTabsPlanner = multipleTabsPlannerController;
|
||||
]]>
|
||||
</zscript>
|
||||
<!-- choose lightLoad, mediumLoad or highLoad.
|
||||
-->
|
||||
<tabSwitcher self="@{define(content)}" configuration="@{multipleTabsPlanner.tabs}">
|
||||
</tabSwitcher>
|
||||
</zk>
|
||||
Loading…
Add table
Reference in a new issue