prmtGenIntervalHTML.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| BI and PM: prmt
  5. *| (C) Copyright IBM Corp. 2002, 2011
  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. // selectInterval HTML generation functions
  14. ////////////////////////////////////////////////////////////////////
  15. // Function to create interval 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. // sDefaultValue: Default value for prompt control. If prompt control is a range, this represents the start value of the range. (String)
  22. // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
  23. // RANGE_NO_VALUE will select lowest to highest
  24. // RANGE_START_VALUE will select from a particular value to highest
  25. // RANGE_END_VALUE will select from lowest to a particular value
  26. // RANGE_BOUND_VALUE will select a range
  27. // RANGE_EQUAL_VALUE will select a single value
  28. // bRequired: If the control is a required field. (Boolean)
  29. // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  30. // bShowSeconds: Show seconds field (Boolean)
  31. // bShowMilliseconds: Show milliseconds field (Boolean)
  32. // bSuppressExtraPromptNames: Force report server to handle multiple prompt controls as a single entity (Boolean)
  33. // e.g. treat datetime control as a single date time, as opposed to treating date and time independntly
  34. // bMulti: If control can accomodate more than one value. (Boolean)
  35. // bRange: If control is a range. (Boolean)
  36. // bAllowNegative: true/false, some intervals cannot be negative. Default is false.
  37. // sEndValue: Optional. Only used for range controls. The end value of the range. (String)
  38. function genSelectIntervalHTML(sPromptId, sFormName, sParameterName, sSubmitType, sDefaultValue, iInitialState, bRequired, bHideAdornments, bShowSeconds, bShowMilliseconds, bSuppressExtraPromptNames, bMulti, bRange, bAllowNegative, sEndValue, sStyle)
  39. {
  40. var oProperties = sPromptId;
  41. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  42. {
  43. oProperties = {
  44. id: sPromptId,
  45. formName: sFormName,
  46. parameterName: sParameterName,
  47. submitType: sSubmitType,
  48. defaultValue: sDefaultValue,
  49. initialState: iInitialState,
  50. required: bRequired,
  51. hideAdornments: bHideAdornments,
  52. showSeconds: bShowSeconds,
  53. showMilliseconds: bShowMilliseconds,
  54. suppressExtraPromptNames: bSuppressExtraPromptNames,
  55. multi: bMulti,
  56. range: bRange,
  57. allowNegative: bAllowNegative,
  58. endValue: sEndValue,
  59. style: sStyle
  60. };
  61. }
  62. if (!oProperties.allowNegative) {
  63. oProperties.allowNegative = false;
  64. }
  65. if (oProperties.multi)
  66. {
  67. if (!oProperties.range) {
  68. genSelectIntervalMultipleHTML(oProperties);
  69. }
  70. else {
  71. genSelectIntervalRangeMultipleHTML(oProperties);
  72. }
  73. }
  74. else
  75. {
  76. if (oProperties.range) {
  77. genSelectIntervalRangeHTML(oProperties);
  78. }
  79. else {
  80. genSelectIntervalSingleHTML(oProperties);
  81. }
  82. }
  83. }
  84. function genSelectIntervalSingleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, b_Required, b_HideAdornments, b_ShowSeconds, b_ShowMilliseconds, b_SuppressExtraPromptNames, b_AllowNegative, s_Style)
  85. {
  86. var oProperties = s_PromptId;
  87. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  88. {
  89. oProperties = {
  90. id: s_PromptId,
  91. formName: s_FormName,
  92. parameterName: s_ParameterName,
  93. submitType: s_SubmitType,
  94. defaultValue: s_DefaultValue,
  95. required: b_Required,
  96. hideAdornments: b_HideAdornments,
  97. showSeconds: b_ShowSeconds,
  98. showMilliseconds: b_ShowMilliseconds,
  99. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  100. allowNegative: b_AllowNegative,
  101. style: s_style
  102. };
  103. }
  104. var sPromptId = oProperties.id;
  105. if (!verifyPromptId(sPromptId)) {
  106. return;
  107. }
  108. //skin folder
  109. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  110. var sFormName = oProperties.formName;
  111. if (!sFormName) {
  112. sFormName = "forms[0]";
  113. }
  114. var oIntervalSeconds = null;
  115. if (oProperties.showSeconds || oProperties.showMilliseconds) {
  116. oIntervalSeconds = "document.forms['" + sFormName + "'].elements['intervalSeconds" + sPromptId + "']";
  117. }
  118. var oIntervalMilliseconds = null;
  119. if (oProperties.showMilliseconds) {
  120. oIntervalMilliseconds = "document.forms['" + sFormName + "'].elements['intervalMilliseconds" + sPromptId + "']";
  121. }
  122. var oErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
  123. if (oProperties.hideAdornments) {
  124. oErrorImg = null;
  125. }
  126. var formElementName = "p_" + oProperties.parameterName;
  127. if (oProperties.submitType == K_PRMT_sXML) {
  128. formElementName = "_oLstChoices" + sPromptId;
  129. }
  130. var submitElementName = "p_" + oProperties.parameterName;
  131. var HTMLOut = genHiddenInputHTML(sFormName, jsEncodeStr(formElementName), K_PRMT_sEMPTY);
  132. if (oProperties.submitType == K_PRMT_sXML) {
  133. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
  134. }
  135. HTMLOut += "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE) + "'><table border='0' cellpadding='0' cellspacing='0'>" +
  136. "<tr>";
  137. if (oProperties.hideAdornments) {
  138. HTMLOut += "<td width='10'><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='10' height='20'/></td>";
  139. }
  140. else {
  141. HTMLOut += "<td/>";
  142. }
  143. HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_DAYS + "</td>" +
  144. "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_HOURS + "</td>" +
  145. "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_MINUTES + "</td>";
  146. if (oProperties.showSeconds || oProperties.showMilliseconds) {
  147. HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_SECONDS + "</td>";
  148. }
  149. if (oProperties.showMilliseconds) {
  150. HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_MILLISECONDS + "</td>";
  151. }
  152. HTMLOut += "</tr>" +
  153. "<tr><td valign='top'>";
  154. if (!oProperties.hideAdornments)
  155. {
  156. HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' width='10' height='20'>";
  157. if (oProperties.required)
  158. {
  159. HTMLOut += "<tr>" +
  160. "<td><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/></td>" +
  161. "</tr>";
  162. }
  163. HTMLOut += "<tr>" +
  164. "<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>" +
  165. "</tr>" +
  166. "</table>";
  167. }
  168. HTMLOut += "</td><td>" +
  169. "<input type='text' class='clsIntervalWidget pt' name='intervalDays" + sPromptId + "' size='4' onkeyup='intervalControl" + sPromptId + ".checkDay()' onkeypress=\"intervalControl" + sPromptId + ".keyPress(event.keyCode, 'checkDay');\" onblur=\"intervalControl" + sPromptId + ".lostFocus(); intervalControl" + sPromptId + ".endCheckDataInterval('day')\" oncontextmenu=\"intervalControl" + sPromptId + ".startCheckDataInterval('day', 100)\" style='" + cssParser(oProperties.style, "font,text,color") + "'/>" +
  170. "</td>" +
  171. "<td>" +
  172. "<input type='text' class='clsIntervalWidget pt' name='intervalHours" + sPromptId + "' size='4' onkeyup='intervalControl" + sPromptId + ".checkHour()' onkeypress=\"intervalControl" + sPromptId + ".keyPress(event.keyCode, 'checkHour');\" onblur=\"intervalControl" + sPromptId + ".lostFocus(); intervalControl" + sPromptId + ".endCheckDataInterval('hour')\" oncontextmenu=\"intervalControl" + sPromptId + ".startCheckDataInterval('hour', 100)\" style='" + cssParser(oProperties.style, "font,text,color") + "'/>" +
  173. "</td>" +
  174. "<td>" +
  175. "<input type='text' class='clsIntervalWidget pt' name='intervalMinutes" + sPromptId + "' size='4' maxlength='2' onkeyup='intervalControl" + sPromptId + ".checkMinute()' onkeypress=\"intervalControl" + sPromptId + ".keyPress(event.keyCode, 'checkMinute');\" onblur=\"intervalControl" + sPromptId + ".lostFocus(); intervalControl" + sPromptId + ".endCheckDataInterval('minute')\" oncontextmenu=\"intervalControl" + sPromptId + ".startCheckDataInterval('minute', 100)\" style='" + cssParser(oProperties.style, "font,text,color") + "'/>" +
  176. "</td>";
  177. if (oProperties.showSeconds || oProperties.showMilliseconds) {
  178. HTMLOut += "<td><input type='text' class='clsIntervalWidget pt' name='intervalSeconds" + sPromptId + "' size='4' maxlength='2' onkeyup='intervalControl" + sPromptId + ".checkSecond()' onkeypress=\"intervalControl" + sPromptId + ".keyPress(event.keyCode, 'checkSecond');\" onblur=\"intervalControl" + sPromptId + ".lostFocus(); intervalControl" + sPromptId + ".endCheckDataInterval('second')\" oncontextmenu=\"intervalControl" + sPromptId + ".startCheckDataInterval('second', 100)\" style='" + cssParser(oProperties.style, "font,text,color") + "'/></td>";
  179. }
  180. if (oProperties.showMilliseconds) {
  181. HTMLOut += "<td><input type='text' class='clsIntervalWidget pt' name='intervalMilliseconds" + sPromptId + "' size='4' maxlength='3' onkeyup='intervalControl" + sPromptId + ".checkMillisecond()' onkeypress=\"intervalControl" + sPromptId + ".keyPress(event.keyCode, 'checkMillisecond');\" onblur=\"intervalControl" + sPromptId + ".lostFocus(); intervalControl" + sPromptId + ".endCheckDataInterval('millisecond')\" oncontextmenu=\"intervalControl" + sPromptId + ".startCheckDataInterval('millisecond', 100)\" style='" + cssParser(oProperties.style, "font,text,color") + "'/></td>";
  182. }
  183. HTMLOut += "</tr></table></fieldset>";
  184. renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
  185. var sCVObj = getCVInstance(oProperties);
  186. var JSOut = "this.intervalControl" + sPromptId + " = new CIntervalPicker(document.forms['" + sFormName + "'].elements['" + submitElementName + "'], document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['intervalDays" + sPromptId + "'], document.forms['" + sFormName + "'].elements['intervalHours" + sPromptId + "'], document.forms['" + sFormName + "'].elements['intervalMinutes" + sPromptId + "'], " + oIntervalSeconds + ", " + oIntervalMilliseconds + ", " + oErrorImg + ", 'intervalControl" + sPromptId + "', '" + oProperties.defaultValue + "', " + oProperties.required + ", '" + oProperties.submitType + "', " + oProperties.showSeconds + ", " + oProperties.showMilliseconds + ", " + oProperties.allowNegative + ", '" + getCVId(oProperties) + "');" +
  187. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('intervalControl" + sPromptId + "');";
  188. executePromptControlJS(JSOut);
  189. }
  190. function genSelectIntervalMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, b_Required, b_HideAdornments, b_ShowSeconds, b_ShowMilliseconds, b_SuppressExtraPromptNames, b_AllowNegative, s_Style)
  191. {
  192. var oProperties = s_PromptId;
  193. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  194. {
  195. oProperties = {
  196. id: s_PromptId,
  197. formName: s_FormName,
  198. parameterName: s_ParameterName,
  199. submitType: s_SubmitType,
  200. defaultValue: s_DefaultValue,
  201. required: b_Required,
  202. hideAdornments: b_HideAdornments,
  203. showSeconds: b_ShowSeconds,
  204. showMilliseconds: b_ShowMilliseconds,
  205. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  206. style: s_Style,
  207. allowNegative: b_AllowNegative
  208. };
  209. }
  210. var sPromptId = oProperties.id;
  211. if (!verifyPromptId(sPromptId)) {
  212. return;
  213. }
  214. //skin folder
  215. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  216. var sFormName = oProperties.formName;
  217. if (!sFormName) {
  218. sFormName = "forms[0]";
  219. }
  220. var formElementName = "p_" + oProperties.parameterName;
  221. if (oProperties.submitType == K_PRMT_sXML) {
  222. formElementName = "oLstChoices" + sPromptId;
  223. }
  224. var submitElementName = "p_" + oProperties.parameterName;
  225. var HTMLOut = K_PRMT_sEMPTY;
  226. if (oProperties.submitType == K_PRMT_sXML) {
  227. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
  228. }
  229. HTMLOut += "<fieldset class='clsFieldSet' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'><table cellpadding='0' cellspacing='0' border='0'>" +
  230. "<tr>" +
  231. // Interval Single prompt control
  232. "<td valign='top' id='selectIntervalSingle" + sPromptId + "'></td>" +
  233. "<td valign='top' class='clsButtonLeftRightPadding'><table border='0' cellpadding='2' cellspacing='0'>" +
  234. "<tr>" +
  235. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' height='20'/></td>" +
  236. "</tr>" +
  237. "<tr>" +
  238. "<td id='getInsertButton" + sPromptId + "'></td>" +
  239. "</tr>" +
  240. "<tr>" +
  241. "<td id='getRemoveButton" + sPromptId + "'></td>" +
  242. "</tr>" +
  243. "<tr>" +
  244. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  245. "</tr>" +
  246. "</table></td>" +
  247. "<td valign='top'>" +
  248. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  249. "<tr>" +
  250. "<td class='clsControlLabel pl'>";
  251. if (!oProperties.hideAdornments && oProperties.required) {
  252. HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  253. }
  254. HTMLOut += PMT_UIM_CHOICES + "</td>" +
  255. "</tr>" +
  256. "<tr>" +
  257. "<td>" +
  258. "<select style='"+ cssParser(oProperties.style, 'font,text,color,height') +"' name='" + formElementName + "' class='clsChoicesListBox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleIntervalPicker" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleIntervalPicker" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  259. "</td>" +
  260. "</tr>" +
  261. "<tr>" +
  262. "<td>" +
  263. "<div id='multipleFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div>" +
  264. "</td>" +
  265. "</tr>" +
  266. "<tr>" +
  267. "<td align='right'>" +
  268. "<a href='javascript:multipleIntervalPicker" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  269. "&nbsp;" +
  270. "<a href='javascript:multipleIntervalPicker" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  271. "</td>" +
  272. "</tr>" +
  273. "</table>" +
  274. "</td></tr></table></fieldset>";
  275. renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
  276. var sCVObj = getCVInstance(oProperties);
  277. var JSOut = "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
  278. id: "Single" + sPromptId,
  279. formName: sFormName,
  280. parameterName: "I_" + oProperties.parameterName,
  281. defaultValue: K_PRMT_sEMPTY,
  282. required: false,
  283. style: cssParser(oProperties.style, "background,font,text,color"),
  284. suppressExtraPromptNames: true}) + ");" +
  285. "genInsertButtonHTML('" + sPromptId + "', 'multipleIntervalPicker" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
  286. "genRemoveButtonHTML('" + sPromptId + "', 'multipleIntervalPicker" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
  287. "this.multipleIntervalPicker" + sPromptId + " = new CMultipleIntervalPicker(intervalControlSingle" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + submitElementName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  288. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleIntervalPicker" + sPromptId + "');" +
  289. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleIntervalPicker" + sPromptId + "');";
  290. executePromptControlJS(JSOut);
  291. }
  292. function genSelectIntervalRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, i_InitialState, b_Required, b_HideAdornments, b_ShowSeconds, b_ShowMilliseconds, b_SuppressExtraPromptNames, s_EndValue, b_AllowNegative, s_Style)
  293. {
  294. var oProperties = s_PromptId;
  295. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  296. {
  297. oProperties = {
  298. id: s_PromptId,
  299. formName: s_FormName,
  300. parameterName: s_ParameterName,
  301. submitType: s_SubmitType,
  302. defaultValue: s_DefaultValue,
  303. initialState: i_InitialState,
  304. required: b_Required,
  305. hideAdornments: b_HideAdornments,
  306. showSeconds: b_ShowSeconds,
  307. showMilliseconds: b_ShowMilliseconds,
  308. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  309. endValue: s_EndValue,
  310. style: s_Style,
  311. allowNegative: b_AllowNegative
  312. };
  313. }
  314. var sPromptId = oProperties.id;
  315. if (!verifyPromptId(sPromptId)) {
  316. return;
  317. }
  318. //skin folder
  319. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  320. var sFormName = oProperties.formName;
  321. if (!sFormName) {
  322. sFormName = "forms[0]";
  323. }
  324. var formElementName = "p_" + oProperties.parameterName;
  325. if (oProperties.submitType == K_PRMT_sXML) {
  326. formElementName = "_oLstChoices" + sPromptId;
  327. }
  328. var submitElementName = "p_" + oProperties.parameterName;
  329. var HTMLOut = K_PRMT_sEMPTY;
  330. if (oProperties.submitType == K_PRMT_sXML) {
  331. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
  332. }
  333. HTMLOut +=
  334. "<fieldset class='clsFieldSet' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE )+"'>" +
  335. "<table cellpadding='0' cellspacing='0' border='0'>" +
  336. "<tr>" +
  337. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
  338. "</tr>" +
  339. "<tr>" +
  340. "<td nowrap='nowrap'>&nbsp;</td>" +
  341. "<td nowrap='nowrap' onClick='range" + sPromptId + ".fromGotFocus();' onkeyup='range" + sPromptId + ".fromCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".fromKeyPress(event.keyCode);'>" +
  342. "<table border='0' cellpadding='0' cellspacing='0'>" +
  343. "<tr>";
  344. if (!oProperties.required)
  345. {
  346. HTMLOut +=
  347. "<td valign='top'>" +
  348. "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  349. "</td>";
  350. }
  351. // Interval Single prompt control for start range
  352. HTMLOut +=
  353. "<td id='selectIntervalrange_from" + sPromptId + "'></td>" +
  354. "</tr>" +
  355. "</table>" +
  356. "</td>" +
  357. "</tr>";
  358. if (!oProperties.required)
  359. {
  360. HTMLOut +=
  361. "<tr>" +
  362. "<td nowrap='nowrap'>" +
  363. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
  364. "</td>" +
  365. "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  366. "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true'/>" +
  367. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_LOWEST_INTERVAL + "</td>" +
  368. "</tr>";
  369. }
  370. HTMLOut +=
  371. "<tr>" +
  372. "<td nowrap='nowrap' colspan='2'>&nbsp;</td>" +
  373. "</tr>" +
  374. "<tr>" +
  375. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
  376. "</tr>" +
  377. "<tr>" +
  378. "<td nowrap='nowrap'>&nbsp;</td>" +
  379. "<td nowrap='nowrap' onClick='range" + sPromptId + ".toGotFocus();' onkeyup='range" + sPromptId + ".toCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>" +
  380. "<table cellpadding='0' cellspacing='0'>" +
  381. "<tr>";
  382. if (!oProperties.required)
  383. {
  384. HTMLOut +=
  385. "<td valign='top'>" +
  386. "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  387. "</td>";
  388. }
  389. // IntervalSingle prompt control for end range
  390. HTMLOut +=
  391. "<td valign='top' id='selectIntervalrange_to" + sPromptId + "'></td>" +
  392. "</tr>" +
  393. "</table>" +
  394. "</td>" +
  395. "</tr>";
  396. if (!oProperties.required)
  397. {
  398. HTMLOut +=
  399. "<tr>" +
  400. "<td nowrap='nowrap'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/></td>" +
  401. "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  402. "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  403. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_HIGHEST_INTERVAL + "</td>" +
  404. "</tr>";
  405. }
  406. HTMLOut +=
  407. "</table>" +
  408. "</fieldset>";
  409. renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
  410. var JSOut = "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
  411. id: "range_from" + sPromptId,
  412. formName: sFormName,
  413. parameterName: "range_from" + oProperties.parameterName,
  414. style: cssParser(oProperties.style, 'background,color,text,font'),
  415. suppressExtraPromptNames: true}) + ");" +
  416. "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
  417. id: "range_to" + sPromptId,
  418. parameterName: "range_to" + oProperties.parameterName,
  419. style: cssParser(oProperties.style, 'background,color,text,font'),
  420. defaultValue: oProperties.endValue,
  421. suppressExtraPromptNames: true}) + ");";
  422. if (oProperties.required)
  423. {
  424. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + submitElementName + "'], null, intervalControlrange_from" + sPromptId + ", null, null, intervalControlrange_to" + sPromptId + ", null, 'interval', true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
  425. }
  426. else
  427. {
  428. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + submitElementName + "'], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], intervalControlrange_from" + sPromptId + ", null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], intervalControlrange_to" + sPromptId + ", null, 'interval', false, '" + oProperties.submitType + "', " + oProperties.initialState + ", '" + getCVId(oProperties) + "');";
  429. }
  430. var sCVObj = getCVInstance(oProperties);
  431. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
  432. sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
  433. executePromptControlJS(JSOut);
  434. }
  435. function genSelectIntervalRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, i_InitialState, b_Required, b_HideAdornments, b_ShowSeconds, b_ShowMilliseconds, b_SuppressExtraPromptNames, s_EndValue, b_AllowNegative, s_Style)
  436. {
  437. var oProperties = s_PromptId;
  438. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  439. {
  440. oProperties = {
  441. id: s_PromptId,
  442. formName: s_FormName,
  443. parameterName: s_ParameterName,
  444. submitType: s_SubmitType,
  445. defaultValue: s_DefaultValue,
  446. initialState: i_InitialState,
  447. required: b_Required,
  448. hideAdornments: b_HideAdornments,
  449. showSeconds: b_ShowSeconds,
  450. showMilliseconds: b_ShowMilliseconds,
  451. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  452. endValue: s_EndValue,
  453. style: s_Style,
  454. allowNegative: b_AllowNegative
  455. };
  456. }
  457. var sPromptId = oProperties.id;
  458. if (!verifyPromptId(sPromptId)) {
  459. return;
  460. }
  461. //skin folder
  462. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  463. var sFormName = oProperties.formName;
  464. if (!sFormName) {
  465. sFormName = "forms[0]";
  466. }
  467. var formElementName = "p_" + oProperties.parameterName;
  468. if (oProperties.submitType == K_PRMT_sXML) {
  469. formElementName = "_oLstChoices" + sPromptId;
  470. }
  471. var submitElementName = "p_" + oProperties.parameterName;
  472. var HTMLOut = K_PRMT_sEMPTY;
  473. if (oProperties.submitType == K_PRMT_sXML) {
  474. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
  475. }
  476. HTMLOut += "<fieldset class='clsFieldSet'><table cellpadding='0' cellspacing='0' border='0' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE )+"'>" +
  477. "<tr>" +
  478. // Interval Range prompt control
  479. "<td valign='top' id='selectIntervalrange_" + sPromptId + "'></td>" +
  480. "<td valign='top' class='clsButtonLeftRightPadding'>" +
  481. "<table border='0' cellpadding='0' cellspacing='0'>" +
  482. "<tr>" +
  483. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
  484. "</tr>" +
  485. "</table>" +
  486. "<table border='0' cellpadding='2' cellspacing='0'>" +
  487. "<tr>" +
  488. "<td id='getInsertButton" + sPromptId + "'></td>" +
  489. "</tr>" +
  490. "<tr>" +
  491. "<td id='getRemoveButton" + sPromptId + "'></td>" +
  492. "</tr>" +
  493. "<tr>" +
  494. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  495. "</tr>" +
  496. "</table>" +
  497. "</td>" +
  498. "<td valign='top'>" +
  499. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  500. "<tr>" +
  501. "<td class='clsControlLabel pc'>";
  502. if (oProperties.required) {
  503. HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  504. }
  505. HTMLOut += PMT_UIM_CHOICES + "</td>" +
  506. "</tr>" +
  507. "<tr>" +
  508. "<td>" +
  509. "<select name='_oLstChoices" + sPromptId + "' class='clsChoicesListBox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)' style='"+ cssParser(oProperties.style, 'font,text,color,height') +"'></select>" +
  510. "</td>" +
  511. "</tr>" +
  512. "<tr>" +
  513. "<td><div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  514. "</tr>" +
  515. "<tr>" +
  516. "<td align='right'>" +
  517. "<a href='javascript:multipleRange" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  518. "&nbsp;" +
  519. "<a href='javascript:multipleRange" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  520. "</td>" +
  521. "</tr>" +
  522. "</table>" +
  523. "</td>" +
  524. "</tr>" +
  525. "</table></fieldset>";
  526. renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
  527. var sCVObj = getCVInstance(oProperties);
  528. var JSOut = "genSelectIntervalRangeHTML(" + generatePromptProperties(oProperties, {
  529. id: "range_" + sPromptId,
  530. formName: sFormName,
  531. parameterName: "r_" + oProperties.parameterName,
  532. style: cssParser(oProperties.style, "font,text,background,color"),
  533. suppressExtraPromptNames: true}) + ");" +
  534. "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
  535. "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
  536. "this.multipleRange" + sPromptId + " = new CMultipleRange(rangerange_" + sPromptId + ", document.forms['" + sFormName + "'].elements['_oLstChoices" + sPromptId + "'], document.forms['" + sFormName + "'].elements['" + submitElementName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleRangeFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", '" + sPromptId + "', document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  537. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
  538. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
  539. "multipleRange" + sPromptId + ".initChoiceList();";
  540. executePromptControlJS(JSOut);
  541. }