Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / wizard_form_fields_edit.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   --%>
20 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %>
21 <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %>
22 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %>
23 <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %>
25 <%@ page import="java.util.List" %>
26 <%@ page import="java.util.Iterator" %>
27 <%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %>
28 <%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %>
29 <%@ page import="java.util.Vector" %>
30 <%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %>
31 <%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %>
32 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %>
33 <%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %>
34 <%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %>
35 <%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %>
36 <%@ page import="java.text.SimpleDateFormat"%>
37 <%      
38     ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
39     WizardSequence ws = rdef.getWizardSequence();
40     String curSubStep = ws.getCurrentSubStep();
41         String reportID   = rdef.getReportID();
42         boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB);
43         boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); 
44         String dependsOnHelp = "Custom SQL can be defined";
45 %>
46
47 <%      String[] dateFormats   = { "MM/DD/YYYY", "MM/YYYY", "DD-MON-YYYY", "Month DD, YYYY", "Month, YYYY" };
48         String[] charFormats   = { "N/A" }; 
49         
50         boolean isEdit = curSubStep.equals(AppConstants.WSS_EDIT);
51         FormFieldType currField  = null;
52         if(isEdit)
53                 currField  = rdef.getFormFieldById(AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID)); 
54         
55         String currColId = (currField!=null)?nvl(currField.getColId()):""; 
56         String remoteDbPrefix = (String) session.getAttribute("remoteDB");
57
58         String colTableName     = null;
59         String colColumnName    = null;
60         String colDisplayFormat = null;
61         String colDisplayName   = null;
62         if(isSQLBased)
63                 if(currColId.length()>0) {
64                         colTableName     = ReportWrapper.getSQLBasedFFTColTableName(currColId);
65                         colColumnName    = ReportWrapper.getSQLBasedFFTColColumnName(currColId);
66                         colDisplayFormat = ReportWrapper.getSQLBasedFFTColDisplayFormat(currColId);
67                         
68                         if(currColId.indexOf("|")>=0)
69                                 currColId = currColId.substring(0, currColId.indexOf('|'));
70                         colDisplayName   = colColumnName;
71                         //colDisplayName = currColId.substring(currColId.indexOf('.')+1);
72                 } %>
73
74 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/editabledropdown.js"></script>
75 <script language="JavaScript">
76  
77 <!--
78 var fieldColName = "";
79
80         function toggleDiv(isChecked) {
81                 if(isChecked) {
82                         if(document.getElementById('showDefaultSql'))
83                         document.getElementById('showDefaultSql').style.display="";
84                         if(document.getElementById('showDefaultValue'))
85                         document.getElementById('showDefaultValue').style.display="none";
86                         if(document.forma.defaultValue)
87                            document.forma.defaultValue.value="";
88                 } else {
89                         if(document.getElementById('showDefaultSql'))
90                         document.getElementById('showDefaultSql').style.display="none";
91                         if(document.getElementById('showDefaultValue'))
92                         document.getElementById('showDefaultValue').style.display="";   
93                         if(document.getElementById('showDefaultSql') && document.forma.fieldDefaultSQL)
94                            document.forma.fieldDefaultSQL.value="";             
95                 }
96                                         
97         }
98         
99         function toggleFieldTypeSelection() {
100                    var selectBox = document.forma.fieldType;
101                    var selectedString = "";
102                    if(selectBox)
103                         selectedString = selectBox.options[selectBox.selectedIndex].value;
104                    else {
105                          <%     if(currField!=null) { %>  
106                         selectString = '<%=currField.getFieldType()%>';
107              <% } %>
108                    }
109                    
110                    if(selectedString == '<%= FormField.FFT_LIST_MULTI %>'){
111                            document.getElementById('multiSelectListSizeDiv').style.display="block";     
112                    } else {
113                            document.getElementById('multiSelectListSizeDiv').style.display="none";
114                            document.getElementById('multiSelectListSize').value="4";
115                    }
116         }
117         
118 <% if(isSQLBased) { %>
119 function showTableColsPopup() {
120         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.popup.table.cols&single_value=Y&return_table_name=Y&return_col_type=Y&remoteDbPrefix=<%=remoteDbPrefix%>", "tableColsPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
121         w.focus();
122         w.opener = this;
123 }   // showTableColsPopup
124
125 function setDisplayTypeValues(dbType) {
126         if(document.forma.colType.value!=dbType) {
127                 document.forma.colType.value = dbType;
128                 
129                 document.forma.displayFormat.options.length = 0;
130                 
131                 if(document.forma.colType.value=="<%= AppConstants.CT_DATE %>") {
132                 <% for(int i=0; i<dateFormats.length; i++) { %>
133                         document.forma.displayFormat.options[<%= i %>] = new Option("<%= dateFormats[i] %>", "<%= dateFormats[i] %>");
134                 <%  } %>
135                 } else {
136                 <% for(int i=0; i<charFormats.length; i++) { %>
137                         document.forma.displayFormat.options[<%= i %>] = new Option("<%= charFormats[i] %>", "<%= charFormats[i].equals("N/A")?"":charFormats[i] %>");
138                 <%  } %>
139                 }       // else
140                 
141                 document.forma.displayFormat.selectedIndex = 0;
142                 
143                 if(document.layers)
144                         history.go(0);
145         }       // if
146 }   // setDisplayTypeValues
147
148 function addText(newValue) {
149         var newText = "";
150         if(newValue.indexOf("|")<0)
151                 newText = newValue;
152         else {
153                 setDisplayTypeValues(newValue.substring(newValue.lastIndexOf("|")+1));
154                 newText = newValue.substring(0, newValue.lastIndexOf("|"));
155         }       // else
156         
157         document.getElementById('fieldColId').value = newText;
158         
159         var newFieldColName = "";
160         newFieldColName = newText.substring(newText.lastIndexOf(".")+1);
161         
162         if(document.getElementById('fieldName').value==""||document.getElementById('fieldName').value==fieldColName)
163                 document.getElementById('fieldName').value = newFieldColName;
164         fieldColName = newFieldColName;
165 }   // addText
166
167 function clearText() {
168         document.getElementById('fieldColId').value = "";
169 }   // clearText
170
171 <% } else { %>
172 function changeColId() {
173         var newFieldColName = document.getElementById('fieldColId').options[document.getElementById('fieldColId').selectedIndex].text;
174         if(document.getElementById('fieldColId').selectedIndex>0&&(document.getElementById('fieldName').value==""||document.getElementById('fieldName').value==fieldColName))
175                 document.getElementById('fieldName').value = newFieldColName;
176         fieldColName = newFieldColName;
177 }   // changeColId
178
179 function showDefaultValuePopup() {
180         if(document.getElementById('fieldColId').selectedIndex==0) {
181                 alert("The assistance is available only if this field is based on a column.\nYou can select a column from the list or just type a default value.");
182                 document.getElementById('fieldColId').focus();
183                 return;
184         }       // if
185         
186         var colId = document.getElementById('fieldColId').options[document.getElementById('fieldColId').selectedIndex].value;
187         
188         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.popup.filter.data&<%= AppConstants.RI_ARG_TYPE %>=<%= AppConstants.AT_VALUE %>&<%= AppConstants.RI_COLUMN_ID %>="+colId+"&<%= AppConstants.RI_JS_TARGET_FIELD %>=document.forma.defaultValue&<%= AppConstants.RI_RESET_PARAMS %>=Y", "defaultValuePopup", "width=440,height=400,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
189         w.focus();
190         w.opener = this;
191 }   // showDefaultValuePopup
192 <% }    //  else if(isSQLBased) 
193 %>
194
195 function showTestRunSQLPopup() {
196         //var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.popup.testrun.sql&<%= AppConstants.RI_FORMATTED_SQL %>="+escape(""+document.getElementById('fieldSQL').value)+"&<%= AppConstants.RI_CHK_FIELD_SQL %>=Y", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
197         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.field.testrun.jsp", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
198         w.focus();
199         w.opener = this;
200 }   // showTestRunSQLPopup
201
202 function showTestRunDefaultSQLPopup() {
203         //var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.popup.testrun.sql&<%= AppConstants.RI_FORMATTED_SQL %>="+escape(""+document.getElementById('fieldSQL').value)+"&<%= AppConstants.RI_CHK_FIELD_SQL %>=Y", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
204         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.field.default.testrun.jsp", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
205         w.focus();
206         w.opener = this;
207 }   // showTestRunDefaultSQLPopup
208
209 function showStartDatetRunSQLPopup( ) {
210         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.field.date.start.testrun.jsp", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
211         w.focus();
212         w.opener = this;
213 }   // showTestRunRangeSQLPopup
214
215 function showEndDateRunSQLPopup( ) {
216         var w = window.open("<%= AppUtils.getRaptorActionURL() %>report.field.date.end.testrun.jsp", "testRunSQLPopup", "width=450,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
217         w.focus();
218         w.opener = this;
219
220 function setDefaultVerifyFlag() {
221         document.forma.fieldDefaultSQLOrig.value = document.forma.fieldDefaultSQL.value;
222 }   // setDefaultVerifyFlag
223
224 function setVerifyFlag() {
225         document.forma.fieldSQLOrig.value = document.getElementById('fieldSQL').value;
226 }   // setVerifyFlag
227
228 function showSQLInstructions() {
229         var w = window.open("", "instrPopup", "width=400,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
230         w.focus();
231         w.opener = this;
232         
233         w.document.writeln("<html><head>");
234         w.document.writeln("<title>Form Field SQL Instructions</title>");
235         w.document.writeln("<link rel=stylesheet type=text/css href='<%= AppUtils.getBaseFolderURL() %>css/raptor.css'>");
236         w.document.writeln("</head><body>");
237         
238         w.document.writeln("<table width=94% border=0 cellspacing=1 cellpadding=3 align=center>");
239         w.document.writeln("    <tr class=rbg1 height=30>");
240         w.document.writeln("            <td><b class=rtableheader>Form Field SQL Instructions</b></td>");
241         w.document.writeln("    </tr>");
242         w.document.writeln("    <tr class=rbg3 align=center valign=middle>");
243         w.document.writeln("            <td align=left valign=middle><font class=rtabletext>");
244         w.document.writeln("                    The SQL result set must have a column <b>id</b> and a column <b>name</b>. ");
245         w.document.writeln("                    If selecting date values in visual report, the <b>id</b> must be formatted <b>MM/DD/YYYY</b>; the <b>name</b> can use any display format. ");
246         w.document.writeln("                    Example:<br><br><b>SELECT DISTINCT</b><br> ");
247         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TO_CHAR(t.start_date, 'MM/DD/YYYY') <b>id</b>,<br> ");
248         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TO_CHAR(t.start_date, 'Month YYYY') <b>name</b><br> ");
249         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;<b>FROM</b><br> ");
250         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_table t<br> ");
251         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;<b>WHERE</b><br> ");
252         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t.start_date IS NOT NULL<br> ");
253         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;<b>ORDER BY</b><br> ");
254         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t.start_date DESC");
255         w.document.writeln("            </font></td>");
256         w.document.writeln("    </tr>");
257         w.document.writeln("    <tr class=rbg1 height=30>");
258         w.document.writeln("            <td>&nbsp;</td>");
259         w.document.writeln("    </tr>");
260         w.document.writeln("    <tr>");
261         w.document.writeln("            <td align=center><br><input type=Submit class=Button value=Close onClick=\"window.close();\"></td>");
262         w.document.writeln("    </tr>");
263         w.document.writeln("</table>");
264         
265         w.document.writeln("</body></html>");
266         w.document.close();
267 }       // showSQLInstructions
268
269 function showRangeSQLInstructions() {
270         var w = window.open("", "instrPopup", "width=400,height=330,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes");
271         w.focus();
272         w.opener = this;
273         
274         w.document.writeln("<html><head>");
275         w.document.writeln("<title>Form Field Range SQL Instructions</title>");
276         w.document.writeln("<link rel=stylesheet type=text/css href='<%= AppUtils.getBaseFolderURL() %>css/raptor.css'>");
277         w.document.writeln("</head><body>");
278         
279         w.document.writeln("<table width=94% border=0 cellspacing=1 cellpadding=3 align=center>");
280         w.document.writeln("    <tr class=rbg1 height=30>");
281         w.document.writeln("            <td><b class=rtableheader>Form Field Range SQL Instructions</b></td>");
282         w.document.writeln("    </tr>");
283         w.document.writeln("    <tr class=rbg3 align=center valign=middle>");
284         w.document.writeln("            <td align=left valign=middle><font class=rtabletext>");
285         w.document.writeln("                    The SQL should ALWAYS return a valid Oralce date. If the return is not a valid date, the range will not be set.<br>");
286         w.document.writeln("                    The SQL will always get precedence over the static values.<br>");
287         w.document.writeln("                    ");
288         w.document.writeln("                    Example:<br><br><b>SELECT</b> SYSDATE<br> ");
289         w.document.writeln("                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>FROM</b> DUAL");
290         w.document.writeln("            </font></td>");
291         w.document.writeln("    </tr>");
292         w.document.writeln("    <tr class=rbg1 height=30>");
293         w.document.writeln("            <td>&nbsp;</td>");
294         w.document.writeln("    </tr>");
295         w.document.writeln("    <tr>");
296         w.document.writeln("            <td align=center><br><input type=Submit class=Button value=Close onClick=\"window.close();\"></td>");
297         w.document.writeln("    </tr>");
298         w.document.writeln("</table>");
299         
300         w.document.writeln("</body></html>");
301         w.document.close();
302 }       // showRangeSQLInstructions
303 //-->
304 </script>
305
306         
307 <table width="100%" class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
308         <tr>
309                 <td class=rbg1 colspan=2 valign="Middle"><b class=rtableheader>Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %> - <%= curSubStep %></b></td>
310         </tr>
311         <tr>
312                 <td class=rbg2 align="right" width="25%" height="30" style="background-image:url(<%= AppUtils.getImgFolderURL() %>required.gif); background-position:top right; background-repeat:no-repeat;"><font class=rtabletext>Field Name: </font></td> 
313                 <td class=rbg3 align="left" width="50%"><font class=rtabletext>
314                         <input type="text" style="width: 100px;" class="rtabletext" size="30" maxlength="30" id="fieldName" name="fieldName" value="<%= isEdit?currField.getFieldName():"" %>"></font></td>
315         </tr>
316         <tr>
317                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Based On Column: </font></td> 
318                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
319 <%                      if(isSQLBased) { %>
320                         <input type=text  style="width: 100px;" class="rtabletext" size=50 id="fieldColId" name="fieldColId" value="<%= currColId %>" onFocus="blur()">
321                         <a href="javascript:showTableColsPopup()"><img border=0 src="<%= AppUtils.getImgFolderURL() %>shareicon.gif" alt="Select database column" width=12 height=12></a>
322 <%                      } else { %>
323                         <select name="fieldColId" class="rtabletext" onChange="changeColId()" style="width: 100px;" >
324                                     <option value=""<%= currColId.equals("")?" selected":"" %>>--- None ---
325 <%                              int iCount = 0;
326                                 List reportCols = rdef.getAllColumns();
327                                 for(Iterator iter=reportCols.iterator(); iter.hasNext(); iCount++) { 
328                                         DataColumnType dct = (DataColumnType) iter.next(); %>
329                                     <option value="<%= dct.getColId() %>"<%= currColId.equals(dct.getColId())?" selected":"" %>><%= dct.getDisplayName() %>
330 <%                                      if(currColId.equals(dct.getColId()))
331                                                 colDisplayName = dct.getDisplayName();
332                                 }   // for 
333 %>
334                         </select>
335 <%                      }   // else if(isSQLBased)
336                         if(colDisplayName!=null) { %>
337 <script language="JavaScript">
338 <!--
339 fieldColName = "<%= colDisplayName %>";
340 //-->
341 </script>
342 <%                      }   // if 
343 %>
344                         </font>
345                 </td>
346         </tr>  
347 <%      if(isSQLBased) {
348                 String colType = AppConstants.CT_CHAR;
349                 if(colTableName!=null&&colColumnName!=null)
350                         try {
351                                 colType  = nvl(DataCache.getReportTableDbColumnType(colTableName, colColumnName,((String) session.getAttribute("remoteDB"))), AppConstants.CT_CHAR);
352                         } catch(Exception e) {}
353                         
354                 String[] fmt;
355                 if(colType.equals(AppConstants.CT_DATE)) 
356                         fmt = dateFormats;
357                 else 
358                         fmt = charFormats; %>
359         <tr>
360                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Display Format: </font></td> 
361                 <td class=rbg3 align="left"><font class=rtabletext>
362                         <select name="displayFormat" style="width: 100px;" >
363                         <%      for(int i=0; i<fmt.length; i++) { %>
364                                 <option value="<%= fmt[i].equals("N/A")?"":fmt[i] %>"<%= (nvl(colDisplayFormat).toUpperCase().equals(fmt[i].toUpperCase()))?" selected":"" %>><%= fmt[i] %>
365                         <%  } %>
366                         </select>
367                         <input type="hidden" name="colType" value="<%= colType %>">
368                 </font></td>
369         </tr> 
370 <%      }       // if 
371 %>
372
373         <tr>
374                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Visible? </font></td> 
375                 <td class=rbg3 align="left"><font class=rtabletext>
376                         <select name="visible" style="width: 100px;" >
377                                 <option value="Y"<%= isEdit?(nvl(currField.getVisible(),"Y").startsWith("Y")?" selected":""):" selected" %>>Yes
378                                 <option value="N"<%= (isEdit&&(! nvl(currField.getVisible(),"Y").startsWith("Y")))?" selected":""        %>>No
379                         </select></font></td>
380         </tr>
381    <% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
382         <tr>
383                 <td class=rbg2 height="30" align="right">
384                         <font class=rtabletext>Is used in Group By Clause?</font>
385                 </td>
386                 <td class=rbg3 align="left" nowrap>
387                         <input type="checkbox" name="isGroupFormField" value="Y" <%=(currField!=null && (currField.isGroupFormField()!=null && currField.isGroupFormField().booleanValue()))?" checked":"" %>>
388                 </td>
389         </tr>
390         <% } %>
391         
392         
393         <tr>
394                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Field Type: </font></td> 
395                 <td class=rbg3 align="left"><font class=rtabletext>
396                         <% String curValue = nvl((currField!=null)?currField.getFieldType():"", FormField.FFT_TEXT_W_POPUP); %>
397                         <select name="fieldType" onChange="toggleFieldTypeSelection()" style="width: 100px;" >
398                                 <%--<option value="<%= FormField.FFT_TEXT_W_POPUP %>"<%= curValue.equals(FormField.FFT_TEXT_W_POPUP)?" selected":"" %>>Text Box with Popup --%>
399                                 <option value="<%= FormField.FFT_TEXT         %>"<%= curValue.equals(FormField.FFT_TEXT        )?" selected":"" %>>Text Box
400                                 <%--<option value="<%= FormField.FFT_TEXTAREA     %>"<%= curValue.equals(FormField.FFT_TEXTAREA    )?" selected":"" %>>Text Area--%>
401                                 <%--<option value="<%= FormField.FFT_COMBO_BOX    %>"<%= curValue.equals(FormField.FFT_COMBO_BOX   )?" selected":"" %>>Drop-Down List--%>
402                                 <option value="<%= FormField.FFT_LIST_BOX     %>"<%= curValue.equals(FormField.FFT_LIST_BOX    )?" selected":"" %>>List Box
403                                 <%--<option value="<%= FormField.FFT_RADIO_BTN    %>"<%= curValue.equals(FormField.FFT_RADIO_BTN   )?" selected":"" %>>Radio Buttons
404                                 <option value="<%= FormField.FFT_CHECK_BOX    %>"<%= curValue.equals(FormField.FFT_CHECK_BOX   )?" selected":"" %>>Check Boxes --%>
405                                 <option value="<%= FormField.FFT_LIST_MULTI   %>"<%= curValue.equals(FormField.FFT_LIST_MULTI  )?" selected":"" %>>Multi-select List Box
406                                 <option value="<%= FormField.FFT_HIDDEN       %>"<%= curValue.equals(FormField.FFT_HIDDEN      )?" selected":"" %>>Hidden
407                         </select>
408                 </font></td>
409         </tr> 
410
411         <tr id="multiSelectListSizeDiv">
412                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Visible Size: </font></td> 
413                 <td class=rbg3 align="left"><font class=rtabletext>
414                         <select id="multiSelectListSize" name="multiSelectListSize" onKeyDown="fnKeyDownHandler(this, event);" onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = "return fnKeyPressHandler_A(this, event);"  onChange="fnChangeHandler_A(this, event);">
415                                 <option value="1"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("1")?" selected":"" )%>>1
416                                 <option value="2"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("2")?" selected":"" )%>>2
417                                 <option value="3"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("3")?" selected":"" )%>>3
418                                 <option value="4"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("4")?" selected":"" )%>>4
419                                 <option value="5"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("5")?" selected":"" )%>>5
420                                 <option value="6"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("6")?" selected":"" )%>>6
421                                 <option value="7"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("7")?" selected":"" )%>>7
422                                 <option value="8"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("8")?" selected":"" )%>>8
423                                 <option value="9"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("9")?" selected":"" )%>>9
424                                 <option value="10"<%= (currField!=null && nvl(currField.getMultiSelectListSize(), "4").equals("10")?" selected":"" )%>>10
425                                 <option value="" style="COLOR:#ff0000;BACKGROUND-COLOR:#ffff00;">Custom</option> <!-- This is the Editable Option -->
426                                 <% if(currField!=null && isNumber(nvl(currField.getMultiSelectListSize())) && new Integer(nvl(currField.getMultiSelectListSize(), "0")).intValue() <= 20) {
427                                 %>
428                                         <option value="<%=nvl(currField.getMultiSelectListSize())%>" selected><%=nvl(currField.getMultiSelectListSize())%></option> <!-- This is the Editable Option -->
429                 <%                              
430                                          } 
431                 %>                                              
432                         </select>                       
433                 </font></td>
434         </tr> 
435         
436                 <%if(! isSQLBased) { %> 
437         <tr>
438                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Default Value: </font></td> 
439                 <td class=rbg3 align="left"><font class=rtabletext>
440                         <input type="text" class="rtabletext" size="20" maxlength="50" name="defaultValue" value="<%= isEdit?nvl(currField.getDefaultValue()):"" %>"></font>
441                     <a href="javascript:showDefaultValuePopup()"><img border="0" src="<%= AppUtils.getImgFolderURL() %>shareicon.gif" alt="Select from list" width="12" height="12"></a>
442         </td></tr>
443                 <% } else { %>
444             <% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
445
446                         <tr>
447                                 <td class=rbg2 height="30" align="right">
448                                         <font class=rtabletext>Is Default Value should be SQL</font>
449                                 </td>
450                                 <td class=rbg3 align="left" nowrap>
451                                         <input type="checkbox" id="isDefaultSQL" name="isDefaultSQL" value="N" <%=currField!=null && currField.getFieldDefaultSQL()!=null && currField.getFieldDefaultSQL().length()>0?" checked":"" %> onClick="toggleDiv(this.checked)">
452                                 </td>
453                         </tr>
454             
455
456             <tbody id="showDefaultSql" style="display:none;">
457                <tr>
458                 <td class=rbg2 height="30" align="right">Default SQL: </td>
459                                 <td class=rbg3>
460                         <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" rowspan="2">
461                         <input type="hidden" name="fieldDefaultSQLOrig" value="<%= (currField!=null)?nvl(currField.getFieldDefaultSQL()):"" %>">
462                         <textarea class="buttonLabelField" name="fieldDefaultSQL" cols="40" rows="3"><%= (currField!=null)?nvl(currField.getFieldDefaultSQL()):"" %></textarea>
463                         </td>
464                         <td align="center" valign="top">&nbsp;<input type="Button" att-button btn-type="primary" size="small" class=button value="Verify SQL" onClick="if(document.forma.fieldDefaultSQL.value=='') {alert('Please provide SQL.'); return false; } showTestRunDefaultSQLPopup();">&nbsp;</td>
465                         <td rowspan="2" width="60%">&nbsp;</td></tr><tr>
466                         <td align="center" valign="middle">&nbsp;<a href="javascript:showSQLInstructions()" class=rtabletext>Instructions</a>&nbsp;</td>
467                         </tr></table>
468                 </td> 
469               </tr>
470                         </tbody>
471             <% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
472              <script language="Javascript">
473              toggleDiv(document.getElementById('isDefaultSQL').checked);
474              </script>
475            <% } %>
476                     <% } // if admin user  %>  
477             <tbody id="showDefaultValue">
478                <tr> 
479                                 <td class=rbg2 height="30" align="right"> Default Value: </td>
480                                 <td class=rbg3>
481                                 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" rowspan="2">
482                                         <input type="text" style="width:200px" class="rtabletext" size="20" maxlength="50" name="defaultValue" value="<%= isEdit?nvl(currField.getDefaultValue()):"" %>"></font>
483                  </td>
484                                 </tr></table>
485                 </td>
486         </tr>
487                         </tbody>
488             <% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
489              <script language="Javascript">
490              toggleDiv(document.getElementById('isDefaultSQL').checked);
491              </script>
492             <% } %>
493                 <% } //else %>
494         <tr>
495                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Verify Field Value As: </font></td> 
496                 <td class=rbg3 align="left"><font class=rtabletext>
497                         <% curValue = nvl((currField!=null)?currField.getValidationType():"", FormField.VT_NONE); %>
498                         <select name="validation" onChange="if (this.value =='<%= FormField.VT_DATE%>') ; else dateRangeRow.style.display='none'" style="width: 200px;" >
499                                 <option value="<%= FormField.VT_NONE               %>"<%= curValue.equals(FormField.VT_NONE              )?" selected":"" %>>--- Do Not Perform Validation ---
500                                 <option value="<%= FormField.VT_DATE               %>"<%= curValue.equals(FormField.VT_DATE              )?" selected":"" %>>Date
501                                 <option value="<%= FormField.VT_TIMESTAMP_HR       %>"<%= curValue.equals(FormField.VT_TIMESTAMP_HR      )?" selected":"" %>>TimeStamp (Hour)
502                                 <option value="<%= FormField.VT_TIMESTAMP_MIN      %>"<%= curValue.equals(FormField.VT_TIMESTAMP_MIN     )?" selected":"" %>>TimeStamp (Hour, Min)
503                                 <option value="<%= FormField.VT_TIMESTAMP_SEC      %>"<%= curValue.equals(FormField.VT_TIMESTAMP_SEC     )?" selected":"" %>>TimeStamp (Hour, Min, Sec)
504                                 <option value="<%= FormField.VT_INT                %>"<%= curValue.equals(FormField.VT_INT               )?" selected":"" %>>Integer
505                                 <option value="<%= FormField.VT_INT_NON_NEGATIVE   %>"<%= curValue.equals(FormField.VT_INT_NON_NEGATIVE  )?" selected":"" %>>Positive Integer
506                                 <option value="<%= FormField.VT_INT_POSITIVE       %>"<%= curValue.equals(FormField.VT_INT_POSITIVE      )?" selected":"" %>>Positive Integer, Cannot Be Zero
507                                 <option value="<%= FormField.VT_FLOAT              %>"<%= curValue.equals(FormField.VT_FLOAT             )?" selected":"" %>>Any Number
508                                 <option value="<%= FormField.VT_FLOAT_NON_NEGATIVE %>"<%= curValue.equals(FormField.VT_FLOAT_NON_NEGATIVE)?" selected":"" %>>Positive Number
509                                 <option value="<%= FormField.VT_FLOAT_POSITIVE     %>"<%= curValue.equals(FormField.VT_FLOAT_POSITIVE    )?" selected":"" %>>Positive Number, Cannot Be Zero
510                         </select></font>
511                 </td>
512         </tr>   
513         <tr id="dateRangeRow" <%if(curValue.equals(FormField.VT_DATE) || curValue.equals(FormField.VT_TIMESTAMP_HR) || curValue.equals(FormField.VT_TIMESTAMP_MIN) || curValue.equals(FormField.VT_TIMESTAMP_SEC)){%><%}else{%>style="display:none"<%}%>>
514                 <td colspan="2" class=rbg2>
515                 <table width="100%">
516                         <tr>
517                                 <td class=rbg2 align="right" width="33%" height="30"><font class=rtabletext>Valid Date Range: </font></td> 
518                                 <td width="15%" align="left">
519                                         <font class=rtabletext >From </font>
520                                 </td>
521                                 <td align="left">
522                                         <font class=rtabletext >To </font>
523                                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
524                                         <a href="javascript:showRangeSQLInstructions()" class=rtabletext>Instructions</a>&nbsp;
525                                 </td>
526                                 
527                         </tr>                           
528                         <tr>
529                                 <td class=rbg2 align="right"></td> 
530                                 </td>
531                                 <td width="15%" align="left">
532                                         <input type="hidden" name="rangeStartDateSQLOrig" value="<%= (currField!=null)?nvl(currField.getRangeStartDateSQL()):"" %>">
533                                         <textarea name="rangeStartDateSQL" class="rtabletext" style="width: 200px;height: 100px" cols="20" rows="3"><%= (currField!=null)?nvl(currField.getRangeStartDateSQL()):"" %></textarea>
534                                         
535                                 </td>
536                                 <td align="left">
537                                         <input type="hidden" name="rangeEndDateSQLOrig" value="<%= (currField!=null)?nvl(currField.getRangeEndDateSQL()):"" %>">
538                                         <textarea name="rangeEndDateSQL" class="rtabletext" style="width: 200px;height: 100px" cols="20" rows="3"><%= (currField!=null)?nvl(currField.getRangeEndDateSQL()):"" %></textarea>
539                                         
540                                 </td>
541                         </tr>
542                         <tr>
543                                 <td class=rbg2 align="right"></td> 
544                                 </td>
545                                 <td width="15%" align="left">
546                                         <input type="Button" class=button att-button btn-type="primary" size="small" value="Verify SQL" onClick="if(document.forma.rangeStartDateSQL.value=='') {alert('Please provide SQL.'); return false; } showStartDatetRunSQLPopup();">&nbsp;</td>
547                                 </td>
548                                 <td align="left">
549                                         <input type="Button" class=button att-button btn-type="primary" size="small" value="Verify SQL" onClick="if(document.forma.rangeEndDateSQL.value=='') {alert('Please provide SQL.'); return false; } showEndDateRunSQLPopup();">&nbsp;</td>
550                                 </td>
551                         </tr>
552                         <tr>
553                                 <td class=rbg2 align="right"></td> 
554                                 <td class=rbg3 align="left">
555                                         <%      String stDate = "";
556                                                 String endDate = "";
557                                                 if (currField!= null 
558                                                   && currField.getRangeStartDate() != null && currField.getRangeStartDate().equals("") == false
559                                                   && currField.getRangeEndDate() != null && currField.getRangeEndDate().equals("") == false){
560                                                         SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy");
561                                                         stDate = dtf.format(currField.getRangeStartDate().toGregorianCalendar().getTime());
562                                                         endDate = dtf.format(currField.getRangeEndDate().toGregorianCalendar().getTime());
563                                                 }
564                                         %>
565                                         <input type="text" class="rtabletext" size="10" maxlength="10" style="width: 100px;" name="rangeStartDate" id="rangeStartDate" value="<%=stDate%>">
566                                         <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20" onClick="oCalendar.select(document.getElementById('rangeStartDate'),event,'MM/dd/yyyy'); return false;"  style="cursor:hand">
567                                         
568
569                                 </td>
570                                 <td>
571                                         <input type="text" class="rtabletext" size="10" maxlength="10" style="width: 100px;" name="rangeEndDate" id="rangeEndDate" value="<%=endDate%>">
572                                         <img src="<%= AppUtils.getImgFolderURL() %>calender_icon.gif" align=absmiddle border=0 width="20" height="20" onClick="oCalendar.select(document.getElementById('rangeEndDate'),event,'MM/dd/yyyy'); return false;"  style="cursor:hand">                                                               
573                                 </td>
574                         </tr>
575                         
576                 </table>
577                 </td>
578                 
579         </tr> 
580         <tr>
581                 <td class=rbg2 align="right" height="30"><font class=rtabletext>&nbsp; </font></td> 
582                 <td class=rbg3 align="left">
583                         <% curValue = nvl((currField!=null)?currField.getMandatory():"", "N"); %>
584                         <input type="Checkbox" class="checkbox" name="mandatory" value="Y"<%= curValue.equals("Y")?" checked":"" %>>
585                         <font class=rtabletext>User must provide value for this field</font>
586                 </td>
587         </tr> 
588         <tr>
589                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Field Help Text: </font></td> 
590                 <td class=rbg3 align="left">
591                         <textarea name="fieldHelp" style="width: 100px;" class="rtabletext" cols="40" rows="3"><%= (currField!=null)?nvl(currField.getComment()):"" %></textarea>
592                 </td>
593         </tr>
594 <% if(Globals.getAllowSQLBasedReports()||AppUtils.isAdminUser(request)) { %>
595         <tr>
596                 <td class=rbg2 align="right" height="30"><font class=rtabletext>SQL Generating Custom List of Values: <br>(overrides default list) </font></td> 
597                 <td class=rbg3 align="left">
598                         <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" rowspan="2">
599                         <input type="hidden" name="fieldSQLOrig" value="<%= (currField!=null)?nvl(currField.getFieldSQL()):"" %>">
600                         <textarea id="fieldSQL" name="fieldSQL" class="rtabletext" cols="40" rows="3"><%= (currField!=null)?nvl(currField.getFieldSQL()):"" %></textarea>
601                         </td>
602                         <td align="center" valign="top">&nbsp;<input type="Button" class=button att-button btn-type="primary" size="small" value="Verify SQL" onClick="if(document.getElementById('fieldSQL').value=='') {alert('Please provide SQL.'); return false; } showTestRunSQLPopup();">&nbsp;</td>
603                         <td rowspan="2" width="60%">&nbsp;</td></tr><tr>
604                         <td align="center" valign="middle">&nbsp;<a href="javascript:showSQLInstructions()" class=rtabletext>Instructions</a>&nbsp;</td>
605                         </tr></table>
606                 </td>
607         </tr>
608         <tr>
609                 <td class=rbg2 align="right" height="30"></td> 
610                 <td class=rbg3 align="left">
611                 <% curValue = nvl((currField!=null)?currField.getDependsOn():"", "N"); %>
612                 <font class=rtabletext><input id='dependsOn' type="checkbox" name="dependsOn" value="Y"<%= curValue.equals("Y") ? "checked":"" %>>
613                 <label title="<%=dependsOnHelp%>" style="cursor: pointer;" for="dependsOn">Depends on another Form Field.</label>
614                 </td>
615         </tr>
616 <% } else { %>
617                         <input type="hidden" id="fieldSQL" name="fieldSQL" value="<%= (currField!=null)?nvl(currField.getFieldSQL()):"" %>">
618 <% } %>
619 <%      List predefinedValues = (currField!=null&&currField.getPredefinedValueList()!=null)?currField.getPredefinedValueList().getPredefinedValue():null; %>
620         <tr>
621                 <td class=rbg2 align="right" height="30"><font class=rtabletext>Provide Predefined List of Values:</font></td> 
622                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
623                         <%      if(predefinedValues==null||predefinedValues.size()==0) { %>
624                                 Do not use Predefined list - Generate list from database
625                         <%      } else { 
626                                         String value = (String) predefinedValues.get(0); %>
627                                 <%= value %>
628                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
629                                 <input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! dataValidate()) {return false;} else if(! confirm('Are you sure?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_USER %>'; document.forma.delPredefinedValue.value='<%= value %>'; }">
630                         <%      } %>
631                         </font></td>
632         </tr>
633 <%      if(predefinedValues!=null&&predefinedValues.size()>1)
634                 for(int i=1; i<predefinedValues.size(); i++) { 
635                         String value = (String) predefinedValues.get(i); %>
636         <tr>
637                 <td class=rbg2 align="right" height="30"><font class=rtabletext>&nbsp;</font></td> 
638                 <td class=rbg3 align="left" nowrap><font class=rtabletext>
639                         <%= value %>
640                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
641                         <input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! dataValidate()) {return false;} else if(! confirm('Are you sure?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_USER %>'; document.forma.delPredefinedValue.value='<%= value %>'; }">
642                         </font></td>
643         </tr>
644 <%              }       // for 
645 %>
646         <tr>
647                 <td class=rbg2 align="right" height="30"><font class=rtabletext>&nbsp; </font></td> 
648                 <td class=rbg3 align="left" valign="middle" nowrap><font class=rtabletext>
649                         <input type="hidden" name="delPredefinedValue" value="">
650                         <input type="text" style="width: 200px;" size="20" maxlength="50" name="newPredefinedValue" value="">
651                         <input type="Submit" att-button btn-type="primary" size="small" class=button value="Add To List" onClick="if(document.forma.newPredefinedValue.value=='') {alert('Value cannot be empty.'); return false; } if(! stepDataValidate(false)) return false;  <%= (predefinedValues==null||predefinedValues.size()==0)?"if(! confirm('If you create a list of predefined values, it will be displayed instead of the list selected from the database.\\nAre you sure you want to do that?')) return false; ":"" %>document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_USER %>';">
652                         </font></td>
653         </tr>
654 </table>
655 <br>
656
657 <script language="JavaScript">
658 <!--
659 function stepDataValidate(checkCol) {
660         if(document.getElementById('fieldName').value=="") {
661                 alert("Please enter Field Name");
662                 document.getElementById('fieldName').focus();
663                 document.getElementById('fieldName').select();
664                 
665                 return false;
666         }   // if
667         
668 <% if(rdef.getFormFieldList()!=null) { %>
669         if(false
670 <%              for(Iterator iter=rdef.getFormFieldList().getFormField().iterator(); iter.hasNext(); ) { 
671                         FormFieldType fft = (FormFieldType) iter.next();
672                         
673                         if(! (isEdit&&fft.getFieldId().equals(currField.getFieldId()))) { %>
674                             ||(document.getElementById('fieldName').value=="<%= fft.getFieldName() %>")
675 <%                  }
676                 } %>
677            ) {
678                 alert("Form field with name "+document.getElementById('fieldName').value+" already exists.\nPlease select another name.");
679                 document.getElementById('fieldName').focus();
680                 document.getElementById('fieldName').select();
681                 
682                 return false;
683         }
684 <% } %>
685         
686 <% if(predefinedValues==null||predefinedValues.size()==0) { %>
687         if(checkCol)
688                 if(document.getElementById('fieldColId').selectedIndex==0)
689                         if(document.forma.fieldType.selectedIndex!=1&&document.forma.fieldType.selectedIndex!=2) {
690                                 alert("Field Type can be only Text Box or Text Area if this field is not based on a column.\nPlease change the Field Type or select a column from the list.");
691                                 document.forma.fieldType.focus();
692                                 
693                                 return false;
694                         }       // if
695 <% } %>
696         
697 <% if((Globals.getAllowSQLBasedReports()||AppUtils.isAdminUser(request)) && (rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED))) { %>
698         if(document.forma.fieldSQL.value!=""&&document.forma.fieldSQL.value!=document.forma.fieldSQLOrig.value) {
699                 alert("You must verify the SQL.");
700                 document.forma.fieldSQL.focus();
701                 document.forma.fieldSQL.select();
702                 
703                 return false;
704         }   // if
705         if(document.forma.fieldDefaultSQL.value!=""&&document.forma.fieldDefaultSQL.value!=document.forma.fieldDefaultSQLOrig.value) {
706                 alert("You must verify the Default SQL.");
707                 document.forma.fieldDefaultSQL.focus();
708                 document.forma.fieldDefaultSQL.select();
709                 
710                 return false;
711         }   // if
712         if(document.forma.fieldSQL.value.length<=0 && document.forma.fieldDefaultSQL.value.length > 1 ) {
713       alert("SQL Field cannot be empty when Default sql has value.");
714           return false;
715         }       
716 <% } %>
717
718 if(document.getElementById('multiSelectListSize') && document.getElementById('multiSelectListSize').options.selectedIndex == 0) {
719         if(!checkNonNegativeInteger(document.forma.multiSelectListSize.options[document.forma.multiSelectListSize.options.selectedIndex].text)) {
720                 alert("Please enter number in Multi Select List Size. No Characters are allowed.");
721                 return false;
722         } else {
723                 if(document.getElementById('multiSelectListSize').options[document.getElementById('multiSelectListSize').options.selectedIndex].text>20) {
724                         alert("Please not only 20 items are allowed in Multi-Select form field.");
725                         return false;
726                 }
727                 document.getElementById('multiSelectListSize').options[document.getElementById('multiSelectListSize').options.selectedIndex].value=document.getElementById('multiSelectListSize').options[document.getElementById('multiSelectListSize').options.selectedIndex].text;
728         }
729 }
730
731         return true;
732 }   // dataValidate
733
734 function dataValidate() {
735         return stepDataValidate(true);
736 }   // dataValidate
737
738 toggleFieldTypeSelection();
739 //-->
740 </script>
741
742 <script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/CalendarPopup.js"></script> 
743 <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/calendar.css">
744 <iframe id="calendarFrame" class="nav" z-index:199; scrolling="no"  frameborder="0"  width=165px height=165px src="" style="position:absolute; display:none;">
745 </iframe>
746 <div id="calendarDiv" name="calendarDiv" style="position:absolute; z-index:20000; visibility:hidden; background-color:white;layer-background-color:white;"></div>
747
748         <SCRIPT LANGUAGE="JavaScript">
749         var oCalendar = new CalendarPopup("calendarDiv", "calendarFrame");      
750         oCalendar.setCssPrefix("raptor");
751         </SCRIPT>
752
753
754 <%!
755         private String nvl(String s)                  { return (s==null)?"":s; }
756         private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } 
757     private boolean isNumber(String value) { // As per Raptor def, like
758
759         // -$3,270.56
760         value = value.trim();
761         if(value.length()>2) return false;
762         for (int i = 0; i < value.length(); i++) {
763             char c = value.charAt(i);
764             if (!(Character.isDigit(c) || c == '.' || c == '-' || c == '+' || c == ','
765                     || c == '$' || c == '%'))
766                 return false;
767         } // for
768
769         return true;
770     } // isNumber
771 %>