prmtGenSelectValueHTML.js 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| BI and PM: prmt
  5. *| (C) Copyright IBM Corp. 2002, 2016
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. ////////////////////////////////////////////////////////////////////
  13. // SelectValue HTML generation functions
  14. ////////////////////////////////////////////////////////////////////
  15. // Function to create a select prompt control
  16. // sPromptId: The id of the prompt control (String)
  17. // sFormName: Name of form control to submit selections to the server (String)
  18. // sParameterName: Name of control element to be submitted to report server (String)
  19. // sSubmitType: 'default' will submit as a standard form (String)
  20. // 'XML' will convert the submission to XML and submit
  21. // sAutoSubmitType: specify whether the autosubmit should stay on the same page (reprompt)
  22. // or move to the next prompt page (prompt)
  23. // ['prompt'|'reprompt'] (String)
  24. // sSelectUI: UI of control ['listbox'|'checkboxGroup'|'radioGroup'|'dropdown']
  25. // sColumnName: Column name which control is a prompt of (String)
  26. // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
  27. // RANGE_NO_VALUE will select lowest to highest
  28. // RANGE_START_VALUE will select from a particular value to highest
  29. // RANGE_END_VALUE will select from lowest to a particular value
  30. // RANGE_BOUND_VALUE will select a range
  31. // RANGE_EQUAL_VALUE will select a single value
  32. // bDisabled: If control is disabled from user input (Boolean)
  33. // bRequired: If the control is a required field. (Boolean)
  34. // bAutoSubmit: If the control is submitted as soon as user selects a value (Boolean)
  35. // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  36. // bSuppressExtraPromptNames: Force report server to handle multiple prompt controls as a single entity (Boolean)
  37. // e.g. treat datetime control as a single date time, as opposed to treating date and time independntly
  38. // bMulti: If control can accomodate more than one value. (Boolean)
  39. // bRange: If control is a range. (Boolean)
  40. // sStyle: Style of prompt control. (String)
  41. // bShowParentDetails: ?
  42. // iNumSelectOptions: The number of selectOptions known of ahead of time
  43. function genSelectValueHTML(sPromptId, sFormName, sParameterName, sSubmitType, sAutoSubmitType, sSelectUI, sColumnName, iInitialState, bDisabled, bRequired, bAutoSubmit, bHideAdornments, bSuppressExtraPromptNames, bMulti, bRange, sStyle, bShowParentDetails, iNumSelectOptions, bShowGroupingBox)
  44. {
  45. var oProperties = sPromptId;
  46. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  47. {
  48. oProperties = {
  49. id: sPromptId,
  50. formName: sFormName,
  51. parameterName: sParameterName,
  52. submitType: sSubmitType,
  53. autoSubmitType: sAutoSubmitType,
  54. selectUI: sSelectUI,
  55. columnName: sColumnName,
  56. initialState: iInitialState,
  57. disabled: bDisabled,
  58. required: bRequired,
  59. autoSubmit: bAutoSubmit,
  60. hideAdornments: bHideAdornments,
  61. supressExtraPromptNames: bSuppressExtraPromptNames,
  62. multi: bMulti,
  63. range: bRange,
  64. style: sStyle,
  65. showParentDetails: bShowParentDetails,
  66. numSelectOptions: iNumSelectOptions,
  67. alwaysShowGroupingBox: bShowGroupingBox };
  68. }
  69. if (oProperties.multi && oProperties.range)
  70. {
  71. genSelectValueRangeMultipleHTML(oProperties);
  72. }
  73. else
  74. {
  75. if (oProperties.range)
  76. {
  77. genSelectValueRangeHTML(oProperties);
  78. }
  79. else
  80. {
  81. genSelectValueSMHTML(oProperties);
  82. }
  83. }
  84. }
  85. function cancelScroll()
  86. {
  87. window.event.cancelBubble = true;
  88. window.event.returnValue = false;
  89. }
  90. function genSelectValueSMHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_AutoSubmitType, s_SelectUI, s_ColumnName, b_Disabled, b_Required, b_AutoSubmit, b_MultiSelect, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, b_ShowParentDetails, i_NumSelectOptions, b_alwaysShowGroupingBox)
  91. {
  92. var oProperties = s_PromptId;
  93. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  94. {
  95. oProperties = {
  96. id: s_PromptId,
  97. formName: s_FormName,
  98. parameterName: s_ParameterName,
  99. submitType: s_SubmitType,
  100. autoSubmitType: s_AutoSubmitType,
  101. selectUI: s_SelectUI,
  102. columnName: s_ColumnName,
  103. disabled: b_Disabled,
  104. required: b_Required,
  105. autoSubmit: b_AutoSubmit,
  106. multi: b_MultiSelect,
  107. hideAdornments: b_HideAdornments,
  108. supressExtraPromptNames: b_SuppressExtraPromptNames,
  109. style: s_Style,
  110. showParentDetails: b_ShowParentDetails,
  111. numSelectOptions: i_NumSelectOptions,
  112. alwaysShowGroupingBox: b_alwaysShowGroupingBox};
  113. }
  114. var sPromptId = oProperties.id;
  115. var sParamName = "_" + oProperties.parameterName;
  116. if (!oProperties.supressExtraPromptNames)
  117. {
  118. sParamName = "p" + sParamName;
  119. }
  120. if (!verifyPromptId(sPromptId) || !verifyPromptId(sParamName)) {
  121. return;
  122. }
  123. //skin folder
  124. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  125. var sFormName = oProperties.formName;
  126. if (!sFormName) {
  127. sFormName = "forms[0]";
  128. }
  129. var sErrorImg = null;
  130. if (!oProperties.hideAdornments)
  131. {
  132. sErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
  133. }
  134. var sFormElementName = sParamName;
  135. var sStyle = oProperties.style;
  136. if (typeof sStyle != K_PRMT_sSTRING)
  137. {
  138. sStyle = K_PRMT_sEMPTY;
  139. }
  140. if (oProperties.submitType == K_PRMT_sXML)
  141. {
  142. sFormElementName = "_oLstChoices" + sPromptId;
  143. }
  144. sFormElementName = jsEncodeStr(sFormElementName);
  145. var sAutoSubmitBehavior = "setTimeout('listBox" + sPromptId + ".checkData()', 100);";
  146. if (oProperties.autoSubmit)
  147. {
  148. sAutoSubmitBehavior = "setTimeout('listBox" + sPromptId + ".autoSubmit()', 100);";
  149. }
  150. var sWidth = cssParser( oProperties.style, "width" );
  151. if( sWidth != K_PRMT_sEMPTY && sWidth.match( /\s*width\s*:\s*\d+%/gi ) )
  152. {
  153. sWidth = "width:100%;";
  154. }
  155. else
  156. {
  157. sWidth = K_PRMT_sEMPTY;
  158. }
  159. var HTMLOut = K_PRMT_sEMPTY, JSOut = K_PRMT_sEMPTY;
  160. if (oProperties.submitType == K_PRMT_sXML)
  161. {
  162. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  163. }
  164. HTMLOut += "<fieldset class='clsFieldSet' style='" + sWidth + cssParser(oProperties.style, "background,border,margin,vertical-align,padding,overflow,visibility,float,display,align" + ((oProperties.multi==true||oProperties.range==true)?",width":K_PRMT_sEMPTY)) + "'><table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
  165. "<tr>";
  166. if (!oProperties.hideAdornments)
  167. {
  168. if(!sWidth)
  169. {
  170. HTMLOut += "<td valign='top' width='10px'><table cellpadding='0' cellspacing='0' border='0' width='10' height='20'>";
  171. if (oProperties.required)
  172. {
  173. HTMLOut += "<tr>" +
  174. "<td valign='top'><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/></td>" +
  175. "</tr>";
  176. }
  177. HTMLOut += "<tr>" +
  178. "<td valign='middle'><img id='imgTest" + sPromptId + "' name='imgTest" + sPromptId + "' class='clsErrorRequired' src='" + sSkin + "/prompting/images/error_timed_small_off.gif' align='bottom' height='10' width='10' border='0'/></td>" +
  179. "</tr></table></td>";
  180. }
  181. }
  182. HTMLOut += "<td style='"+ sWidth + "'>";
  183. var sCVObj = getCVInstance(oProperties);
  184. if (oProperties.multi)
  185. {
  186. //// multiselect = true -- selectUI = listBox
  187. if (oProperties.selectUI == "listBox")
  188. {
  189. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='" + sWidth +"'>" +
  190. "<tr>" +
  191. "<td>" +
  192. "<select id='selectList" + sPromptId + "' name=" + '"' + sFormElementName + '"' + " size='11' multiple='multiple' class='clsListControl pv' onchange=\"setTimeout('listBox" + sPromptId + ".checkData()', 100)\" style=\"" + cssParser(sStyle,'color,font,text,height' + ((oProperties.multi==false && oProperties.range==false)?",width":K_PRMT_sEMPTY)) + sWidth + "\"";
  193. if (oProperties.disabled)
  194. {
  195. HTMLOut += " disabled='disabled'";
  196. }
  197. HTMLOut += "></select></td>" +
  198. "</tr>" +
  199. "<tr>" +
  200. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%;\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  201. "</tr>" +
  202. "<tr id='selectListBottomRow" + sPromptId + "'";
  203. if (oProperties.numSelectOptions == 1 && !oProperties.alwaysShowGroupingBox)
  204. {
  205. HTMLOut += " style='display:none'";
  206. }
  207. HTMLOut += ">" +
  208. "<td align='right' style=\"width:100%\" >" +
  209. "<a href='javascript:listBox" + sPromptId + ".selectAll()' class='clsLink pl'><nobr style=\"text-align:right;vertical-align:super\">" + PMT_UIM_SELECTALL + "</nobr></a>" +
  210. "&nbsp;" +
  211. "<a href='javascript:listBox" + sPromptId + ".deSelectAll()' class='clsLink pl'><nobr style=\"text-align:right;vertical-align:super\">" + PMT_UIM_DESELECTALL + "</nobr></a>" +
  212. "</td>" +
  213. "</tr>" +
  214. "</table>";
  215. JSOut = "this.listBox" + sPromptId + " = new CSelectValueSelectList(document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' + "], document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " +
  216. sErrorImg + ", " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), document.sizer" + sPromptId + ", " +
  217. oProperties.disabled + ", '" + oProperties.autoSubmitType + "', '" + sPromptId + "', " + '"' + jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  218. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('listBox" + sPromptId + "');";
  219. }
  220. //// multiselect = true -- selectUI = checkboxGroup
  221. else if (oProperties.selectUI == "checkboxGroup" || oProperties.selectUI == "radioGroup")
  222. {
  223. if (sStyle.match(/\bheight\s*:/gi)) {
  224. // Height was set for the control, reset max-height for Mozilla-based browsers.
  225. sStyle += ";max-height:inherit;";
  226. }
  227. else
  228. {
  229. // Height has not been set, set the minimum height for Mozilla-based browsers
  230. sStyle += ";min-height:20px;";
  231. }
  232. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
  233. "<tr>" +
  234. "<td><div style='" + sWidth + cssParser(oProperties.style,"font,text,color,max-height,min-height,height" + ((oProperties.range==false)?",width":K_PRMT_sEMPTY)) + "' id='selectList" + sPromptId + "'";
  235. if (oProperties.numSelectOptions != 1 || oProperties.selectUI != "checkboxGroup" || oProperties.alwaysShowGroupingBox)
  236. {
  237. HTMLOut += " class='clsCheckBoxList pv'";
  238. }
  239. HTMLOut += " oldclass='clsCheckBoxList pv'></div></td>" +
  240. "</tr>" +
  241. "<tr>" +
  242. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px;\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  243. "</tr>" +
  244. "<tr id='selectListBottomRow" + sPromptId + "'";
  245. if (oProperties.numSelectOptions == 1)
  246. {
  247. HTMLOut += " style='display:none'";
  248. }
  249. HTMLOut += ">" +
  250. "<td align='right' style=\"width:100%;white-space:nowrap;\">";
  251. if (oProperties.showParentDetails) {
  252. HTMLOut += "<a id='showParentLink" + sPromptId + "' href='javascript:checkBoxList" + sPromptId + ".showParentDetails(true)' class='clsLink pl'><nobr style=\"text-align:left;vertical-align:super\">" + PMT_UIM_SHOWPARENTDETAILS + "</nobr></a>" +
  253. "&nbsp;";
  254. }
  255. HTMLOut += "<a href='javascript:checkBoxList" + sPromptId + ".selectAll()' class='clsLink pl'><nobr style=\"text-align:right;vertical-align:super;\">" + PMT_UIM_SELECTALL + "</nobr></a>" +
  256. "&nbsp;" +
  257. "<a href='javascript:checkBoxList" + sPromptId + ".deSelectAll()' class='clsLink pl'><nobr style=\"text-align:right;vertical-align:super\">" + PMT_UIM_DESELECTALL + "</nobr></a>" +
  258. "</td>" +
  259. "</tr>" +
  260. "</table>";
  261. JSOut = "this.checkBoxList" + sPromptId + " = new CSelectValueInputList('" + sFormName + "', " + '"' + sFormElementName + '"' +
  262. ", document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " +
  263. sErrorImg + ", " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), 0, 0, " +
  264. oProperties.disabled + ", '" + oProperties.autoSubmitType + "', '" + sPromptId + "', " + oProperties.autoSubmit + ", 'checkbox', 'checkBoxList" + sPromptId + "', " +
  265. '"' + jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  266. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('checkBoxList" + sPromptId + "');";
  267. }
  268. //// multiselect = true -- selectUI = dropdown
  269. else if (oProperties.selectUI == "dropdown")
  270. {
  271. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='" + sWidth +"'>" +
  272. "<tr>" +
  273. "<td style='"+ sWidth + "'>" +
  274. "<select id='selectList" + sPromptId + "' name=" + '"' + sFormElementName + '"' + " class='clsSelectControl pv' size='1' style='" + cssParser(sStyle,"color,font,text" + ((oProperties.multi==false && oProperties.range==false)?",width":K_PRMT_sEMPTY)) + sWidth + "'";
  275. if (oProperties.disabled)
  276. {
  277. HTMLOut += " disabled='disabled'";
  278. }
  279. if (oProperties.autoSubmit)
  280. {
  281. HTMLOut += " onChange=\"setTimeout('listBox" + sPromptId + ".autoSubmit()', 100)\"";
  282. }
  283. else
  284. {
  285. HTMLOut += " onChange=\"setTimeout('listBox" + sPromptId + ".checkData()', 100)\"";
  286. }
  287. HTMLOut += ">";
  288. if (typeof oProperties.columnName == K_PRMT_sSTRING && oProperties.columnName !== K_PRMT_sEMPTY)
  289. {
  290. HTMLOut += "<option value='' selected='selected'>" + oProperties.columnName + "</option>" +
  291. "<option value='' >--------------------------------------------</option>";
  292. }
  293. HTMLOut += "</select></td>" +
  294. "</tr>" +
  295. "<tr>" +
  296. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%;\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  297. "</tr></table>";
  298. JSOut = "this.listBox" + sPromptId + " = new CSelectValueSelectList(document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' +
  299. "], document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " + sErrorImg + ", " +
  300. oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), document.sizer" + sPromptId + ", " +
  301. oProperties.disabled + ", '" + oProperties.autoSubmitType + "', '" + sPromptId + "', " + '"' + jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  302. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('listBox" + sPromptId + "');";
  303. }
  304. }
  305. else
  306. {
  307. //// multiselect = false -- selectUI = dropdown
  308. if (oProperties.selectUI == "dropdown")
  309. {
  310. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
  311. "<tr>" +
  312. "<td>" +
  313. "<select id='selectList" + sPromptId + "' name=" + '"' + sFormElementName + '"' + " class='clsSelectControl pv' size='1' style='" + sWidth + cssParser(sStyle, "color,font,text,width,height" + ((oProperties.multi==false && oProperties.range==false)?",width":K_PRMT_sEMPTY)) + "'";
  314. if (oProperties.disabled)
  315. {
  316. HTMLOut += " disabled='disabled'";
  317. }
  318. if (oProperties.autoSubmit)
  319. {
  320. HTMLOut += " onChange=\"setTimeout('listBox" + sPromptId + ".autoSubmit()', 100)\"";
  321. HTMLOut += " onmousewheel=\"cancelScroll()\"";
  322. }
  323. else
  324. {
  325. HTMLOut += " onChange=\"setTimeout('listBox" + sPromptId + ".checkData()', 100)\"";
  326. }
  327. HTMLOut += ">";
  328. if (typeof oProperties.columnName == K_PRMT_sSTRING && oProperties.columnName !== K_PRMT_sEMPTY)
  329. {
  330. HTMLOut += "<option value='' selected='selected'>" + oProperties.columnName + "</option>" +
  331. "<option value=''>--------------------------------------------</option>";
  332. }
  333. HTMLOut += "</select></td>" +
  334. "</tr>" +
  335. "<tr>" +
  336. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  337. "</tr></table>";
  338. JSOut = "this.listBox" + sPromptId + " = new CSelectValueSelectList(document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' +
  339. "], document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " + sErrorImg + ", " +
  340. oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), document.sizer" + sPromptId + ", " +
  341. oProperties.disabled + ", '" + oProperties.autoSubmitType +"', '" + sPromptId + "', " + '"' + jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  342. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('listBox" + sPromptId + "');";
  343. }
  344. //// multiselect = false -- selectUI = listBox
  345. else if (oProperties.selectUI == 'listBox')
  346. {
  347. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
  348. "<tr>" +
  349. "<td style='" + sWidth + "'>" +
  350. "<select id='selectList" + sPromptId + "' name=" + '"' + sFormElementName + '"' + " size='11' class='clsListControl pv' onChange=\"" + sAutoSubmitBehavior + "\" style='" + sWidth + cssParser(oProperties.style, "color,font,text,height" + ((oProperties.multi==false && oProperties.range==false)?",width":K_PRMT_sEMPTY)) + "'";
  351. if (oProperties.disabled)
  352. {
  353. HTMLOut += " disabled='disabled'";
  354. }
  355. HTMLOut += ">";
  356. if (!oProperties.required && typeof oProperties.columnName == K_PRMT_sSTRING && oProperties.columnName !== K_PRMT_sEMPTY)
  357. {
  358. HTMLOut += "<option value='' selected='selected'>" + oProperties.columnName + "</option>" +
  359. "<option value=''>--------------------------------------------</option>";
  360. }
  361. HTMLOut += "</select></td>" +
  362. "</tr>" +
  363. "<tr>" +
  364. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%;\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  365. "</tr></table>";
  366. JSOut = "this.listBox" + sPromptId + " = new CSelectValueSelectList(document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' +
  367. "], document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " + sErrorImg + ", " +
  368. oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), document.sizer" + sPromptId + ", " +
  369. oProperties.disabled + ", '" + oProperties.autoSubmitType +"', '" + sPromptId + "', " + '"' + jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  370. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('listBox" + sPromptId + "');";
  371. }
  372. //// multiselect = false -- selectUI = radioGroup
  373. else if (oProperties.selectUI == "radioGroup" || oProperties.selectUI == "checkboxGroup")
  374. {
  375. if (sStyle.match(/\bheight\s*:/gi)) {
  376. // Height was set for the control, reset max-height for Mozilla-based browsers.
  377. sStyle += ";max-height:inherit;";
  378. }
  379. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
  380. "<tr>" +
  381. "<td><div id='selectList" + sPromptId + "' class='clsRadioGroupList pv' oldclass='clsRadioGroupList pv' style='" + cssParser(sStyle, "color,font,text,max-height,height" + ((oProperties.multi==false && oProperties.range==false)?",width":K_PRMT_sEMPTY)) + "'></div></td>" +
  382. "</tr>" +
  383. "<tr>" +
  384. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%\"><img class='clsFeedbackSpacer' name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  385. "</tr>";
  386. if (!oProperties.required)
  387. {
  388. HTMLOut += "<tr id='selectListBottomRow" + sPromptId + "'";
  389. if (oProperties.numSelectOptions == 1)
  390. {
  391. HTMLOut += " style='display:none'";
  392. }
  393. HTMLOut += ">" +
  394. "<td align='right' style=\"width:100%\"><a href='javascript:radioList" + sPromptId + ".deSelectAll()' class='clsLink pl'><span style=\"text-align:right;vertical-align:super\"><nobr>" + PMT_UIM_DESELECT + "</nobr></span></a></td>" +
  395. "</tr>";
  396. }
  397. HTMLOut += "</table>";
  398. JSOut = "this.radioList" + sPromptId + " = new CSelectValueInputList('" + sFormName + "', " + '"' + sFormElementName + '"' +
  399. ", document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " + sErrorImg + ", " +
  400. oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), 0, 0, " +
  401. oProperties.disabled + ", '" + oProperties.autoSubmitType + "', '" + sPromptId + "', " + oProperties.autoSubmit + ", 'radio', 'radioList" + sPromptId + "', " + '"' +
  402. jsEncodeStr(oProperties.parameterName) + '", "' + getCVId(oProperties) + '");' +
  403. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('radioList" + sPromptId + "');";
  404. }
  405. }
  406. HTMLOut += "</td></tr></table></fieldset>";
  407. renderPromptControlHTML("selectValue" + sPromptId, HTMLOut);
  408. executePromptControlJS(JSOut);
  409. }
  410. function genSelectValueRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_AutoSubmitType, s_SelectUI, s_ColumnName, i_InitialState, b_Disabled, b_Required, b_AutoSubmit, b_MultiSelect, b_HideAdornments, b_SuppressExtraPromptNames, s_Style)
  411. {
  412. var oProperties = s_PromptId;
  413. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  414. {
  415. oProperties = {
  416. id: s_PromptId,
  417. formName: s_FormName,
  418. parameterName: s_ParameterName,
  419. submitType: s_SubmitType,
  420. autoSubmitType: s_AutoSubmitType,
  421. selectUI: s_SelectUI,
  422. columnName: s_ColumnName,
  423. initialState: i_InitialState,
  424. disabled: b_Disabled,
  425. required: b_Required,
  426. autoSubmit: b_AutoSubmit,
  427. multi: b_MultiSelect,
  428. hideAdornments: b_HideAdornments,
  429. supressExtraPromptNames: b_SuppressExtraPromptNames,
  430. style: s_Style };
  431. }
  432. var sPromptId = oProperties.id;
  433. if (!verifyPromptId(sPromptId)) {
  434. return;
  435. }
  436. //skin folder
  437. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  438. var sFormName = oProperties.formName;
  439. if (!sFormName) {
  440. sFormName = "forms[0]";
  441. }
  442. var sParamName = "_" + oProperties.parameterName;
  443. if (!oProperties.supressExtraPromptNames)
  444. {
  445. sParamName = "p" + sParamName;
  446. }
  447. if (!verifyPromptId(sParamName)) {
  448. return;
  449. }
  450. var sWidth = K_PRMT_sEMPTY;
  451. if( cssParser( oProperties.style, 'width' ) != K_PRMT_sEMPTY )
  452. {
  453. sWidth = 'width:100%;';
  454. }
  455. var HTMLOut = K_PRMT_sEMPTY;
  456. if (oProperties.submitType == K_PRMT_sXML) {
  457. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  458. }
  459. HTMLOut +=
  460. "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE + ',height') + "'>" +
  461. "<table border='0' cellspacing='0' cellpadding='0' style='"+sWidth+"'>" +
  462. "<tr>" +
  463. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
  464. "</tr>" +
  465. "<tr>" +
  466. "<td nowrap='nowrap'>&nbsp;</td>" +
  467. "<td style='"+sWidth+"' nowrap='nowrap' id='tdRangeFrom" + sPromptId + "'>" +
  468. "<table cellpadding='0' cellspacing='0' border='0'>" +
  469. "<tr>" +
  470. "<td valign='top'>";
  471. if (!oProperties.required)
  472. {
  473. HTMLOut +=
  474. "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/></td>" +
  475. "</td>" +
  476. "<td style='padding-left:10px;'" +
  477. " onClick='range" + sPromptId + ".fromGotFocus();'" +
  478. " onkeyup='range" + sPromptId + ".fromCheckRadioState();'" +
  479. " onkeypress='if(event)range" + sPromptId + ".fromKeyPress(event.keyCode);'>";
  480. }
  481. // selectValue prompt control for start range
  482. HTMLOut +=
  483. "<div id='selectValuerange_from" + sPromptId + "' style='"+sWidth+"'></div>" +
  484. "</td>" +
  485. "</tr>";
  486. if (!oProperties.required)
  487. {
  488. HTMLOut +=
  489. "<tr>" +
  490. "<td nowrap='nowrap' valign='top'>" +
  491. "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  492. "</td>" +
  493. "<td class='clsReadOnlyText pe' style='padding-left:10px;' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  494. PMT_RNG_LOWEST_VALUE +
  495. "</td>" +
  496. "</tr>";
  497. }
  498. HTMLOut +=
  499. "</table>" +
  500. "</td>" +
  501. "</tr>" +
  502. "<tr>" +
  503. "<td nowrap='nowrap' colspan='2'>&nbsp;</td>" +
  504. "</tr>" +
  505. "<tr>" +
  506. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
  507. "</tr>" +
  508. "<tr>" +
  509. "<td nowrap='nowrap'>&nbsp;</td>" +
  510. "<td style='"+sWidth+"' nowrap='nowrap' id='tdRangeTo" + sPromptId + "'>" +
  511. "<table cellpadding='0' cellspacing='0' border='0'>" +
  512. "<tr>" +
  513. "<td valign='top'>";
  514. if (!oProperties.required)
  515. {
  516. HTMLOut +=
  517. "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  518. "</td>" +
  519. "<td style='padding-left:10px;'" +
  520. " onClick='range" + sPromptId + ".toGotFocus();'" +
  521. " onkeyup='range" + sPromptId + ".toCheckRadioState();'" +
  522. " onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>";
  523. }
  524. // selectValue prompt control for end range
  525. HTMLOut +=
  526. "<div id='selectValuerange_to" + sPromptId + "' style='"+sWidth+"'></div>" +
  527. "</td>" +
  528. "</tr>";
  529. if (!oProperties.required)
  530. {
  531. HTMLOut +=
  532. "<tr>" +
  533. "<td nowrap='nowrap'>" +
  534. "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  535. "</td>" +
  536. "<td class='clsReadOnlyText pe' style='padding-left:10px;' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  537. PMT_RNG_HIGHEST_VALUE +
  538. "</td>" +
  539. "</tr>";
  540. }
  541. HTMLOut +=
  542. "</table>" +
  543. "</td>" +
  544. "</tr>" +
  545. "</table>" +
  546. "</fieldset>";
  547. renderPromptControlHTML("selectValue" + sPromptId, HTMLOut);
  548. var JSOut = "genSelectValueSMHTML(" + generatePromptProperties(oProperties, {
  549. id: "range_from" + sPromptId,
  550. formName: sFormName,
  551. parameterName: "range_from" + oProperties.parameterName,
  552. hideAdornments: (oProperties.required==true)?false:true,
  553. autoSubmitType: K_PRMT_sEMPTY,
  554. selectUI: 'dropdown',
  555. autoSubmit: false,
  556. style: cssParser(oProperties.style, 'background-color,color,font,text') + sWidth,
  557. suppressExtraPromptNames: true}) + ");" +
  558. "genSelectValueSMHTML(" + generatePromptProperties(oProperties, {
  559. id: "range_to" + sPromptId,
  560. formName: sFormName,
  561. parameterName: "range_to" + oProperties.parameterName,
  562. autoSubmitType: K_PRMT_sEMPTY,
  563. hideAdornments: (oProperties.required==true)?false:true,
  564. selectUI: 'dropdown',
  565. autoSubmit: false,
  566. style: cssParser(oProperties.style, 'background-color,color,font,text') + sWidth,
  567. suppressExtraPromptNames: true}) + ");";
  568. if (oProperties.required)
  569. {
  570. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' +
  571. "], null, listBoxrange_from" + sPromptId + ", null, null, listBoxrange_to" + sPromptId + ", null, null, true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
  572. }
  573. else
  574. {
  575. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' +
  576. "], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], listBoxrange_from" + sPromptId +
  577. ", null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], listBoxrange_to" + sPromptId +
  578. ", null, null, false, '" + oProperties.submitType + "', " + oProperties.initialState + ", '" + getCVId(oProperties) + "');";
  579. }
  580. var sCVObj = getCVInstance(oProperties);
  581. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
  582. sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
  583. executePromptControlJS(JSOut);
  584. }
  585. function genSelectValueRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_AutoSubmitType, s_SelectUI, s_ColumnName, i_InitialState, b_Disabled, b_Required, b_AutoSubmit, b_MultiSelect, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, i_NumSelectOptions, b_alwayShowGroupingBox)
  586. {
  587. var oProperties = s_PromptId;
  588. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  589. {
  590. oProperties = {
  591. id: s_PromptId,
  592. formName: s_FormName,
  593. parameterName: s_ParameterName,
  594. submitType: s_SubmitType,
  595. autoSubmitType: s_AutoSubmitType,
  596. selectUI: s_SelectUI,
  597. columnName: s_ColumnName,
  598. initialState: i_InitialState,
  599. disabled: b_Disabled,
  600. required: b_Required,
  601. autoSubmit: b_AutoSubmit,
  602. hideAdornments: b_HideAdornments,
  603. supressExtraPromptNames: b_SuppressExtraPromptNames,
  604. multi: b_MultiSelect,
  605. style: s_Style,
  606. numSelectOptions: i_NumSelectOptions,
  607. alwayShowGroupingBox: b_ShowGroupingBox};
  608. }
  609. var sPromptId = oProperties.id;
  610. if (!verifyPromptId(sPromptId)) {
  611. return;
  612. }
  613. //skin folder
  614. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  615. var sFormName = oProperties.formName;
  616. if (!sFormName) {
  617. sFormName = "forms[0]";
  618. }
  619. var sParamName = "_" + oProperties.parameterName;
  620. if (!oProperties.supressExtraPromptNames)
  621. {
  622. sParamName = "p" + sParamName;
  623. }
  624. if (!verifyPromptId(sParamName)) {
  625. return;
  626. }
  627. var sWidth = K_PRMT_sEMPTY;
  628. if( cssParser( oProperties.style, 'width' ) != K_PRMT_sEMPTY )
  629. {
  630. sWidth = 'width:100%;';
  631. }
  632. var sHTMLOut = K_PRMT_sEMPTY;
  633. if (oProperties.submitType == K_PRMT_sXML)
  634. {
  635. sHTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  636. }
  637. sHTMLOut += "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'><table cellpadding='0' cellspacing='0' border='0'>" +
  638. "<tr>" +
  639. // Range prompt control
  640. "<td valign='top' id='selectValuer_" + sPromptId + "' style='"+sWidth+"'></td>" +
  641. "<td valign='top' class='clsButtonLeftRightPadding'>" +
  642. "<table border='0' cellpadding='0' cellspacing='0'>" +
  643. "<tr>" +
  644. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
  645. "</tr>" +
  646. "</table>" +
  647. "<table border='0' cellpadding='2' cellspacing='0'>" +
  648. "<tr>" +
  649. "<td id='getInsertButton" + sPromptId + "'></td>" +
  650. "</tr>" +
  651. "<tr>" +
  652. "<td id='getRemoveButton" + sPromptId + "'></td>" +
  653. "</tr>" +
  654. "<tr>" +
  655. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  656. "</tr>" +
  657. "</table>" +
  658. "</td>" +
  659. "<td valign='top'>" +
  660. "<table border='0' cellspacing='0' cellpadding='0' width='100%' style='height:100%;'>" +
  661. "<tr>" +
  662. "<td class='clsControlLabel pc'>";
  663. if (oProperties.required) {
  664. sHTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  665. }
  666. sHTMLOut += PMT_UIM_CHOICES + "</td>" +
  667. "</tr>" +
  668. "<tr>" +
  669. "<td style='height:100%;' valign='top'>" +
  670. "<select name='_oLstChoices" + sPromptId + "' style='width:100%;" + cssParser(oProperties.style, "color,font,text,height") + "' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  671. "</td>" +
  672. "</tr>" +
  673. "<tr>" +
  674. "<td>" +
  675. "<div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'>" +
  676. "<img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/>" +
  677. "</div>" +
  678. "</td>" +
  679. "</tr>" +
  680. "<tr id='selectListBottomRow" + sPromptId + "'";
  681. if (oProperties.numSelectOptions == 1 && !oProperties.alwaysShowGroupingBox)
  682. {
  683. sHTMLOut += " style='display:none'";
  684. }
  685. sHTMLOut += ">" +
  686. "<td align='right' >" +
  687. "<a class='clsLink pl' href='javascript:multipleRange" + sPromptId + ".selectAll()'><nobr>" + PMT_UIM_SELECTALL + "</nobr></a>" +
  688. "&nbsp;" +
  689. "<a class='clsLink pl' href='javascript:multipleRange" + sPromptId + ".deSelectAll()'><nobr>" + PMT_UIM_DESELECTALL + "</nobr></a>" +
  690. "</td>" +
  691. "</tr>" +
  692. "</table>" +
  693. "</td>" +
  694. "</tr>" +
  695. "</table></fieldset>";
  696. renderPromptControlHTML("selectValue" + sPromptId, sHTMLOut);
  697. var sCVObj = getCVInstance(oProperties);
  698. var JSOut = "genSelectValueRangeHTML(" + generatePromptProperties(oProperties, {
  699. id: "r_" + sPromptId,
  700. formName: sFormName,
  701. parameterName: "r_" + oProperties.parameterName,
  702. autoSubmitType: K_PRMT_sEMPTY,
  703. selectUI: 'dropdown',
  704. required: false,
  705. style: cssParser(oProperties.style, 'background,color,font,text') + sWidth,
  706. suppressExtraPromptNames: true}) + ");" +
  707. "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
  708. "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
  709. "this.multipleRange" + sPromptId + " = new CMultipleRange(ranger_" + sPromptId + ", document.forms['" + sFormName + "'].elements['_oLstChoices" + sPromptId +
  710. "'], document.forms['" + sFormName + "'].elements[" + '"' + jsEncodeStr(sParamName) + '"' + "], " +
  711. oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleRangeFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", '" +
  712. sPromptId + "', document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  713. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
  714. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
  715. "multipleRange" + sPromptId + ".initChoiceList();";
  716. executePromptControlJS(JSOut);
  717. }
  718. ////////////////////////////////////////////////////////////////////
  719. // SelectWithSearch HTML generation functions
  720. ////////////////////////////////////////////////////////////////////
  721. // Function to create a select with search prompt control
  722. //
  723. // s_PromptId: The id of the prompt control (String)
  724. // s_FormName: Name of form control to submit selections to the server (String)
  725. // s_ParamName: (String)
  726. // s_SubmitType: 'default' will submit as a standard form (String)
  727. // 'XML' will convert the submission to XML and submit
  728. // s_SearchValue: String to search for (String)
  729. // s_MatchAnywhere: Match string anywhere ['true'] (String)
  730. // s_MatchAll: Match all of string ['true'] (String)
  731. // b_MultiSelect: If control can accomodate more than one value. (Boolean)
  732. // b_Required: If the control is a required field. (Boolean)
  733. // b_ShowOptions: Show search options (radio buttons) (Boolean)
  734. // b_NoResultsFound: If no results found (Boolean)
  735. // b_HideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  736. // s_Style: Style of prompt control (String)
  737. // s_EditBoxStyle: Style of control edit box (String)
  738. // s_SearchButtonStyle: Style of control button (String)
  739. // s_OptionsStyle: Style of control search options (radio buttons) (String)
  740. // s_ResultsHeaderStyle: Style of search results header (String)
  741. // s_ResultsListboxStyle: Style of search results list box (String)
  742. // s_ChoicesHeaderStyle: Style of choices header (String)
  743. // s_ChoicesListboxStyle: Style of choices list box (String)
  744. // s_SearchFunction: Allow overriding of default search functionality (String)
  745. // b_Disabled: Disable controls (Boolean)
  746. // b_CaseInsensitive: Set search case insensitive or not (Boolean)
  747. // b_ShowCondition: If the condition drop down is to be shown in the UI (Boolean)
  748. function genSelectSearchHTML (s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_SearchValue, s_MatchAnywhere, s_MatchAll, b_MultiSelect, b_Required, b_ShowOptions, b_NoResultsFound, b_HideAdornments, s_Style, s_EditBoxStyle, s_SearchButtonStyle, s_OptionsStyle, s_ResultsHeaderStyle, s_ResultsListboxStyle, s_ChoicesHeaderStyle, s_ChoicesListboxStyle, s_SearchFunction, b_Disabled, b_CaseInsensitive, b_UsePromptIdForName, b_ShowCondition)
  749. {
  750. var oProperties = s_PromptId;
  751. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  752. {
  753. oProperties = {
  754. id: s_PromptId,
  755. formName: s_FormName,
  756. parameterName: s_ParameterName,
  757. submitType: s_SubmitType,
  758. multi: b_MultiSelect,
  759. required: b_Required,
  760. showOptions: b_ShowOptions,
  761. disabled: b_Disabled,
  762. hideAdornments: b_HideAdornments,
  763. usePromptIdForName: b_UsePromptIdForName,
  764. search_caseInsensitive: b_CaseInsensitive,
  765. search_criteria: s_SearchValue,
  766. search_function: s_SearchFunction,
  767. search_matchAnywhere: s_MatchAnywhere,
  768. search_matchAll: s_MatchAll,
  769. search_showCondition: b_ShowCondition,
  770. search_showNoResultFoundString: b_NoResultsFound,
  771. style: s_Style,
  772. style_choicesHeader: s_ChoicesHeaderStyle,
  773. style_choicesListBox: s_ChoicesListboxStyle,
  774. style_editBox: s_EditBoxStyle,
  775. style_options: s_OptionsStyle,
  776. style_resultsHeader: s_ResultsHeaderStyle,
  777. style_resultsListBox: s_ResultsListboxStyle,
  778. style_searchButton: s_SearchButtonStyle };
  779. }
  780. var sPromptId = oProperties.id;
  781. var sParamName = oProperties.parameterName;
  782. if (!verifyPromptId(sPromptId) || !verifyPromptId(sParamName)) {
  783. return;
  784. }
  785. var sPromptVariablePrefix = "_sws_" + jsEncodeStr(oProperties.usePromptIdForName ? sPromptId : sParamName);
  786. //skin folder
  787. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  788. var sFormName = oProperties.formName;
  789. if (!sFormName) {
  790. sFormName = "forms[0]";
  791. }
  792. var sFormElementName = "p_" + sParamName;
  793. if (oProperties.submitType == K_PRMT_sXML)
  794. {
  795. sFormElementName = "_sws_" + sParamName + "_selectChoices" + sPromptId;
  796. }
  797. sFormElementName = jsEncodeStr(sFormElementName);
  798. var sStyleShowOptions = "display:none;";
  799. if (oProperties.showOptions) {
  800. sStyleShowOptions = "display:inline;";
  801. }
  802. var submitElementName = jsEncodeStr("p_" + sParamName);
  803. var sSearchValue = sDecodeU003( oProperties.search_criteria );
  804. var HTMLOut = "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE) + "'>";
  805. if (oProperties.submitType == K_PRMT_sXML) {
  806. HTMLOut += genHiddenInputHTML(sFormName, submitElementName, K_PRMT_sEMPTY);
  807. }
  808. if (oProperties.usePromptIdForName) {
  809. HTMLOut += genHiddenInputHTML(sFormName, "_promptIdBasedNames", "true");
  810. }
  811. HTMLOut += "<input type='hidden' name='" + sPromptVariablePrefix + "_submit' value='false'/>" +
  812. "<input type='hidden' name='" + sPromptVariablePrefix + "_selectOptions' value=''/>" +
  813. "<input type='hidden' name='" + sPromptVariablePrefix + "_showOptions' value='" + oProperties.showOptions + "'/>" +
  814. "<input type='hidden' name='" + sPromptVariablePrefix + "_matchAnywhere' value='" + oProperties.search_matchAnywhere + "'/>" +
  815. "<input type='hidden' name='" + sPromptVariablePrefix + "_matchAll' value='" + oProperties.search_matchAll + "'/>" +
  816. "<input type='hidden' name='" + sPromptVariablePrefix + "_caseInsensitive' value='" + (oProperties.search_caseInsensitive ? "true" : "false") + "'/>" +
  817. "<table border='0' cellspacing='0' cellpadding='0' " + (oProperties.disabled ? " disabled='true'" : K_PRMT_sEMPTY) + ">" +
  818. "<tr>" +
  819. "<td class='clsControlLabel pc'>" + PMT_SSM_KEYWORDSLABEL + "</td>" +
  820. "<td/>" +
  821. "</tr>" +
  822. "<tr>" +
  823. "<td class='clsDialogIntroduction pi' nowrap='nowrap' colspan='2'>" + PMT_SSM_KEYWORDTIP + "</td>" +
  824. "<td/>" +
  825. "</tr>" +
  826. "<tr>" +
  827. "<td><table border='0' cellspacing='0' cellpadding='0'>" +
  828. "<tr>" +
  829. "<td><input type='text' name='" + sPromptVariablePrefix + "_searchValue' class='clsSwsEditBox' style=\"" + oProperties.style_editBox + "\" " + (oProperties.disabled ? " disabled='true'" : "value='" + sSearchValue + "' onkeyup='search" + sPromptId + ".checkSearchButtonState();preventSubmitEvent(event)' onkeypress='return search" + sPromptId + ".catchSearch(event);' onblur=\"SetSubmitSetting('prompt')\" onfocus=\"SetSubmitSetting('search')\" onpaste='search" + sPromptId + ".enableSearchButton();preventSubmitEvent();'") + "/></td>" +
  830. "<td style=\"white-space: nowrap\">" +
  831. "<button type='button' name='searchButton" + sPromptId + "' id='searchButton" + sPromptId + "' class='clsPromptButton' style=\"" + oProperties.style_searchButton + "\"" + (oProperties.disabled ? " disabled='true'" : "onclick='search" + sPromptId + ".startSearch(); return false;' onmouseover=\"this.className='clsPromptButtonOver'\" onmouseout=\"this.className='clsPromptButton'\" onkeydown=\"if (event.keyCode == 13) {search" + sPromptId + ".startSearch(); if (window.ie) {event.cancelBubble = true; event.returnValue = false;} else {event.preventDefault(); event.stopPropagation();} return false;}\" onkeyup=\"if (window.ie) {event.cancelBubble = true; event.returnValue = false;} else {event.preventDefault(); event.stopPropagation();} return false;\" onkeypress=\"if (window.ie) {event.cancelBubble = true; event.returnValue = false;} else {event.preventDefault(); event.stopPropagation();} return false;\"") + ">" + PMT_SSM_SEARCH +
  832. "<img src='" + sSkin + "/prompting/images/prompt_search_ani.gif' name='imgBusy" + sPromptId + "' id='imgBusy" + sPromptId + "' alt='' border='0' height='16' width='15' align='top' /></button>" +
  833. "</td>" +
  834. "</tr>" +
  835. "</table></td>" +
  836. "<td/>" +
  837. "</tr>" +
  838. "<tr>" +
  839. "<td valign='top' class='clsOptions pe'><table cellpadding='3' cellspacing='0' border='0'>" +
  840. "<tr>" +
  841. "<td valign='top'><a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href=\"javascript:search" + sPromptId + ".toggleAdvanced('idAdvancedOptions" + sPromptId + "', 'imgAdvancedArrow" + sPromptId + "')\"") + " class='clsLink pl'>" + PMT_SSM_OPTIONS + "</a></td>" +
  842. "<td valign='top'><a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href=\"javascript:search" + sPromptId + ".toggleAdvanced('idAdvancedOptions" + sPromptId + "', 'imgAdvancedArrow" + sPromptId + "')\"") + "><img id='imgAdvancedArrow" + sPromptId + "' src='" + sSkin + "/prompting/images/prompt_option_expand.gif' width='10' height='10' border='0' alt='' align='top'/></a></td>" +
  843. "</tr>" +
  844. "</table></td>" +
  845. "<td/>" +
  846. "</tr>" +
  847. "<tr>" +
  848. "<td class='clsSwsOptions pe'><table border='0' id='idAdvancedOptions" + sPromptId + "' style=\"" + sStyleShowOptions + "\">" +
  849. "<tr>" +
  850. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'>";
  851. var v_sChecked = ( (oProperties.search_matchAnywhere != "true" && oProperties.search_matchAll != "true") || (!oProperties.search_matchAnywhere || !oProperties.search_matchAll) ? "checked='checked' " : "" );
  852. HTMLOut += "<input type='radio' name='swsOption" + sPromptId + "' id='swsStartAny" + sPromptId + "' " + v_sChecked + (oProperties.disabled ? " disabled='true'" : "onclick=\"search" + sPromptId + ".setOptions('false', 'false')\"") + "/>" +
  853. "</td>" +
  854. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'><label for='swsStartAny" + sPromptId + "'>" + PMT_SSM_STARTANY + "</label></td>" +
  855. "</tr>" +
  856. "<tr>" +
  857. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'>";
  858. v_sChecked = ( oProperties.search_matchAnywhere != "true" && oProperties.search_matchAll == "true" ? "checked='checked' " : "" );
  859. HTMLOut += "<input type='radio' name='swsOption" + sPromptId + "' id='swsStartAll" + sPromptId + "' " + v_sChecked + (oProperties.disabled ? " disabled='true'" : "onclick=\"search" + sPromptId + ".setOptions('false', 'true')\"") + "/>" +
  860. "</td>" +
  861. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'><label for='swsStartAll" + sPromptId + "'>" + PMT_SSM_STARTALL + "</label></td>" +
  862. "</tr>" +
  863. "<tr>" +
  864. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'>";
  865. v_sChecked = ( oProperties.search_matchAnywhere == "true" && oProperties.search_matchAll != "true" ? "checked='checked' " : "" );
  866. HTMLOut += "<input type='radio' name='swsOption" + sPromptId + "' id='swsMatchAny" + sPromptId + "' " + v_sChecked + (oProperties.disabled ? " disabled='true'" : "onclick=\"search" + sPromptId + ".setOptions('true', 'false')\"") + "/>" +
  867. "</td>" +
  868. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'><label for='swsMatchAny" + sPromptId + "'>" + PMT_SSM_CONTAINANY + "</label></td>" +
  869. "</tr>" +
  870. "<tr>" +
  871. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'>";
  872. v_sChecked = ( oProperties.search_matchAnywhere == "true" && oProperties.search_matchAll == "true" ? "checked='checked' " : "" );
  873. HTMLOut += "<input type='radio' name='swsOption" + sPromptId + "' id='swsMatchAll" + sPromptId + "' " + v_sChecked + (oProperties.disabled ? " disabled='true'" : "onclick=\"search" + sPromptId + ".setOptions('true', 'true')\"") + "/>" +
  874. "</td>" +
  875. "<td class='clsSwsOptions pe' style=\"" + oProperties.style_options + "\" valign='top'><label for='swsMatchAll" + sPromptId + "'>" + PMT_SSM_CONTAINALL + "</label></td>" +
  876. "</tr>" +
  877. "<tr>" +
  878. "<td class='clsSwsOptions pe' style=\"padding-top:10px;" + oProperties.style_options + "\" valign='top'>";
  879. HTMLOut += "<input type='checkbox' name='swsCaseInsensitive" + sPromptId + "' id='swsCaseInsensitive" + sPromptId + "' onclick=\"document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_caseInsensitive'].value=(document.getElementById('swsCaseInsensitive" + sPromptId + "').checked?'true':'false')\"";
  880. if (oProperties.search_caseInsensitive) {
  881. HTMLOut += " checked='checked'";
  882. }
  883. if (oProperties.disabled) {
  884. HTMLOut += " disabled='true'";
  885. }
  886. HTMLOut += "/></td>" +
  887. "<td class='clsSwsOptions pe' style=\"padding-top:10px;" + oProperties.style_options + "\" valign='top'><label for='swsCaseInsensitive" + sPromptId + "'>" + PMT_SSM_CASEINSENSITIVE + "</label></td>" +
  888. "</tr>" +
  889. "</table></td>" +
  890. "<td/>" +
  891. "</tr>" +
  892. "</table>";
  893. if (oProperties.search_showNoResultFoundString) {
  894. HTMLOut += "<div style=\"margin: 3px\">" + PMT_SSM_NORESULTSFOUND + "</div>";
  895. }
  896. HTMLOut += "<table border='0' cellpadding='0' cellspacing='0'>" +
  897. "<tr>" +
  898. "<td><table border='0' cellpadding='2' cellspacing='1' width='100%'>" +
  899. "<tr>" +
  900. "<td valign='top' width='50%'>";
  901. if (oProperties.multi)
  902. {
  903. HTMLOut += "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  904. "<tr>" +
  905. "<td class='clsControlLabel pc' style=\"" + oProperties.style_resultsHeader;
  906. if (oProperties.search_showCondition)
  907. {
  908. HTMLOut += ";padding-top:27px";
  909. }
  910. HTMLOut += "\">" + PMT_SSM_SEARCHRESULTS + "</td>" +
  911. "</tr>" +
  912. "<tr>" +
  913. "<td>" +
  914. "<select name='_searchResults" + sPromptId + "' size='9' class='clsSelectControl pv' style=\"" + oProperties.style_resultsListBox + cssParser(oProperties.style,"height")+ "\" multiple='multiple' onmouseup=\"setTimeout('search" + sPromptId + ".checkInsertRemove()', 100);\" onDblClick='search" + sPromptId + ".insert(search" + sPromptId + ".m_oLstResults, search" + sPromptId + ".m_oLstChoices);'" + (oProperties.disabled ? " disabled='true'" : K_PRMT_sEMPTY) + "></select>" +
  915. "</td>" +
  916. "</tr>" +
  917. "<tr>" +
  918. "<td><div style=\"min-width:200px; width:100%\"><img class='clsFeedbackSpacer' name='sizerResults" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  919. "</tr>" +
  920. "<tr>" +
  921. "<td align='right'>" +
  922. "<a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href='javascript:search" + sPromptId + ".selectAll(search" + sPromptId + ".m_oLstResults)'") + " class='clsLink pl'><nobr>" + PMT_UIM_SELECTALL + "</nobr></a>" +
  923. "&nbsp;" +
  924. "<a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href='javascript:search" + sPromptId + ".deSelectAll(search" + sPromptId + ".m_oLstResults)'") + " class='clsLink pl'><nobr>" + PMT_UIM_DESELECTALL + "</nobr></a>" +
  925. "</td>" +
  926. "</tr>" +
  927. "</table></td>" +
  928. "<td class='clsButtonLeftRightPadding'><table border='0' cellpadding='2' cellspacing='0'>" +
  929. "<tr>" +
  930. "<td id='getInsertButton" + sPromptId + "'></td>" +
  931. "</tr>" +
  932. "<tr>" +
  933. "<td id='getRemoveButton" + sPromptId + "'></td>" +
  934. "</tr>" +
  935. "<tr>" +
  936. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  937. "</tr>" +
  938. "</table></td>" +
  939. "<td align='right' valign='top' width='50%'><table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  940. "<tr>" +
  941. "<td class='clsControlLabel pc' style=\"" + oProperties.style_choicesHeader;
  942. if (oProperties.search_showCondition)
  943. {
  944. HTMLOut += ";padding-bottom:5px";
  945. }
  946. HTMLOut += "\">";
  947. if (!oProperties.hideAdornments && oProperties.required) {
  948. HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/>";
  949. }
  950. if (oProperties.search_showCondition)
  951. {
  952. HTMLOut += PMT_UIM_CONDITION + "<br/>" +
  953. "<select name='oExcludeSelectedValues'>" +
  954. "<option value='false'>" + PMT_UIM_SHOWONLY + "</option>" +
  955. "<option value='true'>" + PMT_UIM_DONOTSHOW + "</option>" +
  956. "</select>";
  957. }
  958. else
  959. {
  960. HTMLOut += PMT_UIM_CHOICES;
  961. }
  962. HTMLOut += "</td>" +
  963. "</tr>" +
  964. "<tr>" +
  965. "<td>" +
  966. "<select name=" + '"' + sFormElementName + '"' + " class='clsSelectControl pv' style=\"" + oProperties.style_choicesListBox + cssParser(oProperties.style,"height") +"\" size='9' multiple='multiple' onmouseup=\"setTimeout('search" + sPromptId + ".checkInsertRemove()', 100);\" onDblClick='search" + sPromptId + ".remove(search" + sPromptId + ".m_oLstChoices)' onkeyup='search" + sPromptId + ".catchDeleteKey(event.keyCode)'" + (oProperties.disabled ? " disabled='true'" : K_PRMT_sEMPTY) + "></select>" +
  967. "</td>" +
  968. "</tr>" +
  969. "<tr>" +
  970. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%\"><img class='clsFeedbackSpacer' name='sizerChoices" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  971. "</tr>" +
  972. "<tr>" +
  973. "<td align='right'><a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href='javascript:search" + sPromptId + ".selectAll(search" + sPromptId + ".m_oLstChoices)'") + " class='clsLink pl'><nobr>" + PMT_UIM_SELECTALL + "</nobr></a>" +
  974. "&nbsp;" +
  975. "<a " + (oProperties.disabled ? "href='#' disabled='true' onclick='return false;'" : "href='javascript:search" + sPromptId + ".deSelectAll(search" + sPromptId + ".m_oLstChoices)'") + " class='clsLink pl'><nobr>" + PMT_UIM_DESELECTALL + "</nobr></a>" +
  976. "</td>" +
  977. "</tr>" +
  978. "</table>";
  979. }
  980. else
  981. {
  982. HTMLOut += "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  983. "<tr>" +
  984. "<td class='clsControlLabel pc' style=\"" + oProperties.style_resultsHeader + "\">";
  985. if (!oProperties.hideAdornments && oProperties.required) {
  986. HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  987. }
  988. HTMLOut += PMT_UIM_CHOICE +
  989. "</td>" +
  990. "</tr>" +
  991. "<tr>" +
  992. "<td>" +
  993. "<select name=" + '"' + sFormElementName + '" id="' + sFormElementName + '"' + " size='11' class='clsSelectControl pv' style=\"" + oProperties.style_resultsListBox + "\" onchange='search" + sPromptId + ".checkData()'" + (oProperties.disabled ? " disabled='true'" : K_PRMT_sEMPTY) + "></select>" +
  994. "</td>" +
  995. "</tr>" +
  996. "<tr>" +
  997. "<td><div id='feedback" + sPromptId + "' class='clsFeedbackWidget' style=\"min-width:200px; width:100%\"><img class='clsFeedbackSpacer' name='sizerResults" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  998. "</tr>" +
  999. "</table>";
  1000. }
  1001. HTMLOut += "</td></tr></table></td></tr></table></fieldset>";
  1002. renderPromptControlHTML("selectSearch" + sPromptId, HTMLOut);
  1003. var JSOut = K_PRMT_sEMPTY;
  1004. if (oProperties.multi) {
  1005. JSOut += "genInsertButtonHTML('" + sPromptId + "', 'search" + sPromptId + ".insert(search" + sPromptId + ".m_oLstResults, search" + sPromptId + ".m_oLstChoices)', 'insertButton" + sPromptId + "');";
  1006. JSOut += "genRemoveButtonHTML('" + sPromptId + "', 'search" + sPromptId + ".remove(search" + sPromptId + ".m_oLstChoices)', 'removeButton" + sPromptId + "');";
  1007. }
  1008. JSOut += "this.search" + sPromptId + " = new CSearch(document.forms['" + sFormName + "'].elements[" + '"' + submitElementName + '"' + "],";
  1009. if (oProperties.multi) {
  1010. JSOut += " document.forms['" + sFormName + "'].elements['_searchResults" + sPromptId + "'],";
  1011. }
  1012. else {
  1013. JSOut += " document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' + "],";
  1014. }
  1015. JSOut += " document.forms['" + sFormName + "'].elements[" + '"' + sFormElementName + '"' + "]," +
  1016. " document.forms['" + sFormName + "']," +
  1017. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_searchValue']," +
  1018. " document.images['imgBusy" + sPromptId + "']," +
  1019. " '" + sPromptId + "'," +
  1020. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_showOptions']," +
  1021. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_matchAnywhere']," +
  1022. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_matchAll']," +
  1023. " " + oProperties.required + "," +
  1024. " '" + oProperties.submitType + "'," +
  1025. " document.getElementById('feedback" + sPromptId + "')," +
  1026. ( oProperties.multi ? "true" : "false" ) + "," +
  1027. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_submit']," +
  1028. " document.forms['" + sFormName + "'].elements['" + sPromptVariablePrefix + "_selectOptions']," +
  1029. " document.sizerResults" + sPromptId + "," +
  1030. ( oProperties.multi ? " document.sizerChoices" + sPromptId : "null" ) + "," +
  1031. " document.getElementById('searchButton" + sPromptId + "')," +
  1032. ( oProperties.multi ? " document.getElementById('insertButton" + sPromptId + "')" : "''" ) + "," +
  1033. ( oProperties.multi ? " document.getElementById('removeButton" + sPromptId + "')" : "''" ) + "," +
  1034. " '" + oProperties.search_function + "', '" + jsEncodeStr(sParamName) +"', '" + getCVId(oProperties) + "');";
  1035. var sCVObj = getCVInstance(oProperties);
  1036. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('search" + sPromptId + "');";
  1037. executePromptControlJS(JSOut);
  1038. }