Skip to content
Snippets Groups Projects
Commit 9f3eb6fa authored by buczekp's avatar buczekp
Browse files

[LMS-2281] minor: don't save if cell was not modified

SVN: 21486
parent d768901c
No related branches found
No related tags found
No related merge requests found
...@@ -1708,8 +1708,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1708,8 +1708,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
} }
} }
private Grid<M> createGrid( private Grid<M> createGrid(PagingLoader<PagingLoadResult<M>> dataLoader, String gridId)
PagingLoader<PagingLoadResult<M>> dataLoader, String gridId)
{ {
ListStore<M> listStore = new ListStore<M>(dataLoader); ListStore<M> listStore = new ListStore<M>(dataLoader);
...@@ -1732,7 +1731,8 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1732,7 +1731,8 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
boolean editable = isEditable(model, columnID); boolean editable = isEditable(model, columnID);
if (editable == false) if (editable == false)
{ {
MessageBox.info("Not Editable", "Sorry, this table cell isn't editable", null); MessageBox.info("Not Editable", "Sorry, this table cell isn't editable",
null);
} }
event.setCancelled(editable == false); event.setCancelled(editable == false);
} }
...@@ -1744,7 +1744,14 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1744,7 +1744,14 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
M model = event.getModel(); M model = event.getModel();
String columnID = event.getProperty(); String columnID = event.getProperty();
Object value = event.getValue(); Object value = event.getValue();
handleEditingEvent(model, columnID, value == null ? null : value.toString()); if (value != null && value.equals(event.getStartValue())
|| value == event.getStartValue())
{
event.setCancelled(true);
} else
{
handleEditingEvent(model, columnID, value == null ? null : value.toString());
}
} }
}); });
return editorGrid; return editorGrid;
...@@ -1758,16 +1765,17 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1758,16 +1765,17 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
{ {
return false; return false;
} }
/** /**
* Tries to return the property of specified properties holder which is specified by * Tries to return the property of specified properties holder which is specified by the
* the property column name without a prefix like <code>property-</code> but with * property column name without a prefix like <code>property-</code> but with prefix which
* prefix which distinguishes internal from externally name space. * distinguishes internal from externally name space.
*/ */
protected IEntityProperty tryGetProperty(IEntityPropertiesHolder propertiesHolder, protected IEntityProperty tryGetProperty(IEntityPropertiesHolder propertiesHolder,
String propertyColumnNameWithoutPrefix) String propertyColumnNameWithoutPrefix)
{ {
String propertyTypeCode = CodeConverter.getPropertyTypeCode(propertyColumnNameWithoutPrefix); String propertyTypeCode =
CodeConverter.getPropertyTypeCode(propertyColumnNameWithoutPrefix);
List<IEntityProperty> properties = propertiesHolder.getProperties(); List<IEntityProperty> properties = propertiesHolder.getProperties();
for (IEntityProperty property : properties) for (IEntityProperty property : properties)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment