123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618 |
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| BI and PM: prmt
- *| (C) Copyright IBM Corp. 2002, 2011
- *|
- *| US Government Users Restricted Rights - Use, duplication or
- *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *|
- *+------------------------------------------------------------------------+
- */
- ////////////////////////////////////////////////////////////////////
- // selectInterval HTML generation functions
- ////////////////////////////////////////////////////////////////////
- // Function to create interval prompt control
- // sPromptId: The id of the prompt control (String)
- // sFormName: Name of form control to submit selections to the server (String)
- // sParameterName: Name of control element to be submitted to report server (String)
- // sSubmitType: 'default' will submit as a standard form (String)
- // 'XML' will convert the submission to XML and submit
- // sDefaultValue: Default value for prompt control. If prompt control is a range, this represents the start value of the range. (String)
- // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
- // RANGE_NO_VALUE will select lowest to highest
- // RANGE_START_VALUE will select from a particular value to highest
- // RANGE_END_VALUE will select from lowest to a particular value
- // RANGE_BOUND_VALUE will select a range
- // RANGE_EQUAL_VALUE will select a single value
- // bRequired: If the control is a required field. (Boolean)
- // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
- // bShowSeconds: Show seconds field (Boolean)
- // bShowMilliseconds: Show milliseconds field (Boolean)
- // bSuppressExtraPromptNames: Force report server to handle multiple prompt controls as a single entity (Boolean)
- // e.g. treat datetime control as a single date time, as opposed to treating date and time independntly
- // bMulti: If control can accomodate more than one value. (Boolean)
- // bRange: If control is a range. (Boolean)
- // bAllowNegative: true/false, some intervals cannot be negative. Default is false.
- // sEndValue: Optional. Only used for range controls. The end value of the range. (String)
- function genSelectIntervalHTML(sPromptId, sFormName, sParameterName, sSubmitType, sDefaultValue, iInitialState, bRequired, bHideAdornments, bShowSeconds, bShowMilliseconds, bSuppressExtraPromptNames, bMulti, bRange, bAllowNegative, sEndValue, sStyle)
- {
- var oProperties = sPromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: sPromptId,
- formName: sFormName,
- parameterName: sParameterName,
- submitType: sSubmitType,
- defaultValue: sDefaultValue,
- initialState: iInitialState,
- required: bRequired,
- hideAdornments: bHideAdornments,
- showSeconds: bShowSeconds,
- showMilliseconds: bShowMilliseconds,
- suppressExtraPromptNames: bSuppressExtraPromptNames,
- multi: bMulti,
- range: bRange,
- allowNegative: bAllowNegative,
- endValue: sEndValue,
- style: sStyle
- };
- }
- if (!oProperties.allowNegative) {
- oProperties.allowNegative = false;
- }
- if (oProperties.multi)
- {
- if (!oProperties.range) {
- genSelectIntervalMultipleHTML(oProperties);
- }
- else {
- genSelectIntervalRangeMultipleHTML(oProperties);
- }
- }
- else
- {
- if (oProperties.range) {
- genSelectIntervalRangeHTML(oProperties);
- }
- else {
- genSelectIntervalSingleHTML(oProperties);
- }
- }
- }
- 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)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- submitType: s_SubmitType,
- defaultValue: s_DefaultValue,
- required: b_Required,
- hideAdornments: b_HideAdornments,
- showSeconds: b_ShowSeconds,
- showMilliseconds: b_ShowMilliseconds,
- suppressExtraPromptNames: b_SuppressExtraPromptNames,
- allowNegative: b_AllowNegative,
- style: s_style
- };
- }
- var sPromptId = oProperties.id;
- if (!verifyPromptId(sPromptId)) {
- return;
- }
- //skin folder
- var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
- var sFormName = oProperties.formName;
- if (!sFormName) {
- sFormName = "forms[0]";
- }
- var oIntervalSeconds = null;
- if (oProperties.showSeconds || oProperties.showMilliseconds) {
- oIntervalSeconds = "document.forms['" + sFormName + "'].elements['intervalSeconds" + sPromptId + "']";
- }
- var oIntervalMilliseconds = null;
- if (oProperties.showMilliseconds) {
- oIntervalMilliseconds = "document.forms['" + sFormName + "'].elements['intervalMilliseconds" + sPromptId + "']";
- }
- var oErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
- if (oProperties.hideAdornments) {
- oErrorImg = null;
- }
- var formElementName = "p_" + oProperties.parameterName;
- if (oProperties.submitType == K_PRMT_sXML) {
- formElementName = "_oLstChoices" + sPromptId;
- }
- var submitElementName = "p_" + oProperties.parameterName;
- var HTMLOut = genHiddenInputHTML(sFormName, jsEncodeStr(formElementName), K_PRMT_sEMPTY);
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
- }
- HTMLOut += "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE) + "'><table border='0' cellpadding='0' cellspacing='0'>" +
- "<tr>";
- if (oProperties.hideAdornments) {
- HTMLOut += "<td width='10'><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='10' height='20'/></td>";
- }
- else {
- HTMLOut += "<td/>";
- }
- HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_DAYS + "</td>" +
- "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_HOURS + "</td>" +
- "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_MINUTES + "</td>";
- if (oProperties.showSeconds || oProperties.showMilliseconds) {
- HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_SECONDS + "</td>";
- }
- if (oProperties.showMilliseconds) {
- HTMLOut += "<td class='clsControlLabel pc' style='padding-right:5px;'>" + PMT_SIC_MILLISECONDS + "</td>";
- }
- HTMLOut += "</tr>" +
- "<tr><td valign='top'>";
- if (!oProperties.hideAdornments)
- {
- HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' width='10' height='20'>";
- if (oProperties.required)
- {
- HTMLOut += "<tr>" +
- "<td><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/></td>" +
- "</tr>";
- }
- HTMLOut += "<tr>" +
- "<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>" +
- "</tr>" +
- "</table>";
- }
- HTMLOut += "</td><td>" +
- "<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") + "'/>" +
- "</td>" +
- "<td>" +
- "<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") + "'/>" +
- "</td>" +
- "<td>" +
- "<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") + "'/>" +
- "</td>";
- if (oProperties.showSeconds || oProperties.showMilliseconds) {
- 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>";
- }
- if (oProperties.showMilliseconds) {
- 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>";
- }
- HTMLOut += "</tr></table></fieldset>";
- renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- 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) + "');" +
- sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('intervalControl" + sPromptId + "');";
- executePromptControlJS(JSOut);
- }
- 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)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- submitType: s_SubmitType,
- defaultValue: s_DefaultValue,
- required: b_Required,
- hideAdornments: b_HideAdornments,
- showSeconds: b_ShowSeconds,
- showMilliseconds: b_ShowMilliseconds,
- suppressExtraPromptNames: b_SuppressExtraPromptNames,
- style: s_Style,
- allowNegative: b_AllowNegative
- };
- }
- var sPromptId = oProperties.id;
- if (!verifyPromptId(sPromptId)) {
- return;
- }
- //skin folder
- var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
- var sFormName = oProperties.formName;
- if (!sFormName) {
- sFormName = "forms[0]";
- }
- var formElementName = "p_" + oProperties.parameterName;
- if (oProperties.submitType == K_PRMT_sXML) {
- formElementName = "oLstChoices" + sPromptId;
- }
- var submitElementName = "p_" + oProperties.parameterName;
- var HTMLOut = K_PRMT_sEMPTY;
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
- }
- HTMLOut += "<fieldset class='clsFieldSet' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'><table cellpadding='0' cellspacing='0' border='0'>" +
- "<tr>" +
- // Interval Single prompt control
- "<td valign='top' id='selectIntervalSingle" + sPromptId + "'></td>" +
- "<td valign='top' class='clsButtonLeftRightPadding'><table border='0' cellpadding='2' cellspacing='0'>" +
- "<tr>" +
- "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' height='20'/></td>" +
- "</tr>" +
- "<tr>" +
- "<td id='getInsertButton" + sPromptId + "'></td>" +
- "</tr>" +
- "<tr>" +
- "<td id='getRemoveButton" + sPromptId + "'></td>" +
- "</tr>" +
- "<tr>" +
- "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
- "</tr>" +
- "</table></td>" +
- "<td valign='top'>" +
- "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
- "<tr>" +
- "<td class='clsControlLabel pl'>";
- if (!oProperties.hideAdornments && oProperties.required) {
- HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
- }
- HTMLOut += PMT_UIM_CHOICES + "</td>" +
- "</tr>" +
- "<tr>" +
- "<td>" +
- "<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>" +
- "</td>" +
- "</tr>" +
- "<tr>" +
- "<td>" +
- "<div id='multipleFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div>" +
- "</td>" +
- "</tr>" +
- "<tr>" +
- "<td align='right'>" +
- "<a href='javascript:multipleIntervalPicker" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
- " " +
- "<a href='javascript:multipleIntervalPicker" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
- "</td>" +
- "</tr>" +
- "</table>" +
- "</td></tr></table></fieldset>";
- renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- var JSOut = "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
- id: "Single" + sPromptId,
- formName: sFormName,
- parameterName: "I_" + oProperties.parameterName,
- defaultValue: K_PRMT_sEMPTY,
- required: false,
- style: cssParser(oProperties.style, "background,font,text,color"),
- suppressExtraPromptNames: true}) + ");" +
- "genInsertButtonHTML('" + sPromptId + "', 'multipleIntervalPicker" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
- "genRemoveButtonHTML('" + sPromptId + "', 'multipleIntervalPicker" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
- "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) + "');" +
- sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleIntervalPicker" + sPromptId + "');" +
- sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleIntervalPicker" + sPromptId + "');";
- executePromptControlJS(JSOut);
- }
- 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)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- submitType: s_SubmitType,
- defaultValue: s_DefaultValue,
- initialState: i_InitialState,
- required: b_Required,
- hideAdornments: b_HideAdornments,
- showSeconds: b_ShowSeconds,
- showMilliseconds: b_ShowMilliseconds,
- suppressExtraPromptNames: b_SuppressExtraPromptNames,
- endValue: s_EndValue,
- style: s_Style,
- allowNegative: b_AllowNegative
- };
- }
- var sPromptId = oProperties.id;
- if (!verifyPromptId(sPromptId)) {
- return;
- }
- //skin folder
- var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
- var sFormName = oProperties.formName;
- if (!sFormName) {
- sFormName = "forms[0]";
- }
- var formElementName = "p_" + oProperties.parameterName;
- if (oProperties.submitType == K_PRMT_sXML) {
- formElementName = "_oLstChoices" + sPromptId;
- }
- var submitElementName = "p_" + oProperties.parameterName;
- var HTMLOut = K_PRMT_sEMPTY;
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
- }
- HTMLOut +=
- "<fieldset class='clsFieldSet' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE )+"'>" +
- "<table cellpadding='0' cellspacing='0' border='0'>" +
- "<tr>" +
- "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
- "</tr>" +
- "<tr>" +
- "<td nowrap='nowrap'> </td>" +
- "<td nowrap='nowrap' onClick='range" + sPromptId + ".fromGotFocus();' onkeyup='range" + sPromptId + ".fromCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".fromKeyPress(event.keyCode);'>" +
- "<table border='0' cellpadding='0' cellspacing='0'>" +
- "<tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<td valign='top'>" +
- "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>";
- }
- // Interval Single prompt control for start range
- HTMLOut +=
- "<td id='selectIntervalrange_from" + sPromptId + "'></td>" +
- "</tr>" +
- "</table>" +
- "</td>" +
- "</tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<tr>" +
- "<td nowrap='nowrap'>" +
- "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
- "</td>" +
- "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
- "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true'/>" +
- "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_LOWEST_INTERVAL + "</td>" +
- "</tr>";
- }
- HTMLOut +=
- "<tr>" +
- "<td nowrap='nowrap' colspan='2'> </td>" +
- "</tr>" +
- "<tr>" +
- "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
- "</tr>" +
- "<tr>" +
- "<td nowrap='nowrap'> </td>" +
- "<td nowrap='nowrap' onClick='range" + sPromptId + ".toGotFocus();' onkeyup='range" + sPromptId + ".toCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>" +
- "<table cellpadding='0' cellspacing='0'>" +
- "<tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<td valign='top'>" +
- "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>";
- }
- // IntervalSingle prompt control for end range
- HTMLOut +=
- "<td valign='top' id='selectIntervalrange_to" + sPromptId + "'></td>" +
- "</tr>" +
- "</table>" +
- "</td>" +
- "</tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<tr>" +
- "<td nowrap='nowrap'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/></td>" +
- "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
- "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_HIGHEST_INTERVAL + "</td>" +
- "</tr>";
- }
- HTMLOut +=
- "</table>" +
- "</fieldset>";
- renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
- var JSOut = "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
- id: "range_from" + sPromptId,
- formName: sFormName,
- parameterName: "range_from" + oProperties.parameterName,
- style: cssParser(oProperties.style, 'background,color,text,font'),
- suppressExtraPromptNames: true}) + ");" +
- "genSelectIntervalSingleHTML(" + generatePromptProperties(oProperties, {
- id: "range_to" + sPromptId,
- parameterName: "range_to" + oProperties.parameterName,
- style: cssParser(oProperties.style, 'background,color,text,font'),
- defaultValue: oProperties.endValue,
- suppressExtraPromptNames: true}) + ");";
- if (oProperties.required)
- {
- 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) + "');";
- }
- else
- {
- 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) + "');";
- }
- var sCVObj = getCVInstance(oProperties);
- JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
- sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
- executePromptControlJS(JSOut);
- }
- 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)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- submitType: s_SubmitType,
- defaultValue: s_DefaultValue,
- initialState: i_InitialState,
- required: b_Required,
- hideAdornments: b_HideAdornments,
- showSeconds: b_ShowSeconds,
- showMilliseconds: b_ShowMilliseconds,
- suppressExtraPromptNames: b_SuppressExtraPromptNames,
- endValue: s_EndValue,
- style: s_Style,
- allowNegative: b_AllowNegative
- };
- }
- var sPromptId = oProperties.id;
- if (!verifyPromptId(sPromptId)) {
- return;
- }
- //skin folder
- var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
- var sFormName = oProperties.formName;
- if (!sFormName) {
- sFormName = "forms[0]";
- }
- var formElementName = "p_" + oProperties.parameterName;
- if (oProperties.submitType == K_PRMT_sXML) {
- formElementName = "_oLstChoices" + sPromptId;
- }
- var submitElementName = "p_" + oProperties.parameterName;
- var HTMLOut = K_PRMT_sEMPTY;
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(submitElementName), K_PRMT_sEMPTY);
- }
- HTMLOut += "<fieldset class='clsFieldSet'><table cellpadding='0' cellspacing='0' border='0' style='"+ cssParser(oProperties.style, gsCSS_DEFAULT_STYLE )+"'>" +
- "<tr>" +
- // Interval Range prompt control
- "<td valign='top' id='selectIntervalrange_" + sPromptId + "'></td>" +
- "<td valign='top' class='clsButtonLeftRightPadding'>" +
- "<table border='0' cellpadding='0' cellspacing='0'>" +
- "<tr>" +
- "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
- "</tr>" +
- "</table>" +
- "<table border='0' cellpadding='2' cellspacing='0'>" +
- "<tr>" +
- "<td id='getInsertButton" + sPromptId + "'></td>" +
- "</tr>" +
- "<tr>" +
- "<td id='getRemoveButton" + sPromptId + "'></td>" +
- "</tr>" +
- "<tr>" +
- "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
- "</tr>" +
- "</table>" +
- "</td>" +
- "<td valign='top'>" +
- "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
- "<tr>" +
- "<td class='clsControlLabel pc'>";
- if (oProperties.required) {
- HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
- }
- HTMLOut += PMT_UIM_CHOICES + "</td>" +
- "</tr>" +
- "<tr>" +
- "<td>" +
- "<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>" +
- "</td>" +
- "</tr>" +
- "<tr>" +
- "<td><div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
- "</tr>" +
- "<tr>" +
- "<td align='right'>" +
- "<a href='javascript:multipleRange" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
- " " +
- "<a href='javascript:multipleRange" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
- "</td>" +
- "</tr>" +
- "</table>" +
- "</td>" +
- "</tr>" +
- "</table></fieldset>";
- renderPromptControlHTML("selectInterval" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- var JSOut = "genSelectIntervalRangeHTML(" + generatePromptProperties(oProperties, {
- id: "range_" + sPromptId,
- formName: sFormName,
- parameterName: "r_" + oProperties.parameterName,
- style: cssParser(oProperties.style, "font,text,background,color"),
- suppressExtraPromptNames: true}) + ");" +
- "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
- "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
- "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) + "');" +
- sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
- sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
- "multipleRange" + sPromptId + ".initChoiceList();";
- executePromptControlJS(JSOut);
- }
|