/* *+------------------------------------------------------------------------+ *| 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. *| *+------------------------------------------------------------------------+ */ /* CMultipleDatePicker.js This script is used to provide interactivity for the multiple selectDate prompt component. This component is a combination of the date picker and a list box. */ //Constructor to create a checkboxlist component // oPicker: the date picker control // oLstChoices: the name of the select form control // oSubmit: the form control to submit selections to the server // bRequired: is this a required field true/false // sSubmitType: submit this as a standard form, or as XML // oErrorFeedback: object used to provide validation feedback // oSizer: image object used to control the minimum size of the list // oInsertButton: the insert button // oRemoveButton: the remove button function CMultipleDatePicker(oPicker, oLstChoices, oSubmit, bRequired, sSubmitType, oErrorFeedback, oSizer, oInsertButton, oRemoveButton, sCVId) { this.setCVId(sCVId); this.m_oPicker = oPicker; this.m_oLstChoices = oLstChoices; this.m_oSubmit = oSubmit; this.m_bRequired = bRequired; this.m_bValid = false; this.m_sSubmitType = sSubmitType; this.m_oErrorFeedback = oErrorFeedback; if (oInsertButton) { this.m_oInsertButton = oInsertButton; } if (oRemoveButton) { this.m_oRemoveButton = oRemoveButton; } this.checkData(); //resize the list if necessary if(oSizer) { this.m_oSizer = oSizer; this.resizeList(); } //check the states of the insert and remove buttons this.checkInsertRemove(); } CMultipleDatePicker.prototype = new CPromptControl(); //select all items function CMultipleDatePicker_selectAll() { for (var i = 0; i < this.m_oLstChoices.options.length; i++) { this.m_oLstChoices.options[i].selected = true; } //check the states of the insert and remove buttons this.checkInsertRemove(); } //remove selection from all items function CMultipleDatePicker_deSelectAll() { for (var i = 0; i < this.m_oLstChoices.options.length; i++) { this.m_oLstChoices.options[i].selected = false; } //check the states of the insert and remove buttons this.checkInsertRemove(); } //insert values from the picker control function CMultipleDatePicker_insert() { var dInsertDate = this.m_oPicker.m_dDate; if (dInsertDate) { var sDisplayValue = this.m_oPicker.sGetFormatValue(); var sUseValue = this.m_oPicker.sGetValue(); if ((sDisplayValue) && (sUseValue)) { this.m_oLstChoices.options[this.m_oLstChoices.options.length] = new Option(sDisplayValue, sUseValue, false, false); } } this.checkData(); this.resizeList(); this.resizeList(); //check the states of the insert and remove buttons this.checkInsertRemove(); } //remove selections from the list of choices function CMultipleDatePicker_remove() { this.removeSelectedChoices(); //check the states of the insert and remove buttons this.checkInsertRemove(); } //perform any special processing for the server. //this function will wrap all list items in XML. //This is required for cases where the unselected items need //to be submitted too. function CMultipleDatePicker_preProcess() { var i = 0; if (this.m_sSubmitType == K_PRMT_sXML) { var sURLValues = K_PRMT_sEMPTY; if (this.m_oLstChoices.options.length > 0) { for(i = 0; i < this.m_oLstChoices.options.length; i ++) { sURLValues += '