12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577 |
- NONE_EDIT = 0;
- POPUP_SEARCH = 1;
- NOPOPUP_SEARCH = 2;
- INPUT = 3;
- POPUP_INPUT = 4;
- XFormsSelect1.prototype = new XFormsSelect;
- function XFormsSelect1 (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strCellspacing, strClass, strCols, strDirection,
- bDisabled, bDragmode, bDropmode, bEditmenu, strEditmode, strId, nItemcount, strItemheight, strItemwidth, nNavindex, strOverflow,
- strPastemode, strRef, strRows, strScroll, strSep, strShowEffect, bShowvalue, strStyle, strTag, strVcellspacing, strVisibility, nItemIndex,
- bIsItemSet, strNodeSet, strLabelRef, strValueRef, strAppearance, strUserDefineAttrib, strUserStaticValue)
- {
- if (!strId)
- {
- return;
- }
-
- if ("minimal" == strAppearance)
- {
- this.m_heComboboxInput = document.getElementById("HE_" + strId + ".input");
- }
-
- XFormsSelect.call(this, strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strCellspacing, strClass, strCols, strDirection,
- bDisabled, bDragmode, bDropmode, strId, strItemheight, strItemwidth, nNavindex, strOverflow, strRef, strRows, strScroll, strSep,
- strShowEffect, strStyle, strTag, strVcellspacing, strVisibility, nItemIndex, bIsItemSet, strNodeSet, strLabelRef, strValueRef, strAppearance, strUserDefineAttrib, strUserStaticValue);
-
- this.m_bShowItemList = false;
- this.m_nComboButtomPoint = 0;
- /**
- * Attribute
- */
- this.attribute["editmenu"] = String(bEditmenu);
- this.attribute["editmode"] = strEditmode;
- this.attribute["itemcount"] = String(nItemcount);
- this.attribute["pastemode"] = strPastemode;
- this.attribute["showvalue"] = String(bShowvalue);
- this.selectImage = __getAppName() + "/kr/comsquare/image/radio/radio.gif";
- this.unSelectImage = __getAppName() + "/kr/comsquare/image/radio/unradio.gif";
- this.disSelectImage = __getAppName() + "/kr/comsquare/image/radio/disradio.gif";
- this.disUnSelectImage = __getAppName() + "/kr/comsquare/image/radio/disunradio.gif";
-
- this.m_objInput;
- this.m_objButtion;
-
- this.m_bButtonClick = false;
-
- this.m_bSelect;
- //select1의 cell이 선택되어 있는지를 판한하는 멤버변수
- this.m_bIsSelectedCell = false;
- //그리드 콤보일때
- this.m_bGridCombo = false;
- //itemset의 height
- this.m_bItemCount = "data";
- this.m_nItemSetHeight;
- };
- XFormsSelect1.prototype.init = function ()
- {
- XFormsGroup.prototype.init.call(this);
-
- var strAttribute = "";
- var strAppearance = this.getAttribute("appearance");
- if ("full" == strAppearance) // radio
- {
- strAttribute = "id:" + this.id +".item; padding-left:16px; background-image:"+ this.unSelectImage + "; background-position:center left 2px 0px; select.background-image:" + this.selectImage + "; disable.background-image:" + this.disUnSelectImage + "; disable.select.background-image:" + this.disSelectImage + "; border-style:none; word-wrap:none; text-rect:visible;";
- }
- else if ("minimal" == strAppearance) // combo
- {
- strAttribute = "id:" + this.id +".item; padding-left:2px; select.background-color:#000064; select.color:white; border-style:none; word-wrap:none;";
-
- this.m_objInput = new XFormsInput(this.id, "", "", "", "", false, "", "", this.disabled,
- false, false, this.isEditable(), false, "", this.id + ".input", "", "", "",
- "", "", -1, -1, -1, "", "", "", false, "", -1, "", "", false, false, "", "xforms:comboinput", false, "visible");
- this.m_objInput.m_bDependentCtl = true;
- this.m_objButton = new XFormsButton(this.id, "", "", "", "", "", false, "", "", this.disabled, false,
- "", "", "", this.id + ".button", -1, "", "", -1, false, "", "xforms:combobutton", "visible");
- this.m_objButton.m_bDependentCtl = true;
- }
- else // list [not multiselection]
- {
- strAttribute = "id:" + this.id +".item; padding-left:2px; select.background-color:darkblue; select.color:white; border-style:none; word-wrap:none; focus-rect:visible;";
- }
- this.m_objItem = this.createChild("xforms:selectitem", strAttribute);
-
- this.choices = new XFormsChoices(this.id, this.id + ".choices", "xforms:choices");
-
- if (this.isnodeset)
- {
- var objItemset = new XFormsItemset(this.id + ".choices", this.id + ".itemset", "xforms:itemset");
- objItemset.setAttribute("nodeset", this.nodeset);
-
- var objLabel = new XFormsLabel(this.id + ".itemset", this.id + ".label", "xforms:label");
- objLabel.setAttribute("ref", this.labelref);
-
- var objValue = new XFormsValue(this.id + ".itemset", this.id + ".value", "xforms:value");
- objValue.setAttribute("ref", this.valueref);
-
- objItemset.setLabel(objLabel);
- objItemset.setValue(objValue);
-
- this.choices.setItemset(objItemset);
-
- this.initItemset();
- }
- else
- {
- if ("minimal" == strAppearance)
- {
- var heItemList = document.getElementById("HE_" + this.id + "_allitem");
- if (null != heItemList)
- {
- document.body.appendChild(heItemList);
- if (null == this.m_nItemSetHeight)
- {
- this.m_nItemSetHeight = heItemList.clientHeight;
- }
- if(!is_smartphone)
- {
- heItemList.setAttribute("U_D_C_S","combo");
- }
- heItemList.style.height = "0px";
- if (is_smartphone)
- {
- heItemList.style.overflow = "hidden";
- }
- }
- }
- if(null != this.m_strUserStaticValue && "" != this.m_strUserStaticValue)
- {
- this.htStaticValue = new Hashtable();
- var arCellList = this.m_strUserStaticValue.split("|");
- for (var i=0; i<arCellList.length; i++)
- {
- if (-1 != arCellList[i].indexOf("^"))
- {
- var arCellLabelAndValue = arCellList[i].split("^");
- var strCellName = arCellLabelAndValue[0];
- arCellLabelAndValue.shift();
- this.htStaticValue[strCellName] = arCellLabelAndValue;
- var objItemset = new XFormsItemset(this.id + ".choices", this.id + ".item." + i, "xforms:item");
-
- var objLabel = new XFormsLabel(this.id + ".itemset", this.id + ".label." + i, "xforms:label");
- objLabel.setAttribute("text", arCellLabelAndValue[0]);
-
- var objValue = new XFormsValue(this.id + ".itemset", this.id + ".value." + i, "xforms:value");
- objValue.setAttribute("text", arCellLabelAndValue[1]);
-
- objItemset.setLabel(objLabel);
- objItemset.setValue(objValue);
- }
- }
- }
- }
-
- this.makeCell();
-
- var arKeyset = this.children.keys();
- for (var i=0; i<arKeyset.length; i++)
- {
- var strChild = arKeyset[i];
- var objChild = this.children.item(strChild);
- if (null != objChild)
- {
- objChild.init();
- if (!this.isnodeset && null != objChild.m_heControl && "xforms:cell" == objChild.getAttribute("tag"))
- {
- objChild.m_heControl.setAttribute("name", this.id + "_item");
- objChild.m_heControl.setAttribute("label", this.htStaticValue[objChild.id][0]);
- objChild.m_heControl.setAttribute("value", this.htStaticValue[objChild.id][1]);
- objChild.m_heControl.noWrap = true;
- }
- }
- }
- this.m_heItemList = document.getElementById("HE_" + this.id + "_allitem");
- if (null != this.m_heItemList)this.m_heItemList.setAttribute("parentId", "true");
- this.resizeControl();
- };
- XFormsSelect1.prototype.reBuild = function ()
- {
- XFormsSelect.prototype.reBuild.call(this);
- };
- XFormsSelect1.prototype.refresh = function ()
- {
- XFormsSelect.prototype.refresh.call(this);
-
- if ("minimal" == this.attribute["appearance"])
- {
- var strText = this.label;
- if (null == this.label)
- {
- strText = "";
- this.label = "";
- }
- else
- {
- if ("true" == this.getAttribute("showvalue"))
- {
- strText = " [" + this.value + "] " + strText;
- }
- }
- this.m_objInput.setWindowText(strText);
- }
- };
- XFormsSelect1.prototype.setSelectImage = function (strImage)
- {
- // Property 변경
- this.selectImage = strImage;
-
- this.m_objItem.setAttribute("select.background-image", strImage);
-
- this.refresh();
- };
- XFormsSelect1.prototype.setUnSelectImage = function (strImage)
- {
- // Property 변경
- this.unSelectImage = strImage;
-
- this.m_objItem.setAttribute("background-image", strImage);
-
- this.refresh();
- };
- XFormsSelect1.prototype.setDisSelectImage = function(strImage)
- {
- // Property 변경
- this.disSelectImage = strImage;
-
- this.m_objItem.setAttribute("disable.select.background-image", strImage);
-
- this.refresh();
- };
- XFormsSelect1.prototype.setDisUnSelectImage = function(strImage)
- {
- // Property 변경
- this.disUnSelectImage = strImage;
- this.m_objItem.setAttribute("disable.background-image", strImage);
-
- this.refresh();
- };
- XFormsSelect1.prototype.getEditMode = function ()
- {
- var strEditMode = this.getAttribute("editmode");
- switch (strEditMode)
- {
- case "search" : return POPUP_SEARCH;
- case "nopopupsearch" : return NOPOPUP_SEARCH;
- case "input" : return INPUT;
- case "inputsearch" : return POPUP_INPUT;
- default : return NONE_EDIT;
- }
- };
- XFormsSelect1.prototype.setAttribute = function (strAttribute, strValue)
- {
- XFormsSelect.prototype.setAttribute.call(this, strAttribute, strValue);
- switch (strAttribute)
- {
- case "left":
- {
- if ("minimal" == this.attribute["appearance"])
- {
- var strCtrlLeft = isFinite(strValue) ? strValue + "px" : strValue;
- this.m_heItemList.style.left = strCtrlLeft;
- }
- break;
- }
- case "editmenu" :
- {
- this.attribute["editmenu"] = strValue;
- break;
- }
- case "editmode" :
- {
- this.attribute["itemwidth"] = strEditmode;
- break;
- }
- case "itemcount" :
- {
- this.attribute["overflow"] = strValue;
- break;
- }
- case "pastemode" :
- {
- this.attribute["pastemode"] = strValue;
- break;
- }
- case "showvalue" :
- {
- this.attribute["showvalue"] = strValue;
- break;
- }
- }
- };
- XFormsSelect1.prototype.setDisabled = function (bDisabled, bParentDis)
- {
- XFormsSelect.prototype.setDisabled.call(this, bDisabled, bParentDis);
-
- if ("minimal" == this.attribute["appearance"])
- {
- this.showItemList(false);
- }
- };
- XFormsSelect1.prototype.applyDefaultStyle = function ()
- {
- XFormsSelect.prototype.applyDefaultStyle.call(this);
- if ("minimal" == this.getAttribute("appearance") && !this.attribute["border-style"])
- {
- HtmlLib.setStyleFront(this.m_heControl, "border-style", "solid");
- }
- };
- /**
- * combobox 관련 Function
- */
- XFormsSelect1.prototype.defaultAction = function (strEventName, event)
- {
- XFormsSelect.prototype.defaultAction.call(this, strEventName, event);
-
- if ("onglobalmousedown" == strEventName)
- {
- this.showItemList(false);
- }
- };
- //컨트롤 생성시 스타일을 초기화 한다
- XFormsSelect1.prototype.prepareStyle = function ()
- {
- XFormsSelect.prototype.prepareStyle.call(this);
- };
- XFormsSelect1.prototype.showItemList = function (bShow)
- {
- this.m_bShowItemList = bShow;
- if (this.m_heItemList)
- {
- if (bShow && !this.disabled)
- {
- this.m_heItemList.style.visibility = "visible";
- if (is_smartphone)
- {
- this.m_heItemList.style.height = null;
- this.m_heItemList.style.overflow = "visible";
- }
- else
- {
- if ("data" == this.m_bItemCount)
- {
- this.m_heItemList.style.height = this.m_nItemSetHeight + "px";
- }
- else if (this.m_bItemCount)
- {
- this.m_heItemList.style.height = this.m_nItemSetHeight + "px";
- this.m_heItemList.style.overflowX = "visible";
- this.m_heItemList.style.overflowY = "scroll";
- }
- else
- {
- this.m_heItemList.style.height = null;
- this.m_heItemList.style.overflow = "visible";
- this.m_heItemList.style.overflowX = "visible";
- this.m_heItemList.style.overflowY = "visible";
-
- }
- }
- //window resize 허용안함
- window.setPermitResize(false);
- //alert((this.getClientLeft(true) + this.m_heItemList.offsetWidth) +":"+ viewportwidth);
- if ( this.getClientLeft(true) + this.m_heItemList.offsetWidth > viewportwidth)
- {
- this.m_heItemList.style.left = (this.getClientLeft(true) + (this.m_heControl.offsetWidth - this.m_heItemList.offsetWidth))+"px";
- }else
- {
- this.m_heItemList.style.left = this.getClientLeft(true)+"px";
- }
- //콤보리스트가 상단으로 열리도록 처리 (현재는 document 사이즈를 미리 늘려 놓음)
- //if ( this.getClientTop(true) + this.m_heItemList.offsetHeight > viewportheight)
- //{
- // this.m_heItemList.style.top = (this.getClientTop(true) - (this.m_heControl.offsetHeight + this.m_heItemList.offsetHeight))+"px";
- //}
- //else
- //{
- this.m_heItemList.style.top = (this.getClientTop(true)+this.m_heControl.offsetHeight)+"px";
- //}
- //window resize 허용
- window.setPermitResize(true);
-
- }
- else
- {
- this.m_heItemList.style.visibility = "hidden";
- if (is_smartphone)
- {
- this.m_heItemList.style.height = "0px";
- this.m_heItemList.style.overflow = "hidden";
- }
- else
- {
- this.m_heItemList.style.height = "0px";
- if (!this.m_bItemCount)
- {
- this.m_heItemList.style.overflow = "hidden";
- }
- }
-
- }
- }
- };
- XFormsSelect1.prototype.setValueToInput = function (strValue, strLabel)
- {
- // if ("true" == this.attribute["showvalue"])
- // {
- // this.m_heComboboxInput.value = " [" + strValue + "] " + strLabel;
- // }
- // else
- // {
- // this.m_heComboboxInput.value = strLabel;
- // }
- };
- XFormsSelect1.prototype.setMousePointOverColor = function (heSelectItem)
- {
- // for (var i=0 ; i < this.length ; i++)
- // {
- // if (heSelectItem.id == this.m_arItem[i].id)
- // {
- // this.m_arItem[i].setAttribute("color", this.pointcolor);
- // this.m_arItem[i].setAttribute("background-color", this.pointbgcolor);
- // }
- // else
- // {
- // this.m_arItem[i].initStyle("color");
- // this.m_arItem[i].initStyle("background-color");
- // }
- // }
- };
- XFormsSelect1.prototype.isEditable = function ()
- {
- return (this.getEditMode() != NONE_EDIT);
- };
- XFormsSelect1.prototype.applySelection = function (strValue)
- {
- this.clearSelect();
- this.label = null;
- this.value = strValue;
-
- if (null != strValue)
- {
- strValue = strValue.trim();
- var objCell = this.getCell(this.m_nSelectedRow, this.m_nSelectedCol);
- if (null != objCell && null != objCell.m_heControl && strValue == objCell.getValue())
- {
- objCell.setSelect(true);
- this.label = objCell.getLabel();
- this.m_bIsSelectedCell = true;
- return;
- }
- else
- {
- for (var i=0; i<this.m_nRows; i++)
- {
- for (var j=0; j<this.m_nCols; j++)
- {
- objCell = this.getCell(i, j);
- if (null != objCell && null != objCell.m_heControl && strValue == objCell.getValue())
- {
- objCell.setSelect(true);
- this.label = objCell.getLabel();
- this.m_bIsSelectedCell = true;
- return;
- }
- }
- }
- }
- }
- };
- XFormsSelect1.prototype.initItemset = function ()
- {
- if (this.m_heItemList)
- {
- if (null != this.m_heItemList.firstChild)
- {
- this.m_heItemList.removeChild(this.m_heItemList.firstChild);
- }
- }
- var strAppearance = this.getAttribute("appearance");
- if ("minimal" == strAppearance)
- {
-
- var strNodeSet = this.nodeset;
- // nodeset 마지막이 "/"로 끝날경우 마지막 "/" 삭제
- if ((strNodeSet.length-1) == strNodeSet.lastIndexOf("/"))
- {
- strNodeSet = strNodeSet.substring(0, strNodeSet.length-1);
- }
-
- // Label
- var strLabelRef = this.labelref;
- // 시작이 /로 시작해도 nodeset 다음 노드부터 시작.
- if (0 == strLabelRef.indexOf("/"))
- {
- strLabelRef = strLabelRef.substring(1);
- }
- var arLabelRefPath = strLabelRef.split("/");
- if (1 != arLabelRefPath.length)
- {
- for (var i=0; i<arLabelRefPath.length-1; i++)
- {
- strNodeSet = strNodeSet + "/" + arLabelRefPath[i];
- }
- strLabelRef = arLabelRefPath[arLabelRefPath.length-1];
- }
-
- // Value
- var strValueRef = this.valueref;
- // 시작이 /로 시작해도 nodeset 다음 노드부터 시작.
- if (0 == strValueRef.indexOf("/"))
- {
- strValueRef = strValueRef.substring(1);
- }
- var arValueRefPath = strValueRef.split("/");
- if (1 != arValueRefPath.length)
- {
- strValueRef = arValueRefPath[arValueRefPath.length-1];
- }
-
- var xlItemSet = model.getInstancePart(null, strNodeSet);
- this.m_heComboboxImg = document.getElementById(this.id + "_img");
- this.m_heControl = document.getElementById("HE_" + this.id);
-
- var strStyleWidth = this.m_heControl.style.width;
- var strStyleheight = this.m_heControl.style.height;
-
- this.itemLength = 0;
- this.arItemList = new Array();
- this.m_arComboList = new Array();
- for (var i=0; i<xlItemSet.length; i++)
- {
- var xlItemLabel = XmlLib.selectNodes(xlItemSet.item(i), strLabelRef);
- var xlItemValue = XmlLib.selectNodes(xlItemSet.item(i), strValueRef);
- this.itemLength += xlItemValue.length;
- for (var j=0; j<xlItemValue.length; j++)
- {
- var data = {label:xlItemLabel.item(j),value:xlItemValue.item(j)};
- this.arItemList.push(data);
- }
- }
- //this.itemLength = xlItemSet.length;
-
- var heComboListDiv = this.m_heItemList ? this.m_heItemList : document.createElement("div");
-
- heComboListDiv.setAttribute("id", "HE_" + this.id + "_allitem");
- if(!is_smartphone)
- {
- heComboListDiv.setAttribute("U_D_C_S","combo");
- }
-
- heComboListDiv.style.position = "absolute";
- heComboListDiv.style.visibility = "hidden";
- heComboListDiv.style.border = "1px solid";
- heComboListDiv.style.overflow = "hidden";
- heComboListDiv.style.overflowX = "hidden";
- heComboListDiv.style.overflowY = "hidden";
- heComboListDiv.style.height = "0px";
- heComboListDiv.style.zIndex = "100";
-
- //var heTable = document.createElement("table");
- //heTable.cellSpacing = "0";
- //heTable.cellPadding = "0";
-
- //heTable.style.backgroundColor = "#FFFFFF";
-
- var strItemHeight = this.getAttribute("itemheight");
- var strItemWidth = this.getAttribute("itemwidth");
- var strVcellSpacing = this.getAttribute("vcellspacing");
- var strCellSpacing = this.getAttribute("cellspacing");
-
- strItemHeight = (null != strItemHeight) ? strItemHeight.split("px")[0] : "";
- strItemWidth = (null != strItemWidth) ? strItemWidth.split("px")[0] : "";
- strVcellSpacing = (null != strVcellSpacing) ? strVcellSpacing.split("px")[0] : "";
- strCellSpacing = (null != strCellSpacing) ? strCellSpacing.split("px")[0] : "";
-
- var nItemHeight = parseInt(strItemHeight);
- var nItemWidth = parseInt(strItemWidth);
- var nVcellSpacing = parseInt(strVcellSpacing);
- var nCellSpacing = parseInt(strCellSpacing);
-
- var nPaddingRight = null;
-
- //var heTBody = document.createElement("tbody");
- //heTable.appendChild(heTBody);
-
- var strCols = this.attribute["cols"];
- var strRows = this.attribute["rows"];
-
- var nCols = ("" == strCols)||("*" == strCols) ? 1 : parseInt(strCols);
- var nRows = ("" == strRows)||("*" == strRows) ? 1 : parseInt(strRows);
-
- //ITEM의 WIDTH를 지정해 준다.
- var strComboWidth = this.getAttribute("width").replaceAll("px", "");
-
- if ("" == strComboWidth || null == strComboWidth)
- {
- strComboWidth = this.m_heControl.style.width;
- }
- var nComboWidth = parseInt(strComboWidth);
-
- if (("" == strItemWidth || null == strItemWidth) || nComboWidth > nItemWidth)
- {
- nItemWidth = isNaN(nComboWidth) ? 100 : nComboWidth;
-
- }
-
- // Row 가 의미 있을 때
- if ("*" == strCols && (1 < nRows))
- {
- nCols = Math.ceil(this.arItemList.length/*xlItemSet.length*/ / nRows);
- }
- // Row 가 의미 없을 때
- else
- {
- nRows = Math.ceil(this.arItemList.length/*xlItemSet.length*/ / nCols);
- }
-
- var strDirection = this.attribute["direction"];
-
- //showvalue 일때 direction, cols, rows 무시한다
- if ("true" == this.attribute["showvalue"])
- {
- nCols = 1;
- nRows = this.itemLength;
- strDirection = "";
- }
-
- // cellSpacing
- // Attribute로 cellSpacing이 있을 경우 padding-right로 cellSpacing값을 넣어준다
- nPaddingRight = ("" == strCellSpacing || null == strCellSpacing) ? 18 : nCellSpacing;
-
- // vCellSpacing
- // Attribute로 vCellSpacing이 있을 경우 height로 vCellSpacing 값을 넣어준다.
- if ("" == strItemHeight || null == strItemHeight)
- {
- nItemHeight = ("" == strVcellSpacing || null == strVcellSpacing) ? 18 : nVcellSpacing;
- }
- if (parseInt(this.attribute["itemcount"]) < nRows && !is_smartphone)
- {
- //heComboListDiv.style.height = (nItemHeight * parseInt(this.attribute["itemcount"])) + "px";
- this.m_bItemCount = true;
- this.m_nItemSetHeight = (nItemHeight * parseInt(this.attribute["itemcount"]));
- }
- else
- {
- this.m_bItemCount = false;
-
- }
- if (is_smartphone)
- {
- heComboListDiv.style.height = "0px";
- }
- var heTableWidth= (nItemWidth * nCols) + "px";
- this.m_arComboList.push("<table cellSpacing=0 cellPadding=0 style='background-color:#FFFFFF;width:"+heTableWidth+"'>");
- //heTable.style.width = (nItemWidth * nCols) + "px";
-
- var nItemIndex = 0;
-
- for (var i=0; i<nRows; i++)
- {
- this.m_arComboList.push("<tr>");
- //var heTableTr = document.createElement("tr");
-
- for (var j=0; j<nCols && nItemIndex < this.arItemList.length/*xlItemSet.length*/; j++)
- {
- var xnItem = null;
- if ("downacross" == strDirection)
- {
- //xnItem = xlItemSet.item(((nRows * j) + i));
- xnItem = this.arItemList[((nRows * j) + i)];
- }
- else
- {
- //xnItem = xlItemSet.item(nItemIndex);
- xnItem = this.arItemList[nItemIndex];
- }
- //var xnLabel = XmlLib.selectSingleNode(xnItem, strLabelRef);
- //var xnValue = XmlLib.selectSingleNode(xnItem, strValueRef);
- var xnLabel = xnItem.label;
- var xnValue = xnItem.value;
-
- var strLabel = XmlLib.getTextValue(xnLabel);
- var strValue = XmlLib.getTextValue(xnValue);
- var strTDId = this.id + "_" + i + "_" + j;
- //heTable.appendChild(heTableTr);
- var heTableTd;
-
- if (is_smartphone || is_ipad)
- {
- // if (is_ie)
- // {
- // heTableTd = document.createElement("<td onmousedown=\" \"" +
- // "onmousemove=\" \"" +
- // "onmouseup=\" \"" +
- // "ondblclick=\" \"" +
- // "onkeydown=\" \"" +
- // "onkeypress=\" \"" +
- // "onkeyup=\" \">");
- // }
- // else
- // {
- //
- // heTableTd = document.createElement("td");
- // heTableTd.setAttribute("onmousedown", "onmousedown=\" ");
- // heTableTd.setAttribute("onmousemove", "onmousemove=\" ");
- // heTableTd.setAttribute("onmouseup", "onmouseup=\" ");
- // heTableTd.setAttribute("ondblclick", "ondblclick=\" ");
- // heTableTd.setAttribute("onkeydown", "onkeydown=\" ");
- // heTableTd.setAttribute("onkeypress", "onkeypress=\" ");
- // heTableTd.setAttribute("onkeyup", "onkeyup=\" ");
- // }
- this.m_arComboList.push("<td id='HE_"+strTDId+"' onmousedown='' onmousemove='' onmouseup='' ondblclick='' onkeydown='' onkeypress='' onkeyup='' text='"+strLabel+"' value='"+strValue+"' label='"+strLabel+"' noWrap=true style='height:"+nItemHeight+"px;padding-right:"+nPaddingRight+"px;backgroundRepeat:no-repeat;' ");
- }
- else
- {
- //heTableTd = document.createElement("td");
- //수정
- this.m_arComboList.push("<td id='HE_"+strTDId+"' text='"+strLabel+"' value='"+strValue+"' label='"+strLabel+"' noWrap=true style='height:"+nItemHeight+"px;padding-right:"+nPaddingRight+"px;backgroundRepeat:no-repeat;' ");
- //heTableTd = heTableTr.innerHTML = "<td id=HE_"+strTDId+" text="+strLabel+"; value="+strValue+"; label="+strLabel+"; noWrap=true; style=height:"+nItemHeight+"px;paddingRight:"+nPaddingRight+"px;backgroundRepeat:no-repeat;paddingRight:"+nPaddingRight+"></td>";
- }
- // 적용 heTableTd.setAttribute("id", "HE_" + strTDId);
- // 적용 jhheTableTd.noWrap = true;
- // 적용 heTableTd.setAttribute("value", strValue);
- // 적용 heTableTd.setAttribute("label", strLabel);
- // 적용 heTableTd.style.backgroundRepeat = "no-repeat";
- // 적용 heTableTd.style.paddingRight = nPaddingRight;
-
-
- //heTableTd.style.width = nItemWidth + "px";
-
- // 적용 heTableTd.style.height = nItemHeight + "px";
- // 적용 heTableTd.style.paddingRight = nPaddingRight + "px";
-
- //if (null != heTableTd.innerText)
- //{
- //this.comboList.push("innerText="+strLabel+";");
- //heTableTd.innerText = strLabel;
- //}
- //else
- //{
- //this.comboList.push("textContent="+strLabel+";");
- //heTableTd.textContent = strLabel;
- //}
-
- //heTableTr.appendChild(heTableTd);
- nItemIndex++;
- }
- this.m_arComboList.push(">"+strLabel+"</tr>");
- }
- //heComboListDiv.appendChild(heTable);
- this.m_arComboList.push("</table>");
- this.m_arComboList.join().replaceAll("," , "");
- heComboListDiv.innerHTML =this.m_arComboList.join('');
- document.body.appendChild(heComboListDiv);
- }
- else
- {
- XFormsSelect.prototype.initItemset.call(this);
- }
- };
- XFormsSelect1.prototype.onSelect = function (event)
- {
- var xlRefNode = this.getRefNode();
- if (null == xlRefNode)
- {
- return;
- }
-
- var strOldValue = XmlLib.getTextValue(xlRefNode);
-
- if (-1 == this.m_nSelectedRow && -1 == this.m_nSelectedCol)
- {
- if ("minimal" == this.getAttribute("appearance"))
- {
- if (POPUP_INPUT == this.getEditMode() || INPUT == this.getEditMode())
- {
- this.setValue(this.m_objInput.getWindowText());
-
- this.dipatch("xforms-select");
-
- if (strOldValue != this.getValue())
- {
- this.dipatch("xforms-value-changed");
- }
- return;
- }
- else if (POPUP_SEARCH == this.getEditMode() || NOPOPUP_SEARCH == this.getEditMode())
- {
- this.setValue(strOldValue);
- this.refreshCurrentModel(this.attribute["ref"]);
- return;
- }
- }
- }
-
- var objCell = this.getCell(this.m_nSelectedRow, this.m_nSelectedCol);
- if (!objCell)
- {
- return;
- }
-
- if ("minimal" == this.getAttribute("appearance"))
- {
- if (POPUP_INPUT == this.getEditMode() || INPUT == this.getEditMode())
- {
- if (this.m_bButtonClick)
- {
- this.setValue(objCell.getValue());
- }
- else
- {
- var strString = this.m_objInput.getWindowText();
- var strValue = objCell.getText();
-
- var nRow = -1;
- var nCol = -1;
- if (strValue != strString)
- {
- if (!this.findString(strValue, nRow, nCol))
- {
- if (strValue.isEmpty())
- {
- this.setValue(objCell.getValue());
- }
- else
- {
- this.setValue(strValue);
- }
- }
- else
- {
- if (this.m_nSelectedRow == nRow && this.m_nSelectedCol == nCol && strValue == strString)
- {
- this.setValue(objCell.getValue());
- }
- else if (this.m_nSelectedRow == nRow && this.m_nSelectedCol == nCol && strValue != strString && strString.isEmpty())
- {
- this.setValue(objCell.getValue());
- }
- else if (this.m_nSelectedRow == nRow && this.m_nSelectedCol == nCol)
- {
- if (-1 != strValue.indexOf(strString))
- {
- this.setValue(strString);
- }
- else
- {
- this.setValue(objCell.getValue());
- }
- }
- else
- {
- this.setValue(strString);
- }
- }
- }
- else
- {
- if (!this.findString(strString, nRow, nCol))
- {
- if (strString.isEmpty())
- {
- this.setValue(objCell.getValue());
- }
- else
- {
- this.setValue(strString);
- }
- }
- else
- {
- if (strValue == strString)
- {
- this.setValue(objCell.getValue());
- }
- else
- {
- this.setValue(strString);
- }
- }
- }
- }
- }
- else if (NOPOPUP_SEARCH == this.getEditMode() || POPUP_SEARCH == this.getEditMode())
- {
- this.setValue(objCell.getValue());
- }
- else if (INPUT == this.getEditMode())
- {
- if (this.m_bButtonClick)
- {
- this.setValue(objCell.getValue());
- }
- else
- {
- this.setValue(this.objInput.getWindowText());
- }
- }
- else
- {
- this.setValue(objCell.getValue());
- }
- }
- else
- {
- this.setValue(objCell.getValue());
- }
-
- this.refreshCurrentModel(this.attribute["ref"]);
-
- this.dispatch("xforms-select");
-
- if (strOldValue != this.getValue())
- {
- this.dispatch("xforms-value-changed");
- }
- };
- XFormsSelect1.prototype.onFocus = function (event)
- {
- XFormsSelect.prototype.onFocus.call(this, event);
- };
- XFormsSelect1.prototype.onBlur = function (event)
- {
- if ("minimal" == this.getAttribute("appearance") && (event.relatedTarget.isEmpty() || !this.isDescendants(event.relatedTarget, true)))
- {
- this.showItemList(false);
- }
-
- if (this.m_objInput && event.target == this.m_objInput.getId())
- {
- if (NONE_EDIT != this.getEditMode())
- {
- //TODO this.processEditMode();
- }
- }
-
- this.m_bSelect = false;
-
- XFormsSelect.prototype.onBlur.call(this, event);
- // if("minimal" == this.attribute["appearance"])
- // {
- // this.showItemList(false);
- // if ("search" == this.attribute["editmode"])
- // {
- // this.refresh();
- // return;
- // }
- // if ("input" == this.attribute["editmode"] || "inputsearch" == this.attribute["editmode"])
- // {
- // for (var i=0; i < this.itemLength; i++)
- // {
- // if ((this.m_heComboboxInput.value == (" [" + this.m_arItem[i].value + "] " + this.m_arItem[i].label)) ||
- // (this.m_arItem[i].label == this.m_heComboboxInput.value)||
- // (this.m_arItem[i].value == this.m_heComboboxInput.value))
- // {
- // this.m_bIsComboSelect = true;
- // this.select(i, event);
- // return;
- // }
- // }
- // var xlRefNode = this.getRefNode();
- // if (null != xlRefNode)
- // {
- // var xnRefNode = xlRefNode.item(0);
- // if (null != xnRefNode)
- // {
- // var strOldValue = XmlLib.getTextValue(xnRefNode);
- // XmlLib.setTextValue(xnRefNode, this.m_heComboboxInput.value);
- // this.m_bIsComboSelect = false;
- // this.label = this.m_heComboboxInput.value;
- // this.value = this.m_heComboboxInput.value;
- //
- // this.refreshCurrentModel(true, event);
- // if (strOldValue != this.m_heComboboxInput.value)
- // {
- // this.dispatch("xforms-value-changed");
- // }
- // }
- // }
- // }
- // }
- };
- XFormsSelect1.prototype.isCell = function (strId)
- {
- if ("minimal" == this.getAttribute("appearance"))
- {
- if (strId == this.id + ".input" || strId == this.id + ".button")
- {
- return false;
- }
- }
-
- return XFormsSelect.prototype.isCell.call(this, strId);
- };
- XFormsSelect1.prototype.onMouseDown = function (event)
- {
- XFormsGroup.prototype.onMouseDown.call(this, event);
-
- this.m_bButtonClick = false;
-
- if (TFEvent.BUTTON_LEFT != event.button)
- {
- return;
- }
-
- var bCanShow = (null == this.m_objInput) || !this.isEditable() || (event.target != this.m_objInput.getId());
-
- if (this.m_heItemList && !this.isCell(event.target))
- {
- if ("minimal" == this.getAttribute("appearance") && this.m_bShowItemList)
- {
- this.showItemList(false);
- }
- else
- {
- if (bCanShow)
- {
- if (INPUT == this.getEditMode() || POPUP_INPUT == this.getEditMode())
- {
- var strValue = this.m_objInput.getWindowText();
-
- if (null != strValue && !strValue.isEmpty())
- {
- var nRow = -1;
- var nCol = -1;
- if (false)//TODO FIND Value
- {
- this.clearSelect();
-
- var objCell = this.getCell(nRow, nCol);
- if (objCell)
- {
- objCell.setSelect(true);
- }
- }
- }
- }
- this.showItemList(true);
- }
- }
- }
-
- if (!this.isCell(event.target))
- {
- return;
- }
-
- if ("minimal" == this.getAttribute("appearance") && this.m_heItemList)
- {
- this.m_bButtonClick = true;
- this.showItemList(false);
- }
-
- this.m_bDragStart = false;
-
- var objCell = this.getCell(this.m_nSelectedRow, this.m_nSelectedCol);
- if (null != objCell)
- {
- this.dispatch("onselect");
- }
-
- this.m_bLButtonDown = true;
- this.m_bButtonClick = false;
- };
- XFormsSelect1.prototype.onMouseOver = function (event)
- {
- XFormsSelect.prototype.onMouseOver.call(this, event);
-
- if ("minimal" == this.attribute["appearance"] && this.isCell(event.target))
- {
- var nRow = this.getAttribute("row");
- var nCol = this.getAttribute("col");
-
- this.clearSelect();
-
- var objCell = this.getCell(nRow, nCol);
- if (objCell)
- {
- this.m_nSelectedRow = nRow;
- this.m_nSelectedCol = nCol;
-
- objCell.setSelect(true);
- }
- }
- };
- XFormsSelect1.prototype.onMouseMove = function (event)
- {
- XFormsSelect.prototype.onMouseMove.call(this, event);
- };
- XFormsSelect1.prototype.onKeyDown = function (event)
- {
- if ("minimal" == this.attribute["appearance"])
- {
- XFormsGroup.prototype.onKeyDown.call(this, event);
-
- if (TFEvent.UP != event.keyCode &&
- TFEvent.DOWN != event.keyCode &&
- TFEvent.ENTER != event.keyCode &&
- TFEvent.ESC != event.keyCode)
- {
- if (this.m_objInput && this.m_objInput.getId() == event.target)
- {
- return;
- }
- }
-
- }
- else
- {
- XFormsSelect.prototype.onKeyDown.call(this, event);
- return;
- }
-
- var bRefresh = false;
- switch (event.keyCode)
- {
- case TFEvent.UP :
- {
- if (this.m_nSelectedRow > 0)
- {
- this.m_nSelectedRow--;
- bRefresh = true;
- }
- break;
- }
- case TFEvent.DOWN :
- {
- if (this.m_nSelectedRow < this.m_nRows - 1)
- {
- if (this.m_bIsSelectedCell)
- {
- this.m_nSelectedRow++;
- }
- bRefresh = true;
- }
- break;
- }
- case TFEvent.LEFT :
- {
- if (this.m_nSelectedCol > 0)
- {
- this.m_nSelectedCol--;
- bRefresh = true;
- }
- break;
- }
- case TFEvent.RIGHT :
- {
- if (this.m_nSelectedCol < this.m_nCols - 1)
- {
- this.m_nSelectedCol++;
- bRefresh = true;
- }
- break;
- }
- case TFEvent.SPACE :
- case TFEvent.ENTER :
- {
- this.showItemList(false);
- this.dispatch("onselect");
- return;
- }
- case TFEvent.ESC :
- {
- this.showItemList(false);
- return;
- }
- default :
- {
- return;
- }
- }
- if (bRefresh)
- {
- if (this.m_nSelectedCol == -1)
- {
- this.m_nSelectedCol = 0;
- }
- if (this.m_nSelectedRow == -1)
- {
- this.m_nSelectedRow = 0;
- }
- var objItem = this.getCell(this.m_nSelectedRow, this.m_nSelectedCol);
- if (null != objItem)
- {
- this.setMousePointOverColor(objItem);
- if (this.m_bShowItemList)
- {
- this.clearSelect();
- objItem.setSelect(true);
- }
- else
- {
- this.dispatch("onselect");
- }
- }
- }
- };
- XFormsSelect1.create = function (strParentId, clAttribute, strStyle)
- {
- // 메인노드 생성
- var xnSelect1 = XFormsSelect1.createMainNode(clAttribute);
- var xnParent = document.getElementById("HE_"+strParentId);
- xnParent.appendChild(xnSelect1);
- // 하위노드 생성
- xnSelect1 = XFormsSelect1.createSubNodes(xnSelect1, clAttribute);
- // object 생성
- return XFormsSelect1.createObject(strParentId, xnSelect1, clAttribute, strStyle);
- };
- XFormsSelect1.createMainNode = function (clAttribute)
- {
- var xnSelect1 = document.createElement("div");
- xnSelect1 = XFormsSelect1.createAttribute(xnSelect1, clAttribute);
-
- // Select1가 가져야 하는 디폴트 스타일 설정
- if (xnSelect1.getAttribute("appearance") == "full") // 라디오버튼
- {
- }
- if (xnSelect1.getAttribute("appearance") == "minimal") // 콤보박스
- {
- if ("" == HtmlLib.getStyle(xnSelect1, "border-style"))
- {
- HtmlLib.setStyle(xnSelect1, "border-style", "inset");
- HtmlLib.setStyle(xnSelect1, "border-width", "2px");
- }
- var strId = xnSelect1.id;
-
- var xnComboTable = document.createElement("table");
-
- xnComboTable.cellPadding = 0;
- xnComboTable.cellSpacing = 0;
- HtmlLib.setStyle(xnComboTable, "table-layout", "fixed");
- HtmlLib.setStyle(xnComboTable, "width", "100%");
- HtmlLib.setStyle(xnComboTable, "height", "100%");
-
- var xnComboTBody = document.createElement("tbody");
- var xnComboTr = document.createElement("tr");
- HtmlLib.setStyle(xnComboTr, "width", "100%");
- HtmlLib.setStyle(xnComboTr, "height", "100%");
-
- var xnComboInputTd = document.createElement("td");
- xnComboInputTd.valign = "middle";
-
- var xnComboBoxInput = document.createElement("input");
-
- // combo안의 input태그의 default style
- HtmlLib.setStyle(xnComboBoxInput, "background-color", "transparent");
- HtmlLib.setStyle(xnComboBoxInput, "border-width", "0px");
- HtmlLib.setStyle(xnComboBoxInput, "border-style", "none");
- HtmlLib.setStyle(xnComboBoxInput, "padding-top", "0px");
- HtmlLib.setStyle(xnComboBoxInput, "padding-left", "0px");
- HtmlLib.setStyle(xnComboBoxInput, "padding-rignht", "0px");
- HtmlLib.setStyle(xnComboBoxInput, "padding-bottom", "0px");
- HtmlLib.setStyle(xnComboBoxInput, "width", "100%");
- if (!xnSelect1.editmode) xnComboBoxInput.readOnly = true;
-
- xnComboBoxInput.type = "text";
- xnComboBoxInput.id = strId + ".input";
-
- var xnComboButtonTd = document.createElement("td");
- xnComboButtonTd.id = strId + "_img";
- xnComboButtonTd.valign = "middle";
- xnComboButtonTd.align = "center";
- HtmlLib.setStyle(xnComboButtonTd, "width","18px");
- HtmlLib.setStyle(xnComboButtonTd, "height","100%");
-
- var xnComboButton = document.createElement("button");
- xnComboButton.id = strId + ".button";
- HtmlLib.setStyle(xnComboButton, "position", "relative");
- HtmlLib.setStyle(xnComboButton, "width","18px");
- HtmlLib.setStyle(xnComboButton, "height","100%");
- HtmlLib.setStyle(xnComboButton, "background-image", "url(" + __getAppName() + "/kr/comsquare/image/combo/combo.gif)");
- HtmlLib.setStyle(xnComboButton, "background-color", "#D4D0C8");
- HtmlLib.setStyle(xnComboButton, "background-position", "center");
- HtmlLib.setStyle(xnComboButton, "background-repeat", "no-repeat");
- HtmlLib.setStyle(xnComboButton, "padding-top", "0px");
- HtmlLib.setStyle(xnComboButton, "padding-bottom", "0px");
- HtmlLib.setStyle(xnComboButton, "padding-left", "0px");
- HtmlLib.setStyle(xnComboButton, "padding-right", "0px");
- HtmlLib.setStyle(xnComboButton, "border-top-width", "1px");
- HtmlLib.setStyle(xnComboButton, "border-bottom-width", "1px");
- xnComboButtonTd.appendChild(xnComboButton);
- xnComboInputTd.appendChild(xnComboBoxInput);
- xnComboTr.appendChild(xnComboInputTd);
- xnComboTr.appendChild(xnComboButtonTd);
- xnComboTBody.appendChild(xnComboTr);
- xnComboTable.appendChild(xnComboTBody);
- xnSelect1.appendChild(xnComboTable);
- }
- return xnSelect1;
- };
- XFormsSelect1.createSubNodes = function (xnSelect1, clAttribute)
- {
- return xnSelect1;
- };
- XFormsSelect1.createObject = function (strParentId, xnSelect1, clAttribute, strStyle)
- {
- var strAlert = "";
- var strHelp = "";
- var strHint = "";
- var strAccesskey = "";
- var strBind = "";
- var strCellSpacing = "";
- var strClass = "";
- var strCols = "1";
- var strDirection = "acrossdown";
- var bDisabled = false;
- var bDragMode = false;
- var bDropMode = false;
- var strId = "";
- var strItemHeight = "";
- var strItemWidth = "";
- var nNavindex = 9007199254740992;
- var strOverFlow = "hidden";
- var strRef = "";
- var strRows = "*";
- var strScroll = "";
- var strSep = " ";
- var strVcellSpacing = "";
- var strVisibility = "visible";
- var strObjType = xnSelect1.getAttribute("appearance");
-
- // combobox attribute
- var bEditMenu = false;
- var strEditMode = "";
- var nItemCount = 0;
- if (xnSelect1.getAttribute("appearance") == "full") // 라디오버튼
- {
- nItemCount = 0;
- }
- else if (xnSelect1.getAttribute("appearance") == "minimal") // 콤보박스
- {
- nItemCount = clAttribute.exists("itemcount") ? parseInt(clAttribute.item("itemcount")) : 30;
- }
- else if (xnSelect1.getAttribute("appearance") == "compact") // 기타 (정의가 안되었을때 리스트박스)
- {
- nItemCount = 0;
- }
- var strPasteMode = "default";
- var strShowType = "";
- var bShowValue = false;
-
- var strUserDefineAttrib = "";
-
- for (var i=0; i<clAttribute.count(); i++)
- {
- var strAttributeName = clAttribute.keys()[i];
- switch (strAttributeName)
- {
- case "alert" :
- {
- strAlert = clAttribute.item(strAttributeName);
- break;
- }
- case "help" :
- {
- strHelp = clAttribute.item(strAttributeName);
- break;
- }
- case "hint" :
- {
- strHint = clAttribute.item(strAttributeName);
- break;
- }
- case "accesskey" :
- {
- strAccesskey = clAttribute.item(strAttributeName);
- break;
- }
- case "bind" :
- {
- strBind = clAttribute.item(strAttributeName);
- break;
- }
- case "cellspacing" :
- {
- strCellSpacing = clAttribute.item(strAttributeName);
- break;
- }
- case "class" :
- {
- strClass = clAttribute.item(strAttributeName);
- break;
- }
- case "cols" :
- {
- strCols = clAttribute.item(strAttributeName);
- break;
- }
- case "direction" :
- {
- strDirection = clAttribute.item(strAttributeName);
- break;
- }
- case "disabled" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bDisabled = true;
- }
- break;
- }
- case "dragmode" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bDragMode = true;
- }
- break;
- }
- case "dropmode" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bDropMode = true;
- }
- break;
- }
- case "editmenu" :
- {
- // combobox attribute
- if ("true" == clAttribute.item(strAttributeName))
- {
- bEditMenu = true;
- }
- break;
- }
- case "editMode" :
- {
- // combobox attribute
- strEditMode = clAttribute.item(strAttributeName);
- break;
- }
- case "id" :
- {
- strId = clAttribute.item(strAttributeName);
- break;
- }
- case "itemcount" :
- {
- // combobox attribute로 위에서 계산해 주므로 통과
- break;
- }
- case "itemheight" :
- {
- strItemHeight = clAttribute.item(strAttributeName);
- break;
- }
- case "itemwidth" :
- {
- strItemWidth = clAttribute.item(strAttributeName);
- break;
- }
- case "navindex" :
- {
- nNavindex = parseInt(clAttribute.item(strAttributeName));
- break;
- }
- case "overflow" :
- {
- strOverFlow = clAttribute.item(strAttributeName);
- break;
- }
- case "pastemode" :
- {
- // combobox attribute
- strPasteMode = clAttribute.item(strAttributeName);
- break;
- }
- case "ref" :
- {
- strRef = clAttribute.item(strAttributeName);
- break;
- }
- case "rows" :
- {
- strRows = clAttribute.item(strAttributeName);
- break;
- }
- case "scroll" :
- {
- strScroll = clAttribute.item(strAttributeName);
- break;
- }
- case "sep" :
- {
- strSep = clAttribute.item(strAttributeName);
- break;
- }
- case "showtype" :
- {
- strShowType = clAttribute.item(strAttributeName);
- break;
- }
- case "showvalue" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bShowValue = true;
- }
- break;
- }
- case "vcellspacing" :
- {
- strVcellSpacing = clAttribute.item(strAttributeName);
- break;
- }
- case "visibility" :
- {
- strVisibility = clAttribute.item(strAttributeName);
- break;
- }
- case "appearance" :
- {
- // 위에서 strObjType으로 갖고있음. 그래서 통과시킴
- break;
- }
-
- default :
- {
- if (!STYLE_LIST[strAttributeName])
- {
- strUserDefineAttrib += strAttributeName + ":" + clAttribute.item(strAttributeName) + "; ";
- }
- break;
- }
- }
- }
- var objSelect1 = new XFormsSelect1 (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strCellSpacing, strClass, strCols, strDirection, bDisabled, bDragMode, bDropMode, bEditMenu, strEditMode, strId, nItemCount, strItemHeight, strItemWidth, nNavindex, strOverFlow, strPasteMode, strRef, strRows, strScroll, strSep, null, bShowValue, strStyle, "xforms:select1", strVcellSpacing, strVisibility, 0, false, "", "", "", strObjType, strUserDefineAttrib);
- return objSelect1;
- };
- XFormsSelect1.createAttribute = function (xnHtmlNode, clAttribute)
- {
- xnHtmlNode = XFormsSelect.createAttribute(xnHtmlNode, clAttribute);
- return xnHtmlNode;
- };
|