12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- define(function () {
- "use strict";
- function validatePromptValue() {
- };
- validatePromptValue.prototype.draw = function (oControlHost) {
- //this.m_sName = oControlHost.configuration.name || "listBoxPL";
- var el = oControlHost.container;
- el.innerHTML =
- '<style>' +
- '.MyPromptButton' +
- '{' +
- 'background-color: white;' +
- 'border: 2px solid #4178BE;' +
- 'color: #4178be;' +
- 'font-size: 14px;' +
- 'height: 32px;' +
- 'width: 120px;' +
- 'margin-left: 20px;' +
- 'cursor: pointer;' +
- '} ' +
- '.MyPromptButton:hover' +
- '{' +
- 'background-color: #4178BE;' +
- 'color: white;' +
- '}' +
- '</style>' +
- '<button class="MyPromptButton btn1">Finish</button>' +
- '<button class="MyPromptButton btn2">Cancel</button>';
- el.querySelector(".btn1").onclick = this.MyPromptButtonFinishClick.bind(this, oControlHost);
- el.querySelector(".btn2").onclick = oControlHost.cancel.bind(oControlHost);
- };
- validatePromptValue.prototype.MyPromptButtonFinishClick = function (oControlHost) {
- var productLinePrompt = oControlHost.page.getControlByName("listBoxPL");
- var plValues = productLinePrompt.getValues();
- if (plValues && plValues.length > 2) {
- alert("You cannot select more than 2 Product lines.");
- return false;
- }
- else {
- // Submit the prompt values calling the finish method
- oControlHost.finish()
- }
- };
- return validatePromptValue;
- });
|