BF [ 1742159 ] Editable number field for inactive record

http://sourceforge.net/tracker/index.php?func=detail&aid=1742159&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-06-23 18:40:50 +00:00
parent 074584f043
commit be66313aaf
2 changed files with 37 additions and 11 deletions

View File

@ -49,6 +49,8 @@ import org.compiere.util.*;
* </pre>
* @author Jorg Janke
* @version $Id: GridTab.java,v 1.10 2006/10/02 05:18:39 jjanke Exp $
*
* @author Teo Sarca - BF [ 1742159 ]
*/
public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
@ -2279,16 +2281,17 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
*/
public boolean isProcessed()
{
int index = m_mTable.findColumn("Processed");
if (index != -1)
{
Object oo = m_mTable.getValueAt(m_currentRow, index);
if (oo instanceof String)
return "Y".equals(oo);
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
}
return "Y".equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, "Processed"));
return getValueAsBoolean("Processed");
} // isProcessed
/**
* Is the current record active
* @return true if current record is active
* @author Teo Sarca - BF [ 1742159 ]
*/
public boolean isActive()
{
return getValueAsBoolean("IsActive");
} // isProcessed
/**
@ -2429,6 +2432,27 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
return getValue(field);
} // getValue
/**
* Get Boolean Value of Field with columnName.
* If there is no column with the given name, the context for current window will be checked.
* @param columnName column name
* @return boolean value or false if the field was not found
* @author Teo Sarca
*/
public boolean getValueAsBoolean(String columnName)
{
int index = m_mTable.findColumn(columnName);
if (index != -1)
{
Object oo = m_mTable.getValueAt(m_currentRow, index);
if (oo instanceof String)
return "Y".equals(oo);
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
}
return "Y".equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, columnName));
} // isProcessed
/**
* Get Value of Field
* @param field field

View File

@ -94,6 +94,8 @@ import org.compiere.util.*;
* </pre>
* @author Jorg Janke
* @version $Id: GridController.java,v 1.8 2006/09/25 00:59:52 jjanke Exp $
*
* @author Teo Sarca - BF [ 1742159 ]
*/
public class GridController extends CPanel
implements DataStatusListener, ListSelectionListener, Evaluatee,
@ -962,7 +964,7 @@ public class GridController extends CPanel
*/
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
{
if (m_mTab.isProcessed()) // only active records
if (m_mTab.isProcessed() || !m_mTab.isActive()) // only active records
{
Object source = e.getSource();
if (source instanceof VEditor)