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:
parent
910604f585
commit
c7c410292f
2 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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}"/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue