* [ 2009480 ] Sales Order Line - unable to enter qty,prc,uprc.
* Implemented auto commit.
This commit is contained in:
parent
9bc79e497d
commit
95b790fa1f
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.adempiere.webui.editor;
|
package org.adempiere.webui.editor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import org.adempiere.webui.ValuePreference;
|
import org.adempiere.webui.ValuePreference;
|
||||||
import org.adempiere.webui.component.NumberBox;
|
import org.adempiere.webui.component.NumberBox;
|
||||||
import org.adempiere.webui.event.ContextMenuEvent;
|
import org.adempiere.webui.event.ContextMenuEvent;
|
||||||
|
@ -66,7 +68,13 @@ public class WNumberEditor extends WEditor
|
||||||
public void onEvent(Event event)
|
public void onEvent(Event event)
|
||||||
{
|
{
|
||||||
String newValue = getComponent().getValue();
|
String newValue = getComponent().getValue();
|
||||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
BigDecimal oldNumber = null;
|
||||||
|
if (oldValue != null && oldValue.trim().length() > 0)
|
||||||
|
oldNumber = new BigDecimal(oldValue);
|
||||||
|
BigDecimal newNumber = null;
|
||||||
|
if (newValue != null && newValue.trim().length() > 0)
|
||||||
|
newNumber = new BigDecimal(newValue);
|
||||||
|
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldNumber, newNumber);
|
||||||
super.fireValueChange(changeEvent);
|
super.fireValueChange(changeEvent);
|
||||||
oldValue = newValue;
|
oldValue = newValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -531,12 +531,45 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curTabpanel.isEditing())
|
if (curTab != null)
|
||||||
{
|
{
|
||||||
FDialog.warn(curWindowNo, "Please save your changes before " +
|
if (curTab.isSortTab())
|
||||||
"switching tabs!!!", title);
|
{
|
||||||
|
if (curTabpanel instanceof ADSortTab)
|
||||||
|
{
|
||||||
|
((ADSortTab)curTabpanel).saveData();
|
||||||
|
((ADSortTab)curTabpanel).unregisterPanel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (curTab.needSave(true, false))
|
||||||
|
{
|
||||||
|
if (curTab.needSave(true, true))
|
||||||
|
{
|
||||||
|
// Automatic Save
|
||||||
|
if (Env.isAutoCommit(ctx, curWindowNo))
|
||||||
|
{
|
||||||
|
if (!curTab.dataSave(true))
|
||||||
|
{
|
||||||
|
// there is a problem, stop here
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// explicitly ask when changing tabs
|
||||||
|
else if (FDialog.ask(curWindowNo, this.getComponent(), "SaveChanges?", curTab.getCommitWarning()))
|
||||||
|
{ // yes we want to save
|
||||||
|
if (!curTab.dataSave(true))
|
||||||
|
{
|
||||||
|
// there is a problem, stop here
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Don't save
|
||||||
|
curTab.dataIgnore();
|
||||||
|
}
|
||||||
|
else // new record, but nothing changed
|
||||||
|
curTab.dataIgnore();
|
||||||
|
} // there is a change
|
||||||
|
}
|
||||||
|
|
||||||
if (!adTab.updateSelectedIndex(oldTabIndex, newTabIndex))
|
if (!adTab.updateSelectedIndex(oldTabIndex, newTabIndex))
|
||||||
{
|
{
|
||||||
|
@ -566,6 +599,11 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
curTabIndex = newTabIndex;
|
curTabIndex = newTabIndex;
|
||||||
curTabpanel = newTabpanel;
|
curTabpanel = newTabpanel;
|
||||||
|
|
||||||
|
if (curTabpanel instanceof ADSortTab)
|
||||||
|
{
|
||||||
|
((ADSortTab)curTabpanel).registerAPanel(this);
|
||||||
|
}
|
||||||
|
|
||||||
updateToolbar();
|
updateToolbar();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue