ItEr21S09CUIntroducionAvanceUnidadeTraballoItEr20S07: It disables edit and remove buttons if the type is immutable.

ZK cannot use nots in data binding expressions, so immutable accesor created at AdvanceType
This commit is contained in:
Óscar González Fernández 2009-08-11 14:15:57 +02:00
parent 910604f585
commit c7c410292f
2 changed files with 6 additions and 2 deletions

View file

@ -69,6 +69,10 @@ public class AdvanceType extends BaseEntity {
return this.updatable;
}
public boolean isImmutable() {
return !this.updatable;
}
public void setUnitPrecision(BigDecimal precision) {
this.unitPrecision = precision;
this.unitPrecision.setScale(4, BigDecimal.ROUND_HALF_UP);

View file

@ -9,9 +9,9 @@
<rows>
<row self="@{each='advanceType'}" value="@{advanceType}">
<hbox>
<button label="Edit" onClick="controller.goToEditForm(self.parent.parent.value);">
<button label="Edit" disabled="@{advanceType.immutable}" onClick="controller.goToEditForm(self.parent.parent.value);">
</button>
<button label="Remove" onClick="controller.confirmRemove(self.parent.parent.value);">
<button label="Remove" disabled="@{advanceType.immutable}" onClick="controller.confirmRemove(self.parent.parent.value);">
</button>
</hbox>
<label value="@{advanceType.unitName}"/>