ItEr38S05ValidacionEProbasFuncionaisItEr37S06 : Fix and add the NewDataSortableGrid to HoursGroupWrapper managment.
This commit is contained in:
parent
c18289ac5d
commit
a9402cb327
4 changed files with 20 additions and 14 deletions
|
|
@ -50,7 +50,6 @@ import org.zkoss.zk.ui.util.GenericForwardComposer;
|
|||
import org.zkoss.zul.Bandbox;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Constraint;
|
||||
import org.zkoss.zul.Grid;
|
||||
import org.zkoss.zul.Hbox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Label;
|
||||
|
|
@ -90,7 +89,7 @@ public class AssignedCriterionRequirementToOrderElementController extends
|
|||
|
||||
private NewDataSortableGrid listingRequirements;
|
||||
|
||||
private Grid listHoursGroups;
|
||||
private NewDataSortableGrid listHoursGroups;
|
||||
|
||||
private Intbox orderElementTotalHours;
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ public class AssignedCriterionRequirementToOrderElementModel implements
|
|||
(asOrderLine()).addHoursGroup(newHoursGroup);
|
||||
|
||||
// Set generated name
|
||||
int number = (asOrderLine()).getHoursGroups().size();
|
||||
int number = (asOrderLine()).getHoursGroups().size() - 1;
|
||||
newHoursGroup.setName(_("New hours group ") + number);
|
||||
|
||||
return newHoursGroup;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import org.navalplanner.business.resources.entities.ResourceEnum;
|
|||
* requirement.
|
||||
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
|
||||
*/
|
||||
public class HoursGroupWrapper implements INewObject {
|
||||
public class HoursGroupWrapper implements INewObject, Comparable {
|
||||
|
||||
private Boolean newObject = false;
|
||||
|
||||
|
|
@ -82,7 +82,9 @@ public class HoursGroupWrapper implements INewObject {
|
|||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.hoursGroup.setName(name);
|
||||
if (hoursGroup != null) {
|
||||
hoursGroup.setName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceEnum getResourceType() {
|
||||
|
|
@ -349,4 +351,9 @@ public class HoursGroupWrapper implements INewObject {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object arg0) {
|
||||
final HoursGroupWrapper hoursGroupWrapper = (HoursGroupWrapper) arg0;
|
||||
return getName().compareTo(hoursGroupWrapper.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -145,16 +145,16 @@ criterionRequirementsController = new org.navalplanner.web.orders.AssignedCriter
|
|||
onClick="criterionRequirementsController.addHoursGroup()" />
|
||||
<separator bar="false" spacing="20px" orient="vertical"/>
|
||||
</hbox>
|
||||
<grid id = "listHoursGroups" mold="paging" pageSize="4" fixedLayout="true"
|
||||
<newdatasortablegrid id = "listHoursGroups" mold="paging" pageSize="4" fixedLayout="true"
|
||||
model="@{criterionRequirementsController.hoursGroupWrappers}">
|
||||
<columns>
|
||||
<column width="25px" />
|
||||
<column label="Name" width="160px" align="center"/>
|
||||
<column label="Type" width="130px" align="center"/>
|
||||
<column label="Hours" width="120px" align="center"/>
|
||||
<column label="%" width="100px" align="center"/>
|
||||
<column label="Fixed %" width="50px" align="center"/>
|
||||
<column label="Operations" align="center"/>
|
||||
<newdatasortablecolumn width="25px" sort="auto"/>
|
||||
<newdatasortablecolumn label="Name" width="160px" sort="auto(name)" sortDirection="ascending" align="center"/>
|
||||
<newdatasortablecolumn label="Type" width="130px" align="center"/>
|
||||
<newdatasortablecolumn label="Hours" width="120px" align="center"/>
|
||||
<newdatasortablecolumn label="%" width="100px" align="center"/>
|
||||
<newdatasortablecolumn label="Fixed %" width="50px" align="center"/>
|
||||
<newdatasortablecolumn label="Operations" align="center"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row self="@{each='hoursGroupWrapper'}" value="@{hoursGroupWrapper}">
|
||||
|
|
@ -195,7 +195,7 @@ criterionRequirementsController = new org.navalplanner.web.orders.AssignedCriter
|
|||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</newdatasortablegrid>
|
||||
</panelchildren>
|
||||
</panel>
|
||||
</vbox>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue