* remove system.err.println and system.out.println
This commit is contained in:
parent
94686ee053
commit
ca5fda5868
|
@ -33,12 +33,12 @@ import org.zkoss.zul.Menupopup;
|
|||
/**
|
||||
* Application Zoom Across Launcher.
|
||||
* Called from APanel; Queries available Zoom Targets for Table.
|
||||
*
|
||||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: AZoomAcross.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - FR [ 1762465 ]
|
||||
*
|
||||
*
|
||||
* ZK Port
|
||||
* @author Low Heng Sin
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ public class WZoomAcross implements EventListener
|
|||
log.config("TableName=" + tableName + " - " + query);
|
||||
m_tableName = tableName;
|
||||
m_query = query;
|
||||
|
||||
|
||||
// See What is there
|
||||
getZoomTargets (invoker, tableName);
|
||||
} // AReport
|
||||
|
@ -82,7 +82,7 @@ public class WZoomAcross implements EventListener
|
|||
{
|
||||
String sql = "SELECT DISTINCT ws.AD_Window_ID,ws.Name, wp.AD_Window_ID,wp.Name, t.TableName "
|
||||
+ "FROM AD_Table t ";
|
||||
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Window");
|
||||
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Window");
|
||||
if (baseLanguage)
|
||||
sql += "INNER JOIN AD_Window ws ON (t.AD_Window_ID=ws.AD_Window_ID)"
|
||||
+ " LEFT OUTER JOIN AD_Window wp ON (t.PO_Window_ID=wp.AD_Window_ID) ";
|
||||
|
@ -145,7 +145,7 @@ public class WZoomAcross implements EventListener
|
|||
else if (invoker.isShowing())
|
||||
m_popup.show(invoker, 0, invoker.getHeight()); // below button
|
||||
*/
|
||||
|
||||
|
||||
// No Zoom
|
||||
if (m_list.size() == 0)
|
||||
{
|
||||
|
@ -155,9 +155,9 @@ public class WZoomAcross implements EventListener
|
|||
}
|
||||
m_popup.setPage(invoker.getPage());
|
||||
m_popup.open(invoker);
|
||||
|
||||
|
||||
//End - afalcone - Bug Fix [ 1659420 ] Usability: zoom across
|
||||
|
||||
|
||||
} // getZoomTargets
|
||||
|
||||
/**
|
||||
|
@ -168,7 +168,7 @@ public class WZoomAcross implements EventListener
|
|||
* @param isSO has po/so Window
|
||||
* @return true if there is a record
|
||||
*/
|
||||
private boolean addTarget (String targetTableName,
|
||||
private boolean addTarget (String targetTableName,
|
||||
int AD_Window_ID, String Name, Boolean isSO)
|
||||
{
|
||||
String key = targetTableName + AD_Window_ID + Name + isSO;
|
||||
|
@ -176,7 +176,7 @@ public class WZoomAcross implements EventListener
|
|||
return false;
|
||||
else
|
||||
m_targets.add(key);
|
||||
|
||||
|
||||
String sql = "SELECT COUNT(*) FROM " + targetTableName
|
||||
+ " WHERE " + m_query.getWhereClause(false);
|
||||
String sqlAdd = "";
|
||||
|
@ -185,9 +185,9 @@ public class WZoomAcross implements EventListener
|
|||
/*
|
||||
For RMA, Material Receipt window should be loaded for IsSOTrx=true
|
||||
and Shipment for IsSOTrx=false
|
||||
*/
|
||||
|
||||
if (MRMA.Table_Name.equals(m_tableName) && (AD_Window_ID == 169
|
||||
*/
|
||||
|
||||
if (MRMA.Table_Name.equals(m_tableName) && (AD_Window_ID == 169
|
||||
|| AD_Window_ID == 184))
|
||||
{
|
||||
isSO = !isSO;
|
||||
|
@ -200,7 +200,6 @@ public class WZoomAcross implements EventListener
|
|||
if (count <= 0)
|
||||
return false;
|
||||
//
|
||||
System.err.println("AD_Window_ID=" + AD_Window_ID + " targetTable=" + targetTableName + " Name="+Name + " Count=" + count);
|
||||
KeyNamePair pp = new KeyNamePair (AD_Window_ID, Name + " (#"+count+")");
|
||||
m_list.add(pp);
|
||||
Menuitem menuItem = new Menuitem(pp.toString());
|
||||
|
@ -209,7 +208,7 @@ public class WZoomAcross implements EventListener
|
|||
m_query.setRecordCount(count);
|
||||
return true;
|
||||
} // checkTarget
|
||||
|
||||
|
||||
/**
|
||||
* Launch Zoom
|
||||
* @param pp KeyPair
|
||||
|
@ -234,5 +233,5 @@ public class WZoomAcross implements EventListener
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // AZoom
|
||||
|
|
|
@ -421,11 +421,12 @@ public final class AEnv
|
|||
|
||||
log.config(sqlRolePermission);
|
||||
PreparedStatement prolestmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
prolestmt = DB.prepareStatement (sqlRolePermission, null);
|
||||
|
||||
ResultSet rs = prolestmt.executeQuery ();
|
||||
rs = prolestmt.executeQuery ();
|
||||
|
||||
rs.next();
|
||||
|
||||
|
@ -437,28 +438,14 @@ public final class AEnv
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
rs.close ();
|
||||
prolestmt.close ();
|
||||
prolestmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println(e);
|
||||
log.log(Level.SEVERE, "(1)", e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (prolestmt != null)
|
||||
{
|
||||
prolestmt.close ();
|
||||
}
|
||||
prolestmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
prolestmt = null;
|
||||
log.log(Level.SEVERE, "(1)", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, prolestmt);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -52,9 +52,9 @@ import org.zkoss.zul.event.ZulEvents;
|
|||
public class GridPanel extends Borderlayout implements EventListener
|
||||
{
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6786512082202412891L;
|
||||
private static final long serialVersionUID = -8735897196875342427L;
|
||||
|
||||
private static final int MIN_COLUMN_WIDTH = 100;
|
||||
|
||||
|
@ -551,11 +551,13 @@ public class GridPanel extends Borderlayout implements EventListener
|
|||
/**
|
||||
* Handle enter key event
|
||||
*/
|
||||
public void onEnterKey() {
|
||||
public boolean onEnterKey() {
|
||||
if (!modeless && renderer != null && !renderer.isEditing()) {
|
||||
renderer.editCurrentRow();
|
||||
renderer.setFocusToEditor();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setFocusToField(String columnName) {
|
||||
|
|
|
@ -116,7 +116,12 @@ public class WDateEditor extends WEditor
|
|||
{
|
||||
newValue = new Timestamp(date.getTime());
|
||||
}
|
||||
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
|
|
|
@ -108,7 +108,12 @@ public class WDatetimeEditor extends WEditor
|
|||
{
|
||||
newValue = new Timestamp(date.getTime());
|
||||
}
|
||||
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
|
|
|
@ -31,50 +31,54 @@ import org.zkoss.zk.ui.event.Events;
|
|||
import org.zkoss.zul.Fileupload;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Low Heng Sin
|
||||
*
|
||||
*/
|
||||
public class WFilenameEditor extends WEditor
|
||||
public class WFilenameEditor extends WEditor
|
||||
{
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE};
|
||||
|
||||
|
||||
private static final CLogger log = CLogger.getCLogger(WFilenameEditor.class);
|
||||
|
||||
public WFilenameEditor(GridField gridField)
|
||||
|
||||
private String oldValue;
|
||||
|
||||
public WFilenameEditor(GridField gridField)
|
||||
{
|
||||
super(new FilenameBox(), gridField);
|
||||
getComponent().setButtonImage("/images/Open16.png");
|
||||
getComponent().addEventListener(Events.ON_CLICK, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilenameBox getComponent()
|
||||
|
||||
@Override
|
||||
public FilenameBox getComponent()
|
||||
{
|
||||
return (FilenameBox) component;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object value)
|
||||
public void setValue(Object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
oldValue = null;
|
||||
getComponent().setText("");
|
||||
}
|
||||
else
|
||||
{
|
||||
getComponent().setText(String.valueOf(value));
|
||||
oldValue = String.valueOf(value);
|
||||
getComponent().setText(oldValue);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue()
|
||||
public Object getValue()
|
||||
{
|
||||
return getComponent().getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplay()
|
||||
public String getDisplay()
|
||||
{
|
||||
return getComponent().getText();
|
||||
}
|
||||
|
@ -89,19 +93,26 @@ public class WFilenameEditor extends WEditor
|
|||
getComponent().setEnabled(readWrite);
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (Events.ON_CHANGE.equals(event.getName()))
|
||||
{
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), getComponent().getText(), getComponent().getText());
|
||||
String newValue = getComponent().getText();
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
fireValueChange(changeEvent);
|
||||
}
|
||||
else if (Events.ON_CLICK.equals(event.getName()))
|
||||
{
|
||||
cmd_file();
|
||||
cmd_file();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load file
|
||||
*/
|
||||
|
@ -109,23 +120,23 @@ public class WFilenameEditor extends WEditor
|
|||
{
|
||||
// Show File Open Dialog
|
||||
Media file = null;
|
||||
|
||||
try
|
||||
|
||||
try
|
||||
{
|
||||
file = Fileupload.get(true);
|
||||
|
||||
file = Fileupload.get(true);
|
||||
|
||||
if (file == null)
|
||||
return;
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
log.warning(e.getLocalizedMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// String fileName = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + ;
|
||||
// File tempFile = new File(fileName);
|
||||
|
||||
|
||||
FileOutputStream fos = null;
|
||||
String fileName = null;
|
||||
try {
|
||||
|
@ -153,18 +164,18 @@ public class WFilenameEditor extends WEditor
|
|||
} catch (IOException e) {
|
||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||
return;
|
||||
} finally {
|
||||
} finally {
|
||||
if (fos != null)
|
||||
try {
|
||||
fos.close();
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
|
||||
getComponent().setText(fileName);
|
||||
getComponent().setText(fileName);
|
||||
} // cmd_file
|
||||
|
||||
|
||||
public String[] getEvents()
|
||||
{
|
||||
return LISTENER_EVENTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.zkoss.zk.ui.event.Events;
|
|||
*/
|
||||
public class WNumberEditor extends WEditor
|
||||
{
|
||||
public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE,Events.ON_BLUR};
|
||||
public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE};
|
||||
|
||||
public static final int MAX_DISPLAY_LENGTH = 20;
|
||||
|
||||
|
@ -118,8 +118,7 @@ public class WNumberEditor extends WEditor
|
|||
*/
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (Events.ON_CHANGE.equalsIgnoreCase(event.getName())
|
||||
|| Events.ON_BLUR.equalsIgnoreCase(event.getName()))
|
||||
if (Events.ON_CHANGE.equalsIgnoreCase(event.getName()))
|
||||
{
|
||||
BigDecimal newValue = getComponent().getValue();
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
|
|
|
@ -32,14 +32,14 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.Events;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Low Heng Sin
|
||||
*
|
||||
*/
|
||||
public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
||||
{
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE};
|
||||
|
||||
|
||||
private static final CLogger log = CLogger.getCLogger(WPAttributeEditor.class);
|
||||
|
||||
private int m_WindowNo;
|
||||
|
@ -47,49 +47,49 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
private Lookup m_mPAttribute;
|
||||
|
||||
private int m_C_BPartner_ID;
|
||||
|
||||
|
||||
private WEditorPopupMenu popupMenu;
|
||||
|
||||
private Object m_value;
|
||||
|
||||
private GridTab m_GridTab;
|
||||
|
||||
|
||||
/** No Instance Key */
|
||||
private static Integer NO_INSTANCE = new Integer(0);
|
||||
|
||||
public WPAttributeEditor(GridTab gridTab, GridField gridField)
|
||||
|
||||
public WPAttributeEditor(GridTab gridTab, GridField gridField)
|
||||
{
|
||||
super(new PAttributebox(), gridField);
|
||||
m_GridTab = gridTab;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
|
||||
private void initComponents() {
|
||||
getComponent().setButtonImage("images/PAttribute10.png");
|
||||
getComponent().addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
|
||||
m_WindowNo = gridField.getWindowNo();
|
||||
m_mPAttribute = gridField.getLookup();
|
||||
m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_BPartner_ID");
|
||||
|
||||
|
||||
// Popup
|
||||
popupMenu = new WEditorPopupMenu(true, false, false);
|
||||
getComponent().getTextbox().setContext(popupMenu.getId());
|
||||
getComponent().getTextbox().setContext(popupMenu.getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WEditorPopupMenu getPopupMenu() {
|
||||
return popupMenu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PAttributebox getComponent()
|
||||
@Override
|
||||
public PAttributebox getComponent()
|
||||
{
|
||||
return (PAttributebox) component;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object value)
|
||||
public void setValue(Object value)
|
||||
{
|
||||
if (value == null || NO_INSTANCE.equals(value))
|
||||
{
|
||||
|
@ -97,9 +97,9 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
m_value = value;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The same
|
||||
if (value.equals(m_value))
|
||||
if (value.equals(m_value))
|
||||
return;
|
||||
// new value
|
||||
log.fine("Value=" + value);
|
||||
|
@ -108,30 +108,44 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object getValue()
|
||||
public Object getValue()
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplay()
|
||||
public String getDisplay()
|
||||
{
|
||||
return getComponent().getText();
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (Events.ON_CHANGE.equals(event.getName()))
|
||||
{
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), getComponent().getText(), getComponent().getText());
|
||||
String newText = getComponent().getText();
|
||||
String oldText = null;
|
||||
if (m_value != null)
|
||||
{
|
||||
oldText = m_mPAttribute.getDisplay(m_value);
|
||||
}
|
||||
if (oldText != null && newText != null && oldText.equals(newText))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (oldText == null && newText == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldText, newText);
|
||||
fireValueChange(changeEvent);
|
||||
}
|
||||
else if (Events.ON_CLICK.equals(event.getName()))
|
||||
{
|
||||
cmd_dialog();
|
||||
cmd_dialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Start dialog
|
||||
*/
|
||||
|
@ -147,13 +161,13 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
log.config("M_Product_ID=" + M_Product_ID + "/" + M_ProductBOM_ID
|
||||
+ ",M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID
|
||||
+ ", AD_Column_ID=" + gridField.getAD_Column_ID());
|
||||
|
||||
|
||||
// M_Product.M_AttributeSetInstance_ID = 8418
|
||||
boolean productWindow = (gridField.getAD_Column_ID() == 8418); // HARDCODED
|
||||
|
||||
|
||||
// Exclude ability to enter ASI
|
||||
boolean exclude = true;
|
||||
|
||||
|
||||
if (M_Product_ID != 0)
|
||||
{
|
||||
MProduct product = MProduct.get(Env.getCtx(), M_Product_ID);
|
||||
|
@ -164,11 +178,11 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
exclude = mas.excludeEntry(gridField.getAD_Column_ID(), Env.isSOTrx(Env.getCtx(), m_WindowNo));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean changed = false;
|
||||
if (M_ProductBOM_ID != 0) // Use BOM Component
|
||||
M_Product_ID = M_ProductBOM_ID;
|
||||
//
|
||||
//
|
||||
if (!productWindow && (M_Product_ID == 0 || exclude))
|
||||
{
|
||||
changed = true;
|
||||
|
@ -177,7 +191,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
}
|
||||
else
|
||||
{
|
||||
WPAttributeDialog vad = new WPAttributeDialog (
|
||||
WPAttributeDialog vad = new WPAttributeDialog (
|
||||
M_AttributeSetInstance_ID, M_Product_ID, m_C_BPartner_ID,
|
||||
productWindow, gridField.getAD_Column_ID(), m_WindowNo);
|
||||
if (vad.isChanged())
|
||||
|
@ -203,7 +217,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
// Get Attribute Set
|
||||
MAttributeSet as = masi.getMAttributeSet();
|
||||
// Product has no Attribute Set
|
||||
if (as == null)
|
||||
if (as == null)
|
||||
ADialog.error(m_WindowNo, this, "PAttributeNoAttributeSet");
|
||||
// Product has no Instance Attributes
|
||||
else if (!as.isInstanceAttribute())
|
||||
|
@ -214,7 +228,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
int M_Locator_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_Locator_ID");
|
||||
String title = "";
|
||||
PAttributeInstance pai = new PAttributeInstance (
|
||||
Env.getFrame(this), title,
|
||||
Env.getFrame(this), title,
|
||||
M_Warehouse_ID, M_Locator_ID, M_Product_ID, m_C_BPartner_ID);
|
||||
if (pai.getM_AttributeSetInstance_ID() != -1)
|
||||
{
|
||||
|
@ -226,7 +240,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
}
|
||||
}
|
||||
**/
|
||||
|
||||
|
||||
// Set Value
|
||||
if (changed)
|
||||
{
|
||||
|
@ -236,22 +250,22 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
setValue(null);
|
||||
else
|
||||
setValue(new Integer(M_AttributeSetInstance_ID));
|
||||
|
||||
|
||||
ValueChangeEvent vce = new ValueChangeEvent(this, gridField.getColumnName(), new Object(), getValue());
|
||||
fireValueChange(vce);
|
||||
if (M_AttributeSetInstance_ID == oldValueInt && m_GridTab != null && gridField != null)
|
||||
{
|
||||
// force Change - user does not realize that embedded object is already saved.
|
||||
m_GridTab.processFieldChange(gridField);
|
||||
m_GridTab.processFieldChange(gridField);
|
||||
}
|
||||
} // change
|
||||
} // change
|
||||
} // cmd_file
|
||||
|
||||
|
||||
public String[] getEvents()
|
||||
{
|
||||
return LISTENER_EVENTS;
|
||||
}
|
||||
|
||||
|
||||
public void onMenu(ContextMenuEvent evt)
|
||||
{
|
||||
if (WEditorPopupMenu.ZOOM_EVENT.equals(evt.getContextEvent()))
|
||||
|
@ -259,7 +273,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
actionZoom();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void actionZoom()
|
||||
{
|
||||
AEnv.actionZoom(m_mPAttribute, getValue());
|
||||
|
@ -274,6 +288,6 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
public void setReadWrite(boolean readWrite) {
|
||||
getComponent().setEnabled(readWrite);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -48,32 +48,32 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
private static final String EDITOR_EVENT = "EDITOR";
|
||||
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE};
|
||||
|
||||
private String oldText;
|
||||
|
||||
|
||||
private String oldValue;
|
||||
|
||||
private WEditorPopupMenu popupMenu;
|
||||
|
||||
|
||||
private boolean tableEditor = false;
|
||||
|
||||
|
||||
/**
|
||||
* to ease porting of swing form
|
||||
*/
|
||||
public WStringEditor()
|
||||
public WStringEditor()
|
||||
{
|
||||
this("String", false, false, true, 30, 30, "", null);
|
||||
}
|
||||
|
||||
|
||||
public WStringEditor(GridField gridField) {
|
||||
this(gridField, false);
|
||||
}
|
||||
|
||||
|
||||
public WStringEditor(GridField gridField, boolean tableEditor)
|
||||
{
|
||||
super(gridField.isAutocomplete() ? new Combobox() : new Textbox(), gridField);
|
||||
this.tableEditor = tableEditor;
|
||||
init(gridField.getObscureType());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* to ease porting of swing form
|
||||
* @param columnName
|
||||
|
@ -89,15 +89,15 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
int displayLength, int fieldLength, String vFormat, String obscureType)
|
||||
{
|
||||
super(new Textbox(), columnName, null, null, mandatory, isReadOnly,isUpdateable);
|
||||
|
||||
|
||||
init(obscureType);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public org.zkoss.zul.Textbox getComponent() {
|
||||
return (org.zkoss.zul.Textbox) component;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isReadWrite() {
|
||||
return !getComponent().isReadonly();
|
||||
|
@ -107,7 +107,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
public void setReadWrite(boolean readWrite) {
|
||||
getComponent().setReadonly(!readWrite);
|
||||
}
|
||||
|
||||
|
||||
private void init(String obscureType)
|
||||
{
|
||||
if (gridField != null)
|
||||
|
@ -118,8 +118,8 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
{
|
||||
displayLength = MAX_DISPLAY_LENGTH;
|
||||
}
|
||||
getComponent().setCols(displayLength);
|
||||
|
||||
getComponent().setCols(displayLength);
|
||||
|
||||
if (!tableEditor)
|
||||
{
|
||||
if (gridField.getDisplayType() == DisplayType.Text)
|
||||
|
@ -138,18 +138,18 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
getComponent().setRows(8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (getComponent() instanceof Textbox)
|
||||
((Textbox)getComponent()).setObscureType(obscureType);
|
||||
|
||||
|
||||
popupMenu = new WEditorPopupMenu(false, false, true);
|
||||
Menuitem editor = new Menuitem(Msg.getMsg(Env.getCtx(), "Editor"), "images/Editor16.png");
|
||||
editor.setAttribute("EVENT", EDITOR_EVENT);
|
||||
editor.addEventListener(Events.ON_CLICK, popupMenu);
|
||||
popupMenu.appendChild(editor);
|
||||
|
||||
|
||||
getComponent().setContext(popupMenu.getId());
|
||||
|
||||
|
||||
if (gridField.isAutocomplete()) {
|
||||
Combobox combo = (Combobox)getComponent();
|
||||
combo.setAutodrop(true);
|
||||
|
@ -158,7 +158,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
List<String> items = gridField.getEntries();
|
||||
for(String s : items) {
|
||||
combo.appendItem(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,11 +167,17 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
{
|
||||
if (Events.ON_CHANGE.equals(event.getName()))
|
||||
{
|
||||
String newText = getComponent().getValue();
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldText, newText);
|
||||
String newValue = getComponent().getValue();
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldText = newText;
|
||||
}
|
||||
oldValue = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -197,9 +203,9 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
{
|
||||
getComponent().setValue("");
|
||||
}
|
||||
oldText = getComponent().getValue();
|
||||
oldValue = getComponent().getValue();
|
||||
}
|
||||
|
||||
|
||||
protected void setTypePassword(boolean password)
|
||||
{
|
||||
if (password)
|
||||
|
@ -211,38 +217,38 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
getComponent().setType("text");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String[] getEvents()
|
||||
{
|
||||
return LISTENER_EVENTS;
|
||||
}
|
||||
|
||||
|
||||
public WEditorPopupMenu getPopupMenu()
|
||||
{
|
||||
return popupMenu;
|
||||
}
|
||||
|
||||
public void onMenu(ContextMenuEvent evt)
|
||||
|
||||
public void onMenu(ContextMenuEvent evt)
|
||||
{
|
||||
if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent()))
|
||||
{
|
||||
if (MRole.getDefault().isShowPreference())
|
||||
ValuePreference.start (this.getGridField(), getValue());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (EDITOR_EVENT.equals(evt.getContextEvent()))
|
||||
{
|
||||
WTextEditorDialog dialog = new WTextEditorDialog(this.getColumnName(), getDisplay(),
|
||||
WTextEditorDialog dialog = new WTextEditorDialog(this.getColumnName(), getDisplay(),
|
||||
isReadWrite(), gridField.getFieldLength());
|
||||
dialog.setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
|
||||
SessionManager.getAppDesktop().showWindow(dialog);
|
||||
if (!dialog.isCancelled()) {
|
||||
getComponent().setText(dialog.getText());
|
||||
String newText = getComponent().getValue();
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldText, newText);
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newText);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldText = newText;
|
||||
oldValue = newText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -259,9 +265,9 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
for(String s : items) {
|
||||
combo.appendItem(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -100,6 +100,12 @@ public class WTimeEditor extends WEditor
|
|||
newValue = new Timestamp(date.getTime());
|
||||
}
|
||||
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
|
|
|
@ -25,42 +25,45 @@ import org.compiere.util.Env;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
||||
public class WUrlEditor extends WEditor
|
||||
public class WUrlEditor extends WEditor
|
||||
{
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE};
|
||||
|
||||
public WUrlEditor(GridField gridField)
|
||||
private String oldValue;
|
||||
|
||||
public WUrlEditor(GridField gridField)
|
||||
{
|
||||
super(new Urlbox(), gridField);
|
||||
getComponent().setButtonImage("/images/Online10.png");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setValue(Object value)
|
||||
public void setValue(Object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
oldValue = null;
|
||||
getComponent().setText("");
|
||||
}
|
||||
else
|
||||
{
|
||||
getComponent().setText(String.valueOf(value));
|
||||
oldValue = String.valueOf(value);
|
||||
getComponent().setText(oldValue);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue()
|
||||
public Object getValue()
|
||||
{
|
||||
return getComponent().getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplay()
|
||||
public String getDisplay()
|
||||
{
|
||||
return getComponent().getText();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Urlbox getComponent() {
|
||||
return (Urlbox) component;
|
||||
|
@ -79,12 +82,20 @@ public class WUrlEditor extends WEditor
|
|||
}
|
||||
|
||||
|
||||
public void onEvent(Event event)
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (Events.ON_CHANGE.equals(event.getName()))
|
||||
{
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), getComponent().getText(), getComponent().getText());
|
||||
String newValue = getComponent().getText();
|
||||
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
if (oldValue == null && newValue == null) {
|
||||
return;
|
||||
}
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
}
|
||||
else if (Events.ON_CLICK.equals(event.getName()))
|
||||
{
|
||||
|
@ -103,14 +114,14 @@ public class WUrlEditor extends WEditor
|
|||
}
|
||||
}
|
||||
FDialog.warn(0, this.getComponent(), "URLnotValid", message);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String[] getEvents()
|
||||
{
|
||||
return LISTENER_EVENTS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -56,19 +56,17 @@ import org.zkoss.zul.event.ListDataEvent;
|
|||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: VSortTab.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||
*
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* FR [ 1779410 ] VSortTab: display ID for not visible columns
|
||||
*
|
||||
*
|
||||
* Zk Port
|
||||
* @author Low Heng Sin
|
||||
*/
|
||||
public class ADSortTab extends Panel implements IADTabpanel
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3533927024365752586L;
|
||||
|
||||
private static final long serialVersionUID = 4289328613547509587L;
|
||||
private int m_AD_ColumnSortOrder_ID;
|
||||
|
||||
/**
|
||||
|
@ -111,7 +109,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
//
|
||||
SimpleListModel noModel = new SimpleListModel() {
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8261235952902938774L;
|
||||
|
||||
|
@ -135,7 +133,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
|
||||
private GridTab gridTab;
|
||||
private boolean uiCreated;
|
||||
|
||||
|
||||
/**
|
||||
* Dyanamic Init
|
||||
* @param AD_Table_ID Table No
|
||||
|
@ -237,7 +235,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
m_IdentifierSql = "NULL";
|
||||
else if (identifiersCount == 1)
|
||||
m_IdentifierSql = identifierSql.toString();
|
||||
else
|
||||
else
|
||||
m_IdentifierSql = identifierSql.insert(0, "COALESCE(").append(")").toString();
|
||||
//
|
||||
noLabel.setValue(Msg.getMsg(Env.getCtx(), "Available"));
|
||||
|
@ -253,31 +251,31 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
this.setStyle("height: 100%; width: 100%;");
|
||||
//
|
||||
noLabel.setValue("No");
|
||||
yesLabel.setValue("Yes");
|
||||
yesLabel.setValue("Yes");
|
||||
|
||||
yesList.setHeight("100%");
|
||||
noList.setHeight("100%");
|
||||
yesList.setVflex(true);
|
||||
noList.setVflex(true);
|
||||
|
||||
|
||||
EventListener mouseListener = new EventListener()
|
||||
{
|
||||
|
||||
public void onEvent(Event event) throws Exception
|
||||
public void onEvent(Event event) throws Exception
|
||||
{
|
||||
if (Events.ON_DOUBLE_CLICK.equals(event.getName()))
|
||||
{
|
||||
migrateValueAcrossLists(event);
|
||||
}
|
||||
migrateValueAcrossLists(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
yesList.addDoubleClickListener(mouseListener);
|
||||
noList.addDoubleClickListener(mouseListener);
|
||||
noList.addDoubleClickListener(mouseListener);
|
||||
//
|
||||
EventListener actionListener = new EventListener()
|
||||
{
|
||||
public void onEvent(Event event) throws Exception {
|
||||
migrateValueAcrossLists(event);
|
||||
migrateValueAcrossLists(event);
|
||||
}
|
||||
};
|
||||
yesList.setSeltype("multiple");
|
||||
|
@ -294,7 +292,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
noList.addOnDropListener(crossListMouseListener);
|
||||
yesList.setItemDraggable(true);
|
||||
noList.setItemDraggable(true);
|
||||
|
||||
|
||||
actionListener = new EventListener()
|
||||
{
|
||||
public void onEvent(Event event) throws Exception {
|
||||
|
@ -317,12 +315,12 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
ListItem startItem = (ListItem) me.getDragged();
|
||||
ListItem endItem = (ListItem) me.getTarget();
|
||||
if (startItem.getListbox() == endItem.getListbox() && startItem.getListbox() == yesList)
|
||||
{
|
||||
{
|
||||
int startIndex = yesList.getIndexOfItem(startItem);
|
||||
int endIndex = yesList.getIndexOfItem(endItem);
|
||||
Object endElement = yesModel.getElementAt(endIndex);
|
||||
Object element = yesModel.getElementAt(startIndex);
|
||||
yesModel.removeElement(element);
|
||||
yesModel.removeElement(element);
|
||||
endIndex = yesModel.indexOf(endElement);
|
||||
yesModel.add(endIndex, element);
|
||||
yesList.setSelectedIndex(endIndex);
|
||||
|
@ -333,23 +331,23 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
}
|
||||
setIsChanged(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
yesList.addOnDropListener(yesListMouseMotionListener);
|
||||
|
||||
|
||||
ListHead listHead = new ListHead();
|
||||
listHead.setParent(yesList);
|
||||
listHead.setParent(yesList);
|
||||
ListHeader listHeader = new ListHeader();
|
||||
listHeader.appendChild(yesLabel);
|
||||
listHeader.setParent(listHead);
|
||||
|
||||
|
||||
listHead = new ListHead();
|
||||
listHead.setParent(noList);
|
||||
listHead.setParent(noList);
|
||||
listHeader = new ListHeader();
|
||||
listHeader.appendChild(noLabel);
|
||||
listHeader.setParent(listHead);
|
||||
|
||||
|
||||
Span span = new Span();
|
||||
span.setParent(this);
|
||||
span.setStyle("height: 99%; display: inline-block; width: 40%;");
|
||||
|
@ -361,7 +359,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
span.setParent(this);
|
||||
span.setStyle("height: 99%; display: inline-block; width: 46px");
|
||||
span.appendChild(vbox);
|
||||
|
||||
|
||||
span = new Span();
|
||||
span.setParent(this);
|
||||
span.setStyle("height: 99%; display: inline-block; width: 40%");
|
||||
|
@ -408,7 +406,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
sql.append(" ORDER BY ");
|
||||
if (m_ColumnYesNoName != null)
|
||||
sql.append("6 DESC,"); // t.IsDisplayed DESC
|
||||
sql.append("3,2"); // t.SeqNo, tt.Name
|
||||
sql.append("3,2"); // t.SeqNo, tt.Name
|
||||
int ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, m_ParentColumnName);
|
||||
log.fine(sql.toString() + " - ID=" + ID);
|
||||
PreparedStatement pstmt = null;
|
||||
|
@ -430,7 +428,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
int AD_Org_ID = rs.getInt(5);
|
||||
if (m_ColumnYesNoName != null)
|
||||
isYes = rs.getString(6).equals("Y");
|
||||
|
||||
|
||||
//
|
||||
ListElement pp = new ListElement(key, name, seq, isYes, AD_Client_ID, AD_Org_ID);
|
||||
if (isYes)
|
||||
|
@ -460,7 +458,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
bDown.setEnabled(isReadWrite);
|
||||
yesList.setEnabled(isReadWrite);
|
||||
noList.setEnabled(isReadWrite);
|
||||
|
||||
|
||||
yesList.setItemRenderer(yesModel);
|
||||
yesList.setModel(yesModel);
|
||||
noList.setItemRenderer(noModel);
|
||||
|
@ -501,18 +499,18 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
selObjects.add(selObject);
|
||||
}
|
||||
for (ListElement selObject : selObjects)
|
||||
{
|
||||
{
|
||||
if (selObject == null || !selObject.isUpdateable())
|
||||
continue;
|
||||
|
||||
|
||||
lmFrom.removeElement(selObject);
|
||||
lmTo.addElement(selObject);
|
||||
|
||||
// Enable explicit Save
|
||||
setIsChanged(true);
|
||||
}
|
||||
|
||||
for (ListElement selObject : selObjects)
|
||||
|
||||
for (ListElement selObject : selObjects)
|
||||
{
|
||||
int index = lmTo.indexOf(selObject);
|
||||
listTo.setSelectedIndex(index);
|
||||
|
@ -682,14 +680,14 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
saveData();
|
||||
adWindowPanel = null;
|
||||
} // dispoase
|
||||
|
||||
|
||||
/**
|
||||
* List Item
|
||||
* @author Teo Sarca
|
||||
*/
|
||||
private class ListElement extends NamePair {
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5645910649588308798L;
|
||||
private int m_key;
|
||||
|
@ -700,7 +698,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
/** Initial selection flag */
|
||||
private boolean m_isYes;
|
||||
private boolean m_updateable;
|
||||
|
||||
|
||||
public ListElement(int key, String name, int sortNo, boolean isYes, int AD_Client_ID, int AD_Org_ID) {
|
||||
super(name);
|
||||
this.m_key = key;
|
||||
|
@ -708,7 +706,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
this.m_AD_Org_ID = AD_Org_ID;
|
||||
this.m_sortNo = sortNo;
|
||||
this.m_isYes = isYes;
|
||||
this.m_updateable = MRole.getDefault().canUpdate(m_AD_Client_ID, m_AD_Org_ID, m_AD_Table_ID, m_key, false);
|
||||
this.m_updateable = MRole.getDefault().canUpdate(m_AD_Client_ID, m_AD_Org_ID, m_AD_Table_ID, m_key, false);
|
||||
}
|
||||
public int getKey() {
|
||||
return m_key;
|
||||
|
@ -757,7 +755,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
}
|
||||
return false;
|
||||
} // equals
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String s = super.toString();
|
||||
|
@ -785,13 +783,13 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
if (event instanceof DropEvent)
|
||||
{
|
||||
DropEvent me = (DropEvent) event;
|
||||
|
||||
|
||||
ListItem endItem = (ListItem) me.getTarget();
|
||||
if (!(endItem.getListbox() == yesList))
|
||||
{
|
||||
return; // move within noList
|
||||
}
|
||||
|
||||
|
||||
ListItem startItem = (ListItem) me.getDragged();
|
||||
if (startItem.getListbox() == endItem.getListbox())
|
||||
{
|
||||
|
@ -800,12 +798,12 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
int startIndex = noList.getIndexOfItem(startItem);
|
||||
Object element = noModel.getElementAt(startIndex);
|
||||
noModel.removeElement(element);
|
||||
int endIndex = yesList.getIndexOfItem(endItem);
|
||||
int endIndex = yesList.getIndexOfItem(endItem);
|
||||
yesModel.add(endIndex, element);
|
||||
//
|
||||
noList.clearSelection();
|
||||
yesList.clearSelection();
|
||||
|
||||
|
||||
yesList.setSelectedIndex(endIndex);
|
||||
//
|
||||
setIsChanged(true);
|
||||
|
@ -828,7 +826,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
}
|
||||
uiCreated = true;
|
||||
uiCreated = true;
|
||||
}
|
||||
|
||||
public void dynamicDisplay(int i) {
|
||||
|
@ -879,7 +877,8 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
public void afterSave(boolean onSaveEvent) {
|
||||
}
|
||||
|
||||
public void onEnterKey() {
|
||||
public boolean onEnterKey() {
|
||||
return false;
|
||||
}
|
||||
} //ADSortTab
|
||||
|
||||
|
|
|
@ -94,10 +94,8 @@ import org.zkoss.zul.Treeitem;
|
|||
public class ADTabpanel extends Div implements Evaluatee, EventListener,
|
||||
DataStatusListener, IADTabpanel, VetoableChangeListener
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7422816988041118839L;
|
||||
|
||||
private static final long serialVersionUID = 6811039639239312863L;
|
||||
|
||||
private static final CLogger logger;
|
||||
|
||||
|
@ -1084,10 +1082,11 @@ DataStatusListener, IADTabpanel, VetoableChangeListener
|
|||
/**
|
||||
* @see IADTabpanel#onEnterKey()
|
||||
*/
|
||||
public void onEnterKey() {
|
||||
public boolean onEnterKey() {
|
||||
if (listPanel.isVisible()) {
|
||||
listPanel.onEnterKey();
|
||||
return listPanel.onEnterKey();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1111,7 +1110,6 @@ DataStatusListener, IADTabpanel, VetoableChangeListener
|
|||
if (!FDialog.ask(getWindowNo(), this, "SaveChanges?", gridTab.getCommitWarning()))
|
||||
{
|
||||
m_vetoActive = true;
|
||||
System.out.println("throw PropertyVetoException ");
|
||||
throw new PropertyVetoException ("UserDeniedSave", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ public class ADWindowPanel extends AbstractADWindowPanel
|
|||
keyListener.setCtrlKeys("#f1#f2#f3#f4#f5#f6#f7#f8#f9#f10#f11#f12^f^i^n^s^d@#left@#right@#up@#down@#pgup@#pgdn@p^p@z@x#enter");
|
||||
keyListener.addEventListener(Events.ON_CTRL_KEY, toolbar);
|
||||
keyListener.addEventListener(Events.ON_CTRL_KEY, this);
|
||||
keyListener.setAutoBlur(false);
|
||||
}
|
||||
|
||||
return layout;
|
||||
|
@ -218,10 +219,12 @@ public class ADWindowPanel extends AbstractADWindowPanel
|
|||
KeyEvent keyEvent = (KeyEvent) event;
|
||||
//enter == 13
|
||||
if (keyEvent.getKeyCode() == 13 && this.getComponent().getParent().isVisible()) {
|
||||
keyEvent.stopPropagation();
|
||||
IADTabpanel panel = adTab.getSelectedTabpanel();
|
||||
if (panel != null)
|
||||
panel.onEnterKey();
|
||||
if (panel != null) {
|
||||
if (panel.onEnterKey()) {
|
||||
keyEvent.stopPropagation();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.onEvent(event);
|
||||
|
|
|
@ -41,9 +41,9 @@ import org.zkoss.zul.Vbox;
|
|||
|
||||
public class HeaderPanel extends Panel implements EventListener
|
||||
{
|
||||
private static final long serialVersionUID = -4293371180738797244L;
|
||||
private static final long serialVersionUID = -2351317624519209484L;
|
||||
|
||||
private Image image = new Image();
|
||||
private Image image = new Image();
|
||||
|
||||
public HeaderPanel()
|
||||
{
|
||||
|
@ -93,7 +93,6 @@ public class HeaderPanel extends Panel implements EventListener
|
|||
}
|
||||
|
||||
public void onEvent(Event event) throws Exception {
|
||||
System.out.println(event.getTarget());
|
||||
if (Events.ON_CLICK.equals(event.getName())) {
|
||||
if(event.getTarget() == image)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ public interface IADTabpanel extends Component, Evaluatee {
|
|||
public boolean isCurrent();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return title
|
||||
*/
|
||||
public String getTitle();
|
||||
|
@ -50,7 +50,7 @@ public interface IADTabpanel extends Component, Evaluatee {
|
|||
public void createUI();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return GridTab
|
||||
*/
|
||||
public GridTab getGridTab();
|
||||
|
@ -85,7 +85,7 @@ public interface IADTabpanel extends Component, Evaluatee {
|
|||
public void switchRowPresentation();
|
||||
|
||||
/**
|
||||
* Dynamic update of field properties ( visibility, filter and mandatory )
|
||||
* Dynamic update of field properties ( visibility, filter and mandatory )
|
||||
* @param i
|
||||
*/
|
||||
public void dynamicDisplay(int i);
|
||||
|
@ -98,6 +98,7 @@ public interface IADTabpanel extends Component, Evaluatee {
|
|||
|
||||
/**
|
||||
* Enter key event
|
||||
* @return true if the event is process
|
||||
*/
|
||||
public void onEnterKey();
|
||||
public boolean onEnterKey();
|
||||
}
|
||||
|
|
|
@ -74,9 +74,7 @@ import org.zkoss.zul.Vbox;
|
|||
public final class WAccountDialog extends Window
|
||||
implements EventListener, DataStatusListener, ValueChangeListener
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = 7999516267209766287L;
|
||||
|
||||
/**
|
||||
|
@ -85,15 +83,15 @@ public final class WAccountDialog extends Window
|
|||
* @param mAccount account info
|
||||
* @param C_AcctSchema_ID as
|
||||
*/
|
||||
public WAccountDialog (String title,
|
||||
public WAccountDialog (String title,
|
||||
MAccountLookup mAccount, int C_AcctSchema_ID)
|
||||
{
|
||||
super ();
|
||||
this.setTitle(title);
|
||||
this.setHeight("500px");
|
||||
this.setWidth("700px");
|
||||
|
||||
log.config("C_AcctSchema_ID=" + C_AcctSchema_ID
|
||||
|
||||
log.config("C_AcctSchema_ID=" + C_AcctSchema_ID
|
||||
+ ", C_ValidCombination_ID=" + mAccount.C_ValidCombination_ID);
|
||||
m_mAccount = mAccount;
|
||||
m_C_AcctSchema_ID = C_AcctSchema_ID;
|
||||
|
@ -188,7 +186,7 @@ public final class WAccountDialog extends Window
|
|||
parameterPanel.setStyle("background-color: transparent;");
|
||||
toolBar.setOrient("vertical");
|
||||
toolBar.setStyle("border: none; margin: 5px");
|
||||
|
||||
|
||||
bSave.setImage("images/Save24.png");
|
||||
bSave.setTooltiptext(Msg.getMsg(Env.getCtx(),"AccountNewUpdate"));
|
||||
bSave.addEventListener(Events.ON_CLICK, this);
|
||||
|
@ -203,14 +201,14 @@ public final class WAccountDialog extends Window
|
|||
toolBar.appendChild(bIgnore);
|
||||
toolBar.appendChild(bSave);
|
||||
//
|
||||
|
||||
|
||||
northPanel.appendChild(parameterPanel);
|
||||
parameterPanel.setWidth("95%");
|
||||
northPanel.appendChild(toolBar);
|
||||
northPanel.setWidth("100%");
|
||||
|
||||
|
||||
m_adTabPanel = new ADTabpanel();
|
||||
|
||||
|
||||
Borderlayout layout = new Borderlayout();
|
||||
layout.setParent(this);
|
||||
if (AEnv.isFirefox2())
|
||||
|
@ -226,19 +224,19 @@ public final class WAccountDialog extends Window
|
|||
layout.setWidth("100%");
|
||||
layout.setStyle("background-color: transparent;");
|
||||
}
|
||||
|
||||
|
||||
North nRegion = new North();
|
||||
nRegion.setParent(layout);
|
||||
nRegion.setFlex(false);
|
||||
nRegion.appendChild(northPanel);
|
||||
nRegion.setStyle("background-color: transparent; border: none");
|
||||
northPanel.setStyle("background-color: transparent;");
|
||||
|
||||
|
||||
Center cRegion = new Center();
|
||||
cRegion.setParent(layout);
|
||||
cRegion.appendChild(m_adTabPanel);
|
||||
cRegion.setFlex(true);
|
||||
|
||||
|
||||
South sRegion = new South();
|
||||
sRegion.setParent(layout);
|
||||
Div div = new Div();
|
||||
|
@ -247,13 +245,13 @@ public final class WAccountDialog extends Window
|
|||
div.appendChild(statusBar);
|
||||
sRegion.appendChild(div);
|
||||
sRegion.setStyle("background-color: transparent; border: none");
|
||||
|
||||
|
||||
confirmPanel.addActionListener(Events.ON_CLICK, this);
|
||||
|
||||
|
||||
this.setBorder("normal");
|
||||
this.setClosable(false);
|
||||
this.setAttribute("modal", Boolean.TRUE);
|
||||
|
||||
|
||||
this.setSizable(true);
|
||||
} // jbInit
|
||||
|
||||
|
@ -274,8 +272,8 @@ public final class WAccountDialog extends Window
|
|||
Env.setContext(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", m_C_AcctSchema_ID);
|
||||
|
||||
// Model
|
||||
int AD_Window_ID = 153; // Maintain Account Combinations
|
||||
GridWindowVO wVO = AEnv.getMWindowVO (m_WindowNo, AD_Window_ID, 0);
|
||||
int AD_Window_ID = 153; // Maintain Account Combinations
|
||||
GridWindowVO wVO = AEnv.getMWindowVO (m_WindowNo, AD_Window_ID, 0);
|
||||
if (wVO == null)
|
||||
return false;
|
||||
m_mWindow = new GridWindow (wVO);
|
||||
|
@ -300,15 +298,15 @@ public final class WAccountDialog extends Window
|
|||
field.setDisplayed (false);
|
||||
}
|
||||
|
||||
// GridController
|
||||
m_adTabPanel.init(null, m_WindowNo, m_mTab, null);
|
||||
|
||||
// GridController
|
||||
m_adTabPanel.init(null, m_WindowNo, m_mTab, null);
|
||||
|
||||
// Prepare Parameter
|
||||
parameterLayout.makeNoStrip();
|
||||
parameterLayout.setOddRowSclass("even");
|
||||
parameterLayout.setParent(parameterPanel);
|
||||
parameterLayout.setStyle("background-color: transparent;");
|
||||
|
||||
|
||||
m_rows = new Rows();
|
||||
m_rows.setParent(parameterLayout);
|
||||
|
||||
|
@ -436,7 +434,7 @@ public final class WAccountDialog extends Window
|
|||
row.setSpans("4");
|
||||
row.setStyle("background-color: transparent;");
|
||||
m_rows.appendChild(row);
|
||||
|
||||
|
||||
// Finish
|
||||
m_query = new MQuery();
|
||||
m_query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID);
|
||||
|
@ -608,7 +606,7 @@ public final class WAccountDialog extends Window
|
|||
if (event.getTarget().getId().equals("Ok"))
|
||||
{
|
||||
m_changed = true;
|
||||
dispose();
|
||||
dispose();
|
||||
}
|
||||
else if (event.getTarget().getId().equals("Cancel"))
|
||||
{
|
||||
|
@ -622,9 +620,9 @@ public final class WAccountDialog extends Window
|
|||
action_Ignore();
|
||||
// all other
|
||||
else
|
||||
action_Find (true);
|
||||
action_Find (true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Status Change Listener
|
||||
* @param e event
|
||||
|
@ -635,8 +633,6 @@ public final class WAccountDialog extends Window
|
|||
String info = (String)m_mTab.getValue("Description");
|
||||
if (Executions.getCurrent() != null)
|
||||
f_Description.setValue (info);
|
||||
else
|
||||
System.err.println(info);
|
||||
} // statusChanged
|
||||
|
||||
|
||||
|
@ -893,7 +889,7 @@ public final class WAccountDialog extends Window
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if already exists
|
||||
*/
|
||||
|
@ -938,7 +934,7 @@ public final class WAccountDialog extends Window
|
|||
int i = 0;
|
||||
try
|
||||
{
|
||||
java.sql.PreparedStatement stmt = DB.prepareStatement(sql.toString(),
|
||||
java.sql.PreparedStatement stmt = DB.prepareStatement(sql.toString(),
|
||||
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, null);
|
||||
i = stmt.executeUpdate();
|
||||
stmt.close();
|
||||
|
@ -1000,13 +996,13 @@ public final class WAccountDialog extends Window
|
|||
if (f_User2_ID != null && !isEmpty(f_User2_ID.getValue()))
|
||||
User2_ID = ((Integer)f_User2_ID.getValue()).intValue();
|
||||
|
||||
MAccount acct = MAccount.get (Env.getCtx(), m_AD_Client_ID,
|
||||
MAccount acct = MAccount.get (Env.getCtx(), m_AD_Client_ID,
|
||||
((Integer)f_AD_Org_ID.getValue()).intValue(),
|
||||
s_AcctSchema.getC_AcctSchema_ID(),
|
||||
s_AcctSchema.getC_AcctSchema_ID(),
|
||||
((Integer)f_Account_ID.getValue()).intValue(), C_SubAcct_ID,
|
||||
M_Product_ID, C_BPartner_ID, AD_OrgTrx_ID,
|
||||
C_LocFrom_ID, C_LocTo_ID, C_SRegion_ID,
|
||||
C_Project_ID, C_Campaign_ID, C_Activity_ID,
|
||||
C_LocFrom_ID, C_LocTo_ID, C_SRegion_ID,
|
||||
C_Project_ID, C_Campaign_ID, C_Activity_ID,
|
||||
User1_ID, User2_ID, 0, 0);
|
||||
if (acct != null && acct.get_ID() == 0)
|
||||
acct.save();
|
||||
|
@ -1030,10 +1026,10 @@ public final class WAccountDialog extends Window
|
|||
private boolean isEmpty(Object value) {
|
||||
if (value == null)
|
||||
return true;
|
||||
|
||||
|
||||
if (value instanceof String)
|
||||
return ((String)value).trim().length() == 0;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue