123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| BI and PM: prmt
- *| (C) Copyright IBM Corp. 2002, 2022
- *|
- *| US Government Users Restricted Rights - Use, duplication or
- *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *|
- *+------------------------------------------------------------------------+
- */
- ////////////////////////////////////////////////////////////////////
- // TextBox HTML generation functions
- ////////////////////////////////////////////////////////////////////
- // Function to create a textBox 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)
- // sDataType: ['number'|'currency'|'integer'|'natural'|'whole'|'percentage'] (String)
- // Default value is regular text.
- // 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)
- // bShowThousandSeparator: If a thousand separator is used. (Boolean)
- // bMultiLine: If prompt control can accomodate multiple lines (e.g. simple text field vs textarea) (Boolean)
- // bAllowZero: If zeroes are to be allowed. (Boolean)
- // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
- // bHideText: If text box is a password 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)
- // bReadOnly: If control is read only. (Boolean)
- // bShowCondition: If the condition drop down is to be shown in the UI (Boolean)
- // sStyle: Style of prompt control. (String)
- // sMaxLength: Maximum length for text box. (String)
- // sEndValue: Optional. Only used for range controls. The end value of the range. (String)
- function genTextBoxHTML(sPromptId, sFormName, sParameterName, sDataType, sSubmitType, sDefaultValue, iInitialState, bRequired, bShowThousandSeparator, bMultiLine, bAllowZero, bHideAdornments, bHideText, bSuppressExtraPromptNames, bMulti, bRange, bReadOnly, bShowCondition, sStyle, sMaxLength, sEndValue)
- {
- var oProperties = sPromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: sPromptId,
- formName: sFormName,
- parameterName: sParameterName,
- allowZero: bAllowZero,
- dataType: sDataType,
- defaultValue: sDefaultValue,
- endValue: sEndValue,
- initialState: iInitialState,
- hideAdornments: bHideAdornments,
- hideText: bHideText,
- maxLength: sMaxLength,
- multiLine: bMultiLine,
- multi: bMulti,
- range: bRange,
- readOnly: bReadOnly,
- required: bRequired,
- showCondition: bShowCondition,
- showThousandSeparator: bShowThousandSeparator,
- style: sStyle,
- submitType: sSubmitType,
- supressExtraPromptNames: bSuppressExtraPromptNames };
- }
- if (oProperties.multi)
- {
- if (!oProperties.range) {
- genTextBoxMultipleHTML(oProperties);
- }
- else {
- oProperties.startValue = oProperties.defaultValue;
- genTextBoxRangeMultipleHTML(oProperties);
- }
- }
- else
- {
- if (oProperties.range)
- {
- oProperties.startValue = oProperties.defaultValue;
- genTextBoxRangeHTML(oProperties);
- }
- else
- {
- genTextBoxSingleHTML(oProperties);
- }
- }
- }
- function genTextBoxSingleHTML(s_PromptId, s_FormName, s_ParameterName, s_DataType, s_SubmitType, s_DefaultValue, b_Required, b_ShowThousandSeparator, b_MultiLine, b_AllowZero, b_HideAdornments, b_HideText, b_SuppressExtraPromptNames, s_Style, s_MaxLength, b_ReadOnly)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- allowZero: b_AllowZero,
- dataType: s_DataType,
- defaultValue: s_DefaultValue,
- hideAdornments: b_HideAdornments,
- hideText: b_HideText,
- maxLength: s_MaxLength,
- multiLine: b_MultiLine,
- readOnly: b_ReadOnly,
- required: b_Required,
- showThousandSeparator: b_ShowThousandSeparator,
- style: s_Style,
- submitType: s_SubmitType,
- supressExtraPromptNames: b_SuppressExtraPromptNames };
- }
- 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 sParamName = "p_" + oProperties.parameterName;
- if (oProperties.suppressExtraPromptNames) {
- sParamName = sParamName.substring(1);
- }
- var oErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
- if (oProperties.hideAdornments) {
- oErrorImg = null;
- }
- var sFormElementName = "_textEditBox" + sPromptId;
- var sStyle = oProperties.style;
- if (sStyle.match(/margin/i) === null) {
- sStyle += ";margin:0px;";
- }
- var sWidth=K_PRMT_sEMPTY;
- if( cssParser( oProperties.style, 'width') != K_PRMT_sEMPTY )
- {
- sWidth = 'width:100%;';
- }
- var HTMLOut = genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY) +
- "<fieldset class='clsFieldSet' style='" + sWidth + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE + ((oProperties.multi==true||oProperties.range==true)?",width":K_PRMT_sEMPTY)) + "'>" +
- "<table cellpadding='0' cellspacing='0' border='0' style='"+sWidth+"'>" +
- "<tr>";
- if (!oProperties.hideAdornments)
- {
- HTMLOut +=
- "<td valign='top' width='10px'>" +
- "<table cellpadding='0' cellspacing='0' border='0'>";
- if (oProperties.required)
- {
- HTMLOut +=
- "<tr>" +
- "<td valign='top'><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' 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>" +
- "</td>";
- }
- HTMLOut +=
- "<td id='textEditBox" + sPromptId + "' style='" + sWidth + "'>";
- var sMaxLength = ( oProperties.maxLength !== K_PRMT_sEMPTY && !isNaN(oProperties.maxLength) ? " maxlength='" + oProperties.maxLength + "'" : K_PRMT_sEMPTY );
- var sCommonProperties =
- " class='clsTextWidget pt'" +
- " style='" + sWidth + cssParser(sStyle, 'color,font,text') + "'" +
- " onkeyup='textBox" + sPromptId + ".checkData();preventSubmitEvent(event)'" +
- " onKeyPress='return textBox" + sPromptId + ".keyPress(event)'" +
- " onblur='textBox" + sPromptId + ".lostFocus(); textBox" + sPromptId + ".endCheckDataInterval()'" +
- " oncontextmenu='textBox" + sPromptId + ".startCheckDataInterval(100)'";
- // Password field
- if (oProperties.hideText)
- {
- HTMLOut +=
- "<input type='password' autocomplete='off' name='" + sFormElementName + "'" + sCommonProperties + sMaxLength+ "/>";
- }
- // Single line edit box
- else if (!oProperties.multiLine)
- {
- HTMLOut +=
- "<input type='text' name='" + sFormElementName + "'" + sCommonProperties + sMaxLength+ "/>";
- }
- // Multi line edit box
- else
- {
- HTMLOut +=
- "<textarea name='" + sFormElementName + "' rows='7' cols='20'" + sCommonProperties + "></textarea>";
- }
- HTMLOut +=
- "</td>" +
- "</tr>" +
- "</table>" +
- "</fieldset>";
- renderPromptControlHTML("textBox" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- var JSOut = "this.textBox" + sPromptId + " = new CText(document.forms[\"" + sFormName + "\"].elements[\""+ alterDoubleQuote(sParamName) + "\"], document.forms[\"" + sFormName + "\"].elements[\"" + sFormElementName + "\"]," + oErrorImg + ", '" + oProperties.dataType + "', " + '"' + oProperties.defaultValue.replace(/\\/g, "\\\\") + '"' + ", " + oProperties.required + ", '" + oProperties.submitType + "', " + oProperties.multiLine + ", " + oProperties.showThousandSeparator + ", " + oProperties.allowZero + ", document.getElementById('textEditBox" + sPromptId + "'), 'textBox" + sPromptId + "', " + oProperties.readOnly + ", '" + getCVId(oProperties) + "');" +
- sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('textBox" + sPromptId + "');";
- executePromptControlJS(JSOut);
- }
- function genTextBoxMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_DataType, s_SubmitType, s_DefaultValue, b_Required, b_ShowThousandSeparator, b_MultiLine, b_AllowZero, b_HideAdornments, b_HideText, b_SuppressExtraPromptNames, b_ShowCondition, s_Style, s_MaxLength)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- allowZero: b_AllowZero,
- dataType: s_DataType,
- defaultValue: s_DefaultValue,
- hideAdornments: b_HideAdornments,
- hideText: b_HideText,
- maxLength: s_MaxLength,
- multiLine: b_MultiLine,
- required: b_Required,
- showCondition: b_ShowCondition,
- showThousandSeparator: b_ShowThousandSeparator,
- style: s_Style,
- submitType: s_SubmitType,
- supressExtraPromptNames: b_SuppressExtraPromptNames };
- }
- 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 sParamName = "p_" + oProperties.parameterName;
- if (oProperties.suppressExtraPromptNames) {
- sParamName = sParamName.substring(1);
- }
- var sFormElementName = sParamName;
- if (oProperties.submitType == K_PRMT_sXML) {
- sFormElementName = "_oLstChoices" + sPromptId;
- }
-
- var sWidth = K_PRMT_sEMPTY;
- var sFixedLayout = K_PRMT_sEMPTY;
- if( cssParser( oProperties.style, "width" ) != K_PRMT_sEMPTY )
- {
- sWidth = 'width:100%;';
- sFixedLayout = 'table-layout:fixed;';
- }
- var HTMLOut = K_PRMT_sEMPTY;
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
- }
- HTMLOut += "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE) + "'>" +
- "<table style='"+ sWidth + "' border='0' cellpadding='0' cellspacing='0'>" +
- "<tr><td colspan='3'></td><td class='clsControlLabel pc' style='vertical-align:bottom;>";
- if (oProperties.showCondition)
- {
- HTMLOut += PMT_UIM_NEWVALUE;
- }
- HTMLOut += "</td></tr><tr>";
- if (oProperties.showCondition)
- {
- HTMLOut += "<td class='clsControlLabel pc' style='padding:0px 0px 5px 5px;'>";
- }
- else
- {
- HTMLOut += "<td class='clsControlLabel pc'>";
- }
- if (!oProperties.hideAdornments && oProperties.required) {
- HTMLOut += "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10px' width='10px' border='0'/>";
- }
- if (oProperties.showCondition)
- {
- HTMLOut += PMT_UIM_CONDITION + "<br/>" +
- "<select name='oExcludeSelectedValues'>" +
- "<option value='false'>" + PMT_UIM_SHOWONLY + "</option>" +
- "<option value='true'>" + PMT_UIM_DONOTSHOW + "</option>" +
- "</select>";
- }
- else
- {
- HTMLOut += PMT_UIM_CHOICES;
- }
- HTMLOut += "</td></tr>" +
- "<tr><td valign='top' id='textBoxSingle" + sPromptId + "' style='"+ sWidth +"'></td>" +
- "<td width='5px'><img src='" + sSkin + "/prompting/images/spacer.gif' align='top' height='10' width='5' border='0'/></td>" +
- "<td valign='top' class='clsButtonLeftRightPadding' ><table border='0' cellpadding='2' cellspacing='0'>" +
- "<tr>" +
- "<td><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>" +
- "</tr></table>" +
- "</td>" +
- "<td valign='top'><table border='0' cellspacing='0' cellpadding='0'>" +
- "<tr>" +
- "<td><select name='" + sFormElementName + "' id='" + sFormElementName + "' style='" + sFixedLayout + cssParser(oProperties.style, 'color,font,text,height') + ";width:100%;overflow:scroll;' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleText" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleText" + sPromptId + ".catchDeleteKey(event.keyCode);'></select></td>" +
- "</tr>" +
- "<tr>" +
- "<td><div id='feedback" + 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:multipleText" + sPromptId + ".selectAll();' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
- " " +
- "<a href='javascript:multipleText" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
- "</td>" +
- "</tr></table>" +
- "</td></tr></table>" +
- "</fieldset>";
- renderPromptControlHTML("textBox" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- var JSOut = "genTextBoxSingleHTML(" +
- generatePromptProperties(oProperties, {
- id:"Single" + sPromptId,
- formName: sFormName,
- parameterName:"T_" + oProperties.parameterName,
- submitType: ( oProperties.submitType == K_PRMT_sNO_SUBMIT ? oProperties.submitType : K_PRMT_sEMPTY),
- defaultValue: K_PRMT_sEMPTY,
- required: false,
- style: cssParser(oProperties.style, "background,color,font-weight,font-style,font-family,text-decoration,font-size") + sWidth,
- suppressExtraPromptNames: true}) + ");" +
- "genInsertButtonHTML('" + sPromptId + "', 'multipleText" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
- "genRemoveButtonHTML('" + sPromptId + "', 'multipleText" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
- "this.multipleText" + sPromptId + " = new CMultipleTextPicker(textBoxSingle" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + sFormElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('feedback" + sPromptId + "'), document.sizer" + sPromptId + ", document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
- sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleText" + sPromptId + "');" +
- sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleText" + sPromptId + "');";
- executePromptControlJS(JSOut);
- }
- function genTextBoxRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_DataType, s_SubmitType, s_StartValue, s_EndValue, i_InitialState, b_Required, b_ShowThousandSeparator, b_MultiLine, b_AllowZero, b_HideAdornments, b_HideText, b_SuppressExtraPromptNames, s_Style, s_MaxLength)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- allowZero: b_AllowZero,
- dataType: s_DataType,
- endValue: s_EndValue,
- initialState: i_InitialState,
- hideAdornments: b_HideAdornments,
- hideText: b_HideText,
- maxLength: s_MaxLength,
- multiLine: b_MultiLine,
- required: b_Required,
- showThousandSeparator: b_ShowThousandSeparator,
- startValue: s_StartValue,
- style: s_Style,
- submitType: s_SubmitType,
- supressExtraPromptNames: b_SuppressExtraPromptNames };
- }
- 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 sParamName = "p_" + oProperties.parameterName;
- if (oProperties.suppressExtraPromptNames) {
- sParamName = sParamName.substring(1);
- }
- var HTMLOut = K_PRMT_sEMPTY;
- var sWidth = K_PRMT_sEMPTY;
- if( cssParser( oProperties.style, "width" ) != K_PRMT_sEMPTY )
- {
- sWidth = 'width:100%;';
- }
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
- }
- HTMLOut +=
- "<fieldset class='clsFieldSet' style='" + sWidth + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE) + "'>" +
- "<table border='0' cellspacing='0' cellpadding='0' style='"+ sWidth + cssParser(oProperties.style,"height") + "'>" +
- "<tr>" +
- "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
- "</tr>" +
- "<tr>" +
- "<td nowrap='nowrap'> </td>" +
- "<td style='"+ sWidth +"' nowrap='nowrap' id='tdRangeFrom" + sPromptId + "'>" +
- "<table cellpadding='0' cellspacing='0' border='0'>" +
- "<tr>" +
- "<td valign='top'>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>" +
- "<td style='padding-left:10px;'" +
- " onClick='range" + sPromptId + ".fromGotFocus();'" +
- " onkeyup='range" + sPromptId + ".fromCheckRadioState(event);'" +
- " onkeypress='if(event)range" + sPromptId + ".fromKeyPress(event.keyCode);'>";
- }
- // textBoxSingle prompt control for start range
- HTMLOut +=
- "<div style='" + sWidth + "' id='textBoxrange_from" + sPromptId + "' nowrap='nowrap'></div>" +
- "</td>" +
- "</tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<tr>" +
- "<td nowrap='nowrap'>" +
- "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>" +
- "<td class='clsReadOnlyText pe' style='padding-left:10px;' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
- PMT_RNG_LOWEST_VALUE +
- "</td>" +
- "</tr>";
- }
- HTMLOut +=
- "</table>" +
- "</td>" +
- "</tr>" +
- "<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 style='"+ sWidth +"' nowrap='nowrap' id='tdRangeTo" + sPromptId + "'>" +
- "<table cellpadding='0' cellspacing='0' border='0'>" +
- "<tr>" +
- "<td valign='top'>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>" +
- "<td style='padding-left:10px;'" +
- " onClick='range" + sPromptId + ".toGotFocus();'" +
- " onkeyup='range" + sPromptId + ".toCheckRadioState(event);'" +
- " onkeypress='if(event)range" + sPromptId + ".toKeyPress(event.keyCode);'>";
- }
- // textBoxSingle prompt control for end range
- HTMLOut +=
- "<div style='" + sWidth + "' id='textBoxrange_to" + sPromptId + "' nowrap='nowrap'></div>" +
- "</td>" +
- "</tr>";
- if (!oProperties.required)
- {
- HTMLOut +=
- "<tr>" +
- "<td nowrap='nowrap'>" +
- "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'/>" +
- "</td>" +
- "<td class='clsReadOnlyText pe' style='padding-left:10px;' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
- PMT_RNG_HIGHEST_VALUE +
- "</td>" +
- "</tr>";
- }
- HTMLOut +=
- "</table>" +
- "</td>" +
- "</tr>" +
- "</table>" +
- "</fieldset>";
- renderPromptControlHTML("textBox" + sPromptId, HTMLOut);
- var JSOut = "genTextBoxSingleHTML(" + generatePromptProperties(oProperties, {
- id:"range_from" + sPromptId,
- formName: sFormName,
- parameterName:"range_from" + oProperties.parameterName,
- submitType: ( oProperties.submitType == K_PRMT_sNO_SUBMIT ? oProperties.submitType : K_PRMT_sEMPTY),
- defaultValue: oProperties.startValue,
- multiLine: false,
- allowZero: true,
- hideText: false,
- hideAdornments:true,
- style: cssParser(oProperties.style, 'background,color,font,text') + sWidth,
- suppressExtraPromptNames: true}) + ");" +
- "genTextBoxSingleHTML(" + generatePromptProperties(oProperties, {
- id:"range_to" + sPromptId,
- formName: sFormName,
- parameterName:"range_to" + oProperties.parameterName,
- submitType: ( oProperties.submitType == K_PRMT_sNO_SUBMIT ? oProperties.submitType : K_PRMT_sEMPTY),
- defaultValue: oProperties.endValue,
- multiLine: false,
- hideAdornments:true,
- allowZero: true,
- hideText: false,
- style: cssParser(oProperties.style, 'background,color,font,text') + sWidth,
- suppressExtraPromptNames: true}) + ");";
- if (oProperties.required) {
- JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + alterDoubleQuote(sParamName) + "'], null, textBoxrange_from" + sPromptId + ", null, null, textBoxrange_to" + sPromptId + ", null, '" + oProperties.dataType + "', true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
- }
- else {
- JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + alterDoubleQuote(sParamName) + "'], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], textBoxrange_from" + sPromptId + ", null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], textBoxrange_to" + sPromptId + ", null, '" + oProperties.dataType + "', 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 genTextBoxRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_DataType, s_SubmitType, s_StartValue, s_EndValue, i_InitialState, b_Required, b_ShowThousandSeparator, b_MultiLine, b_AllowZero, b_HideAdornments, b_HideText, b_SuppressExtraPromptNames, s_Style, s_MaxLength)
- {
- var oProperties = s_PromptId;
- if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
- {
- oProperties = {
- id: s_PromptId,
- formName: s_FormName,
- parameterName: s_ParameterName,
- allowZero: b_AllowZero,
- dataType: s_DataType,
- endValue: s_EndValue,
- initialState: i_InitialState,
- hideAdornments: b_HideAdornments,
- hideText: b_HideText,
- maxLength: s_MaxLength,
- multiLine: b_MultiLine,
- required: b_Required,
- showThousandSeparator: b_ShowThousandSeparator,
- startValue: s_StartValue,
- style: s_Style,
- submitType: s_SubmitType,
- supressExtraPromptNames: b_SuppressExtraPromptNames };
- }
- 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 sParamName = "p_" + oProperties.parameterName;
- if (oProperties.suppressExtraPromptNames) {
- sParamName = sParamName.substring(1);
- }
- var sFixedLayout = K_PRMT_sEMPTY;
- var sWidth = K_PRMT_sEMPTY;
- if( cssParser( oProperties.style, "width" ) != K_PRMT_sEMPTY )
- {
- sWidth = 'width:100%;';
- sFixedLayout = "table-layout:fixed;";
- }
- var HTMLOut = K_PRMT_sEMPTY;
- if (oProperties.submitType == K_PRMT_sXML) {
- HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
- }
- HTMLOut += "<fieldset class='clsFieldSet' style='" + cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'>";
- HTMLOut += "<table cellpadding='0' cellspacing='0' border='0' style='"+sFixedLayout+ cssParser(oProperties.style,"height") + "'>" +
- "<tr>" +
- // textBoxRange prompt control
- "<td valign='top' align='left' id='textBoxr_" + sPromptId + "' style='" + sWidth + "'></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 + "' style='" + sFixedLayout + cssParser(oProperties.style, 'color,font,text,height') + "' class='clsChoicesListbox pv' multiple='multiple' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" size='7' onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)'></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' nowrap>" +
- "<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("textBox" + sPromptId, HTMLOut);
- var sCVObj = getCVInstance(oProperties);
- var JSOut = "genTextBoxRangeHTML(" + generatePromptProperties(oProperties, {
- id: "r_" + sPromptId,
- formName: sFormName,
- parameterName: "r_" + oProperties.parameterName,
- startValue: K_PRMT_sEMPTY,
- endValue: K_PRMT_sEMPTY,
- style: cssParser(oProperties.style, 'background,color,font,text') + sWidth,
- required: false,
- suppressExtraPromptNames: false}) + ");" +
- "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
- "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
- "this.multipleRange" + sPromptId + " = new CMultipleRange(ranger_" + sPromptId + ", document.forms['" + sFormName + "'].elements['_oLstChoices" + sPromptId + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + 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);
- }
|