From: Jorg J. <jj...@us...> - 2003-03-20 06:51:03
|
Update of /cvsroot/compiere/client/Src/org/compiere/apps In directory sc8-pr-cvs1:/tmp/cvs-serv6723/Src/org/compiere/apps Modified Files: APanel.java Log Message: . Index: APanel.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/apps/APanel.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** APanel.java 14 Mar 2003 06:10:13 -0000 1.69 --- APanel.java 20 Mar 2003 06:50:58 -0000 1.70 *************** *** 1315,1321 **** boolean startWOasking = false; - String col = vButton.getColumnName(); // Pop up Payment Rules if (col.equals("PaymentRule")) --- 1315,1373 ---- boolean startWOasking = false; String col = vButton.getColumnName(); + // Zoom + if (col.equals("Record_ID")) + { + int AD_Table_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Table_ID"); + int Record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "Record_ID"); + String IsSOTrx = Env.getContext(m_ctx, m_curWindowNo, "IsSOTrx"); + // + String TableName = null; + int AD_Window_ID = 0; + String sql = "SELECT TableName, AD_Window_ID FROM AD_Table WHERE AD_Table_ID=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql); + pstmt.setInt(1, AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + TableName = rs.getString(1); + AD_Window_ID = rs.getInt(2); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + Log.error ("GridController.startProcess-Zoom", e); + } + // Nothing to Zoom to + if (TableName == null || AD_Window_ID == 0) + return; + + AWindow frame = new AWindow(); + if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID), IsSOTrx.equals("Y"))) + return; + AEnv.showCenterScreen(frame); + frame = null; + return; + } // Zoom + + + // save first --------------- + if (m_curTab.needSave(true, false)) + if (!cmd_save(true)) + return; + // + int record_ID = m_curTab.getCurrentKeyID(); + if (record_ID == -1) + { + ADialog.error(m_curWindowNo, this, "SaveErrorRowNotFound"); + return; + } + + // Pop up Payment Rules if (col.equals("PaymentRule")) *************** *** 1334,1338 **** if (vda.getNumberOfOptions() == 0) { ! vda.dispose(); return; } --- 1386,1390 ---- if (vda.getNumberOfOptions() == 0) { ! vda.dispose (); return; } *************** *** 1350,1357 **** else if (col.equals("CreateFrom")) { - // save first - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; // m_curWindowNo VCreateFrom vcf = VCreateFrom.create (m_curTab); --- 1402,1405 ---- *************** *** 1363,1411 **** vcf.dispose(); m_curTab.dataRefresh(); - return; } else vcf.dispose(); } - } - - // Zoom - else if (col.equals("Record_ID")) - { - int AD_Table_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Table_ID"); - int Record_ID = Env.getContextAsInt (m_ctx, m_curWindowNo, "Record_ID"); - String IsSOTrx = Env.getContext(m_ctx, m_curWindowNo, "IsSOTrx"); - // - String TableName = null; - int AD_Window_ID = 0; - String sql = "SELECT TableName, AD_Window_ID FROM AD_Table WHERE AD_Table_ID=?"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql); - pstmt.setInt(1, AD_Table_ID); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - TableName = rs.getString(1); - AD_Window_ID = rs.getInt(2); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - Log.error ("GridController.startProcess-Zoom", e); - } - // Nothing to Zoom to - if (TableName == null || AD_Window_ID == 0) - return; - - AWindow frame = new AWindow(); - if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID), IsSOTrx.equals("Y"))) - return; - AEnv.showCenterScreen(frame); - frame = null; return; ! } // Zoom // Posting ----- --- 1411,1420 ---- vcf.dispose(); m_curTab.dataRefresh(); } else vcf.dispose(); } return; ! } // Posting ----- *************** *** 1420,1428 **** } - // save first - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; - // Check Post Status Object ps = m_curTab.getValue("Posted"); --- 1429,1432 ---- *************** *** 1448,1456 **** */ - // Save first - if (m_curTab.needSave(true, false)) - if (!cmd_save(true)) - return; - Log.trace(Log.l3_Util, "APanel.actionButton", "Process_ID=" + vButton.getProcess_ID()); if (vButton.getProcess_ID() == 0) --- 1452,1455 ---- *************** *** 1463,1467 **** return; // - int record_ID = m_curTab.getCurrentKeyID(); String title = vButton.getDescription(); if (title == null || title.length() == 0) --- 1462,1465 ---- |