ItEr27S11AltaEtiquetasTipoEtiquetaItEr26S13: Added button delete, fix validations constraints when adding new rows
This commit is contained in:
parent
df29d0d948
commit
df2471eaaa
2 changed files with 9 additions and 6 deletions
|
|
@ -248,6 +248,7 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
}
|
||||
|
||||
public void createLabel() {
|
||||
validate();
|
||||
labelTypeModel.addLabel();
|
||||
Util.reloadBindings(gridLabels);
|
||||
// After adding a new row, model might be disordered, so we force it to
|
||||
|
|
@ -267,11 +268,9 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
ListModelExt model = (ListModelExt) gridLabels.getModel();
|
||||
if ("ascending".equals(column.getSortDirection())) {
|
||||
model.sort(column.getSortAscending(), true);
|
||||
return;
|
||||
}
|
||||
if ("descending".equals(column.getSortDirection())) {
|
||||
model.sort(column.getSortDescending(), false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
<button label="${i18n:_('New label')}"
|
||||
onClick="controller.createLabel()" />
|
||||
<grid id="gridLabels" height="320px"
|
||||
model="@{controller.labels}">
|
||||
model="@{controller.labels}" fixedLayout="true">
|
||||
<columns sizable="true">
|
||||
<column label="${i18n:_('Name')}"
|
||||
sort="auto(name)" sortDirection="ascending" />
|
||||
|
|
@ -42,11 +42,15 @@
|
|||
<rows>
|
||||
<row self="@{each='label'}"
|
||||
value="@{label}">
|
||||
<textbox value="@{label.name}"
|
||||
<textbox value="@{label.name}" width="500px"
|
||||
onChange="controller.onChangeLabelName(event)"
|
||||
constraint="no empty:${i18n:_('cannot be null or empty')}" />
|
||||
<button label="${i18n:_('Delete')}"
|
||||
onClick="controller.confirmDeleteLabel(self.parent.value)" />
|
||||
|
||||
<button sclass="icono" image="/common/img/ico_borrar1.png"
|
||||
hoverImage="/common/img/ico_borrar.png"
|
||||
tooltiptext="${i18n:_('Delete')}"
|
||||
onClick="controller.confirmDeleteLabel(self.parent.value);">
|
||||
</button>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue