Pokud je v položkovém gridu vybraná některá z položek a zmáčkne se

"Smazat" u jiné položky, smaže se položka, na které tlačítko leží.

closes #159
This commit is contained in:
2014-10-20 10:16:25 +02:00
parent 13f35611fd
commit eaf37147dc
2 changed files with 5 additions and 3 deletions
@@ -126,6 +126,7 @@ public class RequirementForm extends FormViewModel<Requirement>
}
@Command
@NotifyChange({ "selItemIndex", "selectedItem" })
public void onFocusItem(@BindingParam("item") RequirementItem item, @BindingParam("ctrl") InputElement ctrl)
{
this.selItemIndex = this.getDataBean().getItems().indexOf(item);
@@ -148,13 +149,14 @@ public class RequirementForm extends FormViewModel<Requirement>
}
@Command
@NotifyChange({ "syncItems", "selItemIndex" })
@NotifyChange({ "syncItems", "selItemIndex", "selectedItem" })
public void removeItem(@BindingParam("form") SimpleForm form, @BindingParam("item") RequirementItem item)
{
if (item != null)
{
this.getDataBean().getItems().remove(item);
this.setSelItemIndex(-1);
this.selItemIndex = -1;
this.selectedItem = null;
this.calcAndUpdateFormTotalPrice(form);
}
}
@@ -207,7 +207,7 @@
<button
image="~./zul/img/misc/drag-disallow.png"
label="${labels.RemoveItem}"
onClick="@command('removeItem', item=each, form=fx, ctrl=self)"
onClick="@command('removeItem', form=fx, item=each)"
sclass="nicebutton" />
</listcell>
</listitem>