home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / JDesignerPro / Jdp3_0.exe / data1.cab / Program_Files / Applications / Layouts / JDPLayout3.java < prev    next >
Encoding:
Text File  |  1999-04-09  |  19.6 KB  |  688 lines

  1. >XXX0619  Total lines for the build status message calculation
  2. //--------------------------------------------------------------------
  3. //                                                                    
  4. >001//  Module:       <JDPModule>                                       
  5. >002//  Description:  <Class Description>
  6. //                                                                    
  7. //--------------------------------------------------------------------
  8.  
  9. import java.awt.*;
  10. import java.applet.*;
  11. import java.util.*;
  12.  
  13.  
  14. >003public class <JDPUserBill> extends JDPClassLayout {
  15.  
  16.     JDPUser user;
  17.     JDPJagg jaggSQL;
  18.     JDPWhereClause jdpWhereClause;
  19.     JDPSearchResults searchResults;
  20.     JDPTextGrid tableContents;
  21.     JDPPopupMessage popuppanel;
  22.     JDPTabSelectPanel tabPanel;
  23.     JDPMaskEdit JDPMaskEditMain;
  24.  
  25.     String[] psortChoice;
  26.     String[] pdisplayChoice;
  27.     int itemIndex;
  28.     boolean insertRequested = false;
  29.     boolean deleteRequested = false;
  30.     String pfromWhereClause;
  31.     String[][] rowKey;
  32.     int totalRows;
  33.     int keyCount;
  34.     int prevColumnCount;
  35. >119    int columnCount = <columnCount>;
  36.  
  37.     Vector pmatchUsing;
  38.     Vector pactualmatchUsing;
  39.     //
  40.     //  Declare screen components
  41.     //
  42. >004    <TextField username>;
  43. >052    Vector value<name>;
  44.  
  45.  
  46.     public void InitClass(JDPUser user, Panel targetPanel, String moduleParameter) {
  47.  
  48.         this.user = user;
  49.         //
  50.         //  Set JAGG settings for this class
  51.         //
  52.         jaggSQL = new JDPJagg(user.jaggPath);
  53.         jaggSQL.setNULL("space");
  54. >997        jaggSQL.setMRW("<maxRows>");
  55. >998        jaggSQL.setDSN("<datasource>");
  56. >984        jaggSQL.setUID("<>");
  57. >985        jaggSQL.setPWD("<>");
  58.  
  59.         setLayout(new BorderLayout());
  60.         setFont(user.plainFont);
  61.          popuppanel = new JDPPopupMessage(user,targetPanel);
  62.         targetPanel.add(popuppanel);
  63.  
  64.         Panel mainPanel = new Panel();
  65.         mainPanel.setLayout(new BorderLayout());
  66.         Panel centerPanel = new Panel();
  67.         centerPanel.setLayout(new BorderLayout());
  68.         Panel centerMainPanel = new Panel();
  69.         centerMainPanel.setLayout(new GridLayout(2,1,1,1));
  70.         Panel centerBottomPanel = new Panel();
  71.         centerBottomPanel.setLayout(new BorderLayout());
  72.         Panel leftPanel = new Panel();
  73.         leftPanel.setLayout(new BorderLayout());
  74.         
  75.         //
  76.         //  Define parameters for JDPSearchResults
  77.         //
  78. >005        String pselectFields = "<>"; String[] psdisplayFields = {<>};
  79. >006        pfromWhereClause = "<FROM JDPUser WHERE >";
  80.  
  81. >007        psortChoice = new String[<5>];
  82. >008        psortChoice[<0>] = "<username>";
  83.  
  84. >009        String[] psortChoiceText = {<"Sort by User Name","Sort by Card Number">};
  85.         pdisplayChoice = psortChoice;
  86.  
  87. >010        boolean pdisplayCount = <true>;
  88. >011        String pcountText = "<Total Entries:>";
  89.     
  90.         //
  91.         //  Create an instance of screen components
  92.         //
  93. >012        <username> = new <TextField("",20)>;
  94.  
  95.         //
  96.         //  Add components to the screen
  97.         //
  98. >058        JDPScrollPanel[] centerTopPanel = new JDPScrollPanel[<>];
  99. >059        centerTopPanel[<>] = new JDPScrollPanel();
  100. >013        centerTopPanel[<>].add("Left",new JDPWrapLabel(user,"<User Name:>",Color.<labelColor>));
  101. >014        centerTopPanel[<>].add("Right",centerR<0>);
  102.  
  103.         if (centerTopPanel.length == 1) {
  104.             centerMainPanel.add(centerTopPanel[0]);
  105.         } else {
  106. >060            String[] titles = {<>};
  107.             tabPanel = new JDPTabSelectPanel(user,titles,centerTopPanel,"North");
  108.             centerMainPanel.add(tabPanel);
  109.         }
  110.         
  111.         // 
  112.         //  Set screen component attributes
  113.         //
  114. >039        <username>.setForeground(Color.<fcolor>);
  115. >040        <username>.setBackground(Color.<bcolor>);
  116. >048        popuppanel.addComponent(<>,"<>","<>");
  117.         
  118.         //
  119.         //  Create a new instance of a Grid
  120.         //
  121.         tableContents = new JDPTextGrid(user);
  122.         centerBottomPanel.add("Center",tableContents);
  123.         centerMainPanel.add(centerBottomPanel);
  124.         //
  125.         //  Add buttons to the bottom of the panel
  126.         //
  127.         if (moduleParameter.compareTo("Inquiry") == 0) {
  128. >041            <username>.setEditable(false);
  129.         } else {
  130. >042            <username>.setEditable(<editable>);
  131. >015            String buttons[] = {<"   Apply   ","Reset","New","Copy","Remove">};
  132. >047            int icons[] = {<>};
  133.             JDPButtons btns = new JDPButtons(user, buttons, icons, JDPButtons.HORIZONTAL);
  134.             centerBottomPanel.add("South",btns);
  135. >046            popuppanel.addComponent(btns.button[<0>],"<>","<>");
  136.         }
  137.         mainPanel.add("Center",centerMainPanel);
  138.         
  139.         //
  140.         //  Define parameters for JDPWhereClause
  141.         //
  142. >016        String[] pchooseFrom = new String[<7>];
  143. >017        pchooseFrom[<0>] = "<Account Name>";
  144.  
  145. >018        String[] pactualchooseFrom = new String[<7>];
  146. >019        pactualchooseFrom[<0>] = "<username>";
  147.  
  148.         loadMatchUsing();
  149.  
  150. >024        boolean[] constantIsString = new boolean[<7>];
  151. >025        constantIsString[<0>] = <true>;
  152.  
  153. >026        int[] constantLength = new int[<7>];
  154. >027        constantLength[<0>] = <20>;
  155.  
  156.         //
  157.         //  Initialise any choice components
  158.         //
  159.         loadChoices();
  160.  
  161.         //
  162.         //  Add JDPWhereClause search panel
  163.         //
  164.         if (pchooseFrom.length > 0) {
  165. >028            jdpWhereClause = new JDPWhereClause(user, targetPanel, "<UserBill>", true, "<pinitChoice>", pchooseFrom, pactualchooseFrom,
  166.                                                 pmatchUsing, pactualmatchUsing, null, null,
  167.                                                 constantLength, constantIsString);
  168.             leftPanel.add("North",jdpWhereClause);
  169.         }
  170.         //
  171.         //  Add JDPSearchResults result list
  172.         //
  173.         if (psortChoice.length > 0) {
  174. >029            searchResults = new JDPSearchResults(user, targetPanel, <true>, jaggSQL, <false>, pselectFields, psdisplayFields, pfromWhereClause, psortChoiceText, psortChoice, pdisplayChoice, "<pinitChoice>", pdisplayCount, pcountText);
  175. >055            int icons[] = {<>};
  176. >056            searchResults.setMinWidth(<>);
  177.             searchResults.setIcons(icons);
  178.             leftPanel.add("Center",searchResults);
  179.             mainPanel.add("West",leftPanel);
  180.         }
  181.  
  182. >030        add("Center",new JDPChiselFramePanel(user,"<User Billing Details>",mainPanel,"North"));
  183.         setGridSettings();
  184.         JDPMaskEditMain = new JDPMaskEdit();
  185.         if (psortChoice.length > 0) {
  186.             newSearch();
  187.         }
  188.         //
  189.         //  Add the handle to this panel to the global vector so other panels can
  190.         //  access this one
  191.         //
  192.         user.gParm.addElement(this);
  193.     }
  194.  
  195.     //
  196.     //  Handle screen events
  197.     //
  198.     public boolean handleEvent(Event e) {
  199.  
  200.         switch (e.id) {
  201.         case Event.ACTION_EVENT:
  202.             if (e.target instanceof List) {
  203.                 if (e.target.equals(searchResults.resultList)) {
  204.                     loadData();
  205.                     return true;
  206.                 }
  207.             }
  208.             if (e.target instanceof JDPTreePicker) {
  209.                 if (e.target.equals(searchResults.tree)) {
  210.                     loadData();
  211.                     return true;
  212.                 }
  213.             }
  214.             if (e.target instanceof Button) {
  215.                 String choice = (String)e.arg;
  216.                 if (choice.trim().compareTo("New") == 0) {
  217.                     clearFields(false);
  218.                     loadEmptyGrid();
  219.                     return true;
  220.                 }
  221.                 if (choice.trim().compareTo("Apply") == 0) {
  222.                     if (checkFields()) {
  223.                         checkRows();
  224.                     }
  225.                     return true;
  226.                 }
  227.                 if (choice.trim().compareTo("Reset") == 0) {
  228.                     loadGrid();
  229.                     return true;
  230.                 }
  231.                 if (choice.trim().compareTo("Remove") == 0) {
  232. >054                    String removeMsg = "<>";
  233.                     if (removeMsg.equals("") || user.mainmsg.getStatusMsg().equals(removeMsg)) {
  234.                         deleteRequested = true;
  235.                         checkRows();
  236.                     } else {
  237.                         user.mainmsg.setStatusMsg(removeMsg,15);
  238.                     }
  239.                     return true;
  240.                 }
  241.                 if (choice.trim().compareTo("Search") == 0) {
  242.                     newSearch();
  243.                     return true;
  244.                 }
  245.                 return true;
  246.             }
  247.             if (e.target instanceof Choice) {
  248.                 return true;
  249.             }
  250.             if (e.target instanceof TextField) {
  251.                 if ((jdpWhereClause != null) && (e.target.equals(jdpWhereClause.matchConstant))) {
  252.                     insertRequested = false;
  253.                     deleteRequested = false;
  254.                     newSearch();
  255.                     return true;
  256.                 }
  257.                 checkFields();
  258.                 return true;
  259.             }
  260.             return false;
  261.  
  262.         case Event.KEY_PRESS:
  263.             if (e.key == '\t') {
  264.                 //  handle tabbing between components
  265.                 if (e.modifiers != Event.SHIFT_MASK) {
  266. >031                    if (e.target.equals(<username>)) { user.u.cursor(<username>); return true; }
  267.                 } else {
  268. >038                    if (e.target.equals(<username>)) { user.u.cursor(<username>); return true; }
  269.                 }
  270.                 return true;
  271.             }
  272.             return false;
  273.  
  274.         case Event.KEY_RELEASE:
  275. >068            if (e.target.equals(<fieldname>)) JDPMaskEditMain.format<String>(<fieldname>,"<mask>");
  276. >069            if (e.target.equals(tableContents) && tableContents.getCurrentColumn() == <colNo>) JDPMaskEditMain.format<String>(tableContents,"<mask>");
  277.             return true;
  278.  
  279.         case Event.WINDOW_EXPOSE:
  280.             if (e.target instanceof JDPTabSelectPanel) {
  281.                 if (e.target.equals(user.jdpMenuPanel)) {
  282.                     //
  283.                     //  This is where you place code to get executed when this panel is
  284.                     //  reactivated from the tab menu
  285.                     //
  286.                     return true;
  287.                 }
  288.             }
  289.             return false;
  290.  
  291.           case Event.MOUSE_MOVE:
  292.          case Event.MOUSE_ENTER:
  293.          case Event.MOUSE_EXIT:
  294.             popuppanel.postEvent(e);
  295.             return false;
  296.  
  297.         default:
  298.             return false;
  299.  
  300.         }
  301.     }
  302.  
  303.     //
  304.     //  Retrieve the handle to another panel so as to be able to interact with it
  305.     //
  306.     public void retrieveHandle() {
  307.  
  308.         for (int ix=0; ix<user.gParm.size(); ix++) {
  309.             //
  310.             //  Activate the next four lines of code to retrieve the handle to another 
  311.             //  Panel within your JDP system. Of course you should declare the variable 
  312.             //  at the top of this source instead of within this method so you can 
  313.             //  access it from all the methods within this class. You only need to 
  314.             //  substitute DemoClass with the name ouf your class. You should call this 
  315.             //  method from somewhere else in this class. To access a variable from 
  316.             //  your resulting class use:
  317.             //     if (DemoClassHandle != null) mynewvar = demoClassHandle.variable;
  318.             //
  319. //            if (user.gParm.elementAt(ix) instanceof DemoClass19) {
  320. //                DemoClass19 DemoClassHandle = (DemoClass19)user.gParm.elementAt(ix);
  321. //                return;
  322. //            }
  323.         }
  324.     }
  325.  
  326.     //
  327.     //  The search button was pressed so rerun the query with the new search criteria
  328.     //
  329.     public void newSearch() {
  330.  
  331.         String whereClause;
  332.  
  333.         whereClause = pfromWhereClause;
  334.         if (jdpWhereClause != null) {
  335.             whereClause = whereClause + " AND " + jdpWhereClause.whereClause;
  336.         }
  337.         searchResults.setFromWhereClause(whereClause);
  338. >057        searchResults.clearList(<>);
  339.         searchResults.loadList();
  340.     }
  341.  
  342.     //
  343.     //  Load the selected item
  344.     //
  345.     public void loadData() {
  346.  
  347.         StringTokenizer stok;
  348.  
  349.         int recCount = 0;
  350.         Vector results = new Vector();
  351.         String sep = jaggSQL.getSEP();
  352.         int actualRows = 0;
  353.         String row;
  354.         String tempText;
  355.  
  356.         if ((itemIndex = searchResults.getSelectedIndex()) < 0) {
  357.             clearFields(true);
  358.             return;
  359.         }
  360.  
  361. >032        String SQL = <SELECT>;
  362.  
  363.         user.mainmsg.setStatusMsg("Accessing database...", 0);
  364.         recCount = jaggSQL.execSQL(SQL, results);
  365.  
  366.         if(recCount == -1) {
  367.             user.u.setSqlMessage(jaggSQL,SQL);
  368.             return;
  369.         }
  370.         if(recCount >= 1) {
  371.             row = (String)results.elementAt(0);
  372.             if ((row != null) && (row.trim().compareTo("") != 0)) {
  373.                 stok = new StringTokenizer(row,sep);
  374.  
  375. >033                <username>.setText(stok.nextToken().trim());
  376. >067                JDPMaskEditMain.format<String>(<fieldname>,"<mask>");
  377.             }
  378.             loadGrid();
  379. //            if(recCount > 1) {
  380. //                user.mainmsg.setStatusMsg("Multiple records found - first match only displayed.", 10);
  381. //            } else {
  382.                 user.mainmsg.clearStatusMsg();
  383. //            }
  384.         } else {
  385.             user.mainmsg.setStatusMsg("Requested entry does not exist.", 10);
  386.             clearFields(true);
  387.         }
  388.  
  389.     }
  390.  
  391.     //
  392.     //  Load the grid with the specified parameters and selected data
  393.     //
  394.     public void loadGrid() {
  395.  
  396.         StringTokenizer stok;
  397.         int recCount = 0;
  398.         Vector results = new Vector();
  399.         String sep = jaggSQL.getSEP();
  400.         int actualRows = 0;
  401.         String row;
  402.         String tempText;
  403.  
  404.         Vector columns = new Vector();
  405.         Vector indexes = new Vector();
  406.  
  407. >100        String SQL = <SELECT>;
  408.  
  409.         user.mainmsg.setStatusMsg("Accessing database...", 0);
  410.  
  411.         recCount = jaggSQL.execSQL(SQL, results);
  412.  
  413.         if(recCount == -1) {
  414.             user.u.setSqlMessage(jaggSQL,SQL);
  415.             return;
  416.         }
  417.  
  418.         //
  419.         //  If we haven't already initialise the grid settings
  420.         //
  421.         if (columnCount != prevColumnCount) {
  422.             prevColumnCount = columnCount;
  423.             setGridSettings();
  424.         }
  425.         //
  426.         //  Initialise result arrays
  427.         //
  428.         actualRows = jaggSQL.getRowCount()+20;
  429.         totalRows = jaggSQL.getRowCount();
  430.  
  431.         tableContents.currentText = new String[columnCount][actualRows];
  432.         tableContents.cellChanged = null;
  433.         tableContents.rowChanged = null;
  434.         tableContents.columnSelected = null;
  435. >120        keyCount = <keycount>;
  436.         rowKey = new String[actualRows][keyCount];
  437.         tableContents.recordLockValue = new String[actualRows];
  438.         
  439.         //
  440.         //  Load key array and grid array
  441.         //
  442.         for (int ix=0; ix<actualRows-20; ix++) {
  443.             row = (String)results.elementAt(ix);
  444.             if ((row != null) && (row.trim().compareTo("") != 0)) {
  445.                 stok = new StringTokenizer(row,sep);
  446. >162                tableContents.recordLockValue[ix] = stok.nextToken().trim();
  447.                 for (int iy=0; iy<keyCount; iy++) {
  448.                     rowKey[ix][iy] = stok.nextToken().trim();
  449.                 }
  450.                 for (int iy=0; iy<columnCount; iy++) {
  451.                     tempText = stok.nextToken().trim();
  452.                     tableContents.currentText[iy][ix] = tempText;
  453. >053                    if ((iy == <1>) && (value<field>.indexOf(tempText) >= 0)) tableContents.currentText[iy][ix] = tableContents.pullDownList[<1>][0].getItem(value<field>.indexOf(tempText));
  454. >069                    if (iy == <1>) JDPMaskEditMain.format<String>(tableContents,iy,ix,"<mask>");
  455.                 }
  456.             }
  457.         }
  458.  
  459.         tableContents.newTable();
  460.  
  461.         //
  462.         //  Clear status message
  463.         //
  464.         user.mainmsg.clearStatusMsg();
  465.     }
  466.  
  467.     //
  468.     //  Load the grid with the blank rows to allow data entry
  469.     //
  470.     public void loadEmptyGrid() {
  471.  
  472.         tableContents.currentText = new String[columnCount][50];
  473.         tableContents.cellChanged = null;
  474.         tableContents.rowChanged = null;
  475.         tableContents.columnSelected = null;
  476.         rowKey = new String[50][keyCount];
  477.         tableContents.newTable();
  478.         totalRows = 0;
  479.     }
  480.  
  481.     //
  482.     //  Set up the parameters for this grid
  483.     //
  484.     void setGridSettings() {
  485.  
  486.         tableContents.columnHeader = new String[columnCount];
  487.         tableContents.columnHeaderStyle = new int[columnCount];
  488.         tableContents.columnStyle = new int[columnCount];
  489.         tableContents.columnHeaderColor = new Color[columnCount];
  490.         tableContents.columnColor = new Color[columnCount];
  491.         tableContents.columnBGColor = new Color[columnCount];
  492.         tableContents.columnProtected = new boolean[columnCount];
  493.         tableContents.columnWidth = new int[columnCount];
  494.         tableContents.rightJustify = new boolean[columnCount];
  495.         tableContents.rowHeader = null;
  496.         tableContents.columnHeight = null;
  497.         for (int ix=0; ix<columnCount; ix++) {
  498.             tableContents.columnHeaderStyle[ix] = Font.BOLD;
  499.             tableContents.columnStyle[ix] = Font.PLAIN;
  500.             tableContents.columnHeaderColor[ix] = Color.black;
  501.             tableContents.columnColor[ix] = Color.black;
  502.             tableContents.columnBGColor[ix] = Color.white;
  503.             tableContents.columnStyle[ix] = Font.PLAIN;
  504.         }
  505. >101        tableContents.columnHeader[<ix>] = "<>";
  506. >102        tableContents.columnHeaderStyle[<ix>] = <>;
  507. >103        tableContents.columnStyle[<ix>] = <>;
  508. >104        tableContents.columnHeaderColor[<ix>] = user.u._cvtcolor("<>");
  509. >105        tableContents.columnColor[<ix>] = user.u._cvtcolor("<>");
  510. >106        tableContents.columnBGColor[<ix>] = user.u._cvtcolor("<>");
  511. >107        tableContents.columnProtected[<ix>] = <>;
  512. >108        tableContents.columnWidth[<ix>] = <>;
  513. >109        tableContents.rightJustify[<ix>] = <>;
  514.         loadEmptyGrid();
  515.     }
  516.  
  517.     //
  518.     //  The check each rows that has changed and issue an update to the database
  519.     //
  520.     public void checkRows() {
  521.  
  522.         int changedCount = 0;
  523.         int insertedCount = 0;
  524.         int deletedCount = 0;
  525.         int cCount = 1;
  526.         int iCount = 1;
  527.         boolean reload = false;
  528.         
  529.         for (int ix=0; ix<tableContents.rowChanged.length; ix++) {
  530.             if (deleteRequested && tableContents.rowSelected[ix]) {
  531.                 deletedCount++;
  532.             } else
  533.             if (tableContents.rowChanged[ix]) {
  534.                 if (ix >= totalRows) {
  535.                     insertedCount++;
  536.                 } else {
  537.                     changedCount++;
  538.                 }
  539.             }
  540.         }
  541.         for (int ix=0; ix<tableContents.rowChanged.length; ix++) {
  542.             if (deleteRequested && tableContents.rowSelected[ix]) {
  543.                 user.mainmsg.setStatusMsg("Deleting row " + Integer.toString(iCount++) + " of " + Integer.toString(deletedCount) + "...", 0);
  544.                 saveData(ix);
  545.             } else
  546.             if (tableContents.rowChanged[ix]) {
  547.                 insertRequested = false;
  548.                 if (ix >= totalRows) {
  549.                     insertRequested = true;
  550.                     user.mainmsg.setStatusMsg("Inserting row " + Integer.toString(iCount++) + " of " + Integer.toString(insertedCount) + "...", 0);
  551.                 } else {
  552.                     user.mainmsg.setStatusMsg("Updating row " + Integer.toString(cCount++) + " of " + Integer.toString(changedCount) + "...", 0);
  553.                 }
  554.                 if (saveData(ix)) {
  555.                     reload = true;
  556.                 }
  557.                 insertRequested = false;
  558.                 tableContents.rowChanged[ix] = false;
  559.             }
  560.         }
  561.         if ((deletedCount > 0) || (insertedCount > 0) || reload) {
  562.             loadGrid();
  563.         }
  564.         deleteRequested = false;
  565.     }
  566.  
  567.     //
  568.     //  Save the selected item
  569.     //
  570.     boolean saveData(int tableRow) {
  571.  
  572.         int recCount = 0;
  573.         Vector results = new Vector();
  574.         String sep = jaggSQL.getSEP();
  575.         String SQL = "";
  576.         String prevSQL = null;
  577.  
  578.         if (insertRequested) {
  579. >121            SQL = <INSERT INTO >;
  580.         } else {
  581.             if (deleteRequested) {
  582. >122                SQL = <DELETE FROM >;
  583.                 if (tableContents.recordLockValue[tableRow] != null) {
  584.                     prevSQL = SQL;
  585. >163                    SQL += " AND <colname> = " + tableContents.recordLockValue[tableRow];
  586.                 }
  587.             } else {
  588. >123                SQL = <UPDATE >;
  589.                 if (tableContents.recordLockValue[tableRow] != null) {
  590.                     prevSQL = SQL;
  591. >163                    SQL += " AND <colname> = " + tableContents.recordLockValue[tableRow];
  592.                 }
  593.             }
  594.         }
  595.  
  596.         recCount = jaggSQL.execSQL(SQL, results);
  597.  
  598.         if (user.DEBUG) System.out.println("saveData CNT: "+Integer.toString(recCount));
  599.  
  600.         if (recCount == 0 && prevSQL != null) {
  601.             String[] buttons = {"Reload","Update"};
  602.             int[] icons = {JDPButton.UNDO,JDPButton.SAVE};
  603.             JDPMessageDialog d = new JDPMessageDialog(user, user.jdpMainWindow, "Update failed...", "The record has been changed by another user...",buttons, icons);
  604.             d.display();
  605.             if (d.getPressedButton() == 1) {
  606.                 results = new Vector();
  607.                 recCount = jaggSQL.execSQL(prevSQL, results);
  608.             } else {
  609.                 return true;
  610.             }
  611.         }
  612.  
  613.         if(recCount == -1) {
  614.             user.u.setSqlMessage(jaggSQL,SQL);
  615.             return false;
  616.         }
  617.         if(recCount == 1) {
  618.             if (insertRequested) {
  619.                 user.mainmsg.setStatusMsg("Record successfully added.",3);
  620.             } else 
  621.             if (deleteRequested) {
  622.                 user.mainmsg.setStatusMsg("Record successfully removed.",3);
  623.             } else {
  624.                 user.mainmsg.setStatusMsg("Record successfully updated.",3);
  625.             }
  626.         } else {
  627.             user.u.setSqlMessage(jaggSQL,SQL);
  628.         }
  629.         if (prevSQL != null) {
  630.             return true;
  631.         }
  632.         return false;
  633.  
  634.     }
  635.  
  636.     //
  637.     //  Clear the screen fields for a new option
  638.     //
  639.     public void clearFields(boolean clearKey) {
  640.  
  641. >037        <username>.setText("<>");
  642.         loadEmptyGrid();
  643.  
  644.     }
  645.  
  646.     //
  647.     //  Load the Search Layout pulldown choices
  648.     //
  649.     void loadMatchUsing() {
  650.  
  651.         pmatchUsing = new Vector();
  652.         pactualmatchUsing = new Vector();
  653. >020        pmatchUsing.addElement(new Vector());
  654. >022        pactualmatchUsing.addElement(new Vector());
  655. >021        ((Vector)pmatchUsing.elementAt(<0>)).addElement("<Begins with>");
  656. >023        ((Vector)pactualmatchUsing.elementAt(<0>)).addElement("< like >");
  657.  
  658.     }
  659.  
  660.     //
  661.     //  Load all of the Screen Choices
  662.     //
  663.     void loadChoices() {
  664. >043
  665. >044        new JDPLoadChoice(user,jaggSQL,<choicename>,"<choicecolumnname>","<actualcolumnname>","<tablename>","<whereclause>",value<columnname>);
  666.  
  667.         tableContents.isPullDownCol = new boolean[columnCount];
  668.         tableContents.pullDownList = new List[columnCount][1];
  669. >049        tableContents.isPullDownCol[<1>] = true;
  670. >049        tableContents.pullDownList[<1>][0] = new List();
  671. >050
  672. >051        new JDPLoadChoice(user,jaggSQL,tableContents.pullDownList[<1>][0],"<choicecolumnname>","<actualcolumnname>","<tablename>","<whereclause>",value<columnname>);
  673.     }
  674.  
  675.     //
  676.     //  Perform component validations
  677.     //
  678.     public boolean checkFields() {
  679.  
  680. >045        if (!user.u.<isnumeric>(<field>,user.mainmsg,"<>")) return false;
  681.         return true;
  682.  
  683.     }
  684.  
  685.  
  686. }
  687.  
  688.