123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- XFormsSubmission.prototype = new XFormsElement;
- function XFormsSubmission (strParentId, strAction, strAdd, strEncoding, strId, strMediaType, strMethod, strRef, strReplace, strResultRef, strTag, strType)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsElement.call(this, strParentId, strId, strTag);
-
- // Property
- this.attribute = new Hashtable();
- this.attribute["action"] = strAction;
- this.attribute["add"] = strAdd;
- this.attribute["encoding"] = strEncoding;
- this.attribute["id"] = strId;
- this.attribute["mediatype"] = strMediaType;
- this.attribute["method"] = strMethod;
- this.attribute["ref"] = strRef;
- this.attribute["replace"] = strReplace;
- this.attribute["resultref"] = strResultRef;
- this.attribute["tag"] = strTag;
- this.attribute["type"] = strType;
- this.attribute["function"] = "";
-
- this.m_refresh = false;
- };
- XFormsSubmission.create = function (strParentId, clAttribute)
- {
- var strAction = "";
- var strAdd = "";
- var strEncoding = "";
- var strId = "";
- var strMediaType = "application/x-www-form-urlencoded";
- var strMethod = "post";
- var strRef = "";
- var strReplace = "";
- var strResultRef = "";
- var strType = "";
- var strUserDefineAttrib = "";
-
- for (var i=0; i<clAttribute.count(); i++)
- {
- var strAttributeName = clAttribute.keys()[i];
- switch (strAttributeName)
- {
- case "action" :
- {
- strAction = clAttribute.item(strAttributeName);
- break;
- }
- case "add" :
- {
- strAdd = clAttribute.item(strAttributeName);
- break;
- }
- case "encoding" :
- {
- strEncoding = clAttribute.item(strAttributeName);
- break;
- }
- case "id" :
- {
- strId = clAttribute.item(strAttributeName);
- break;
- }
- case "mediatype" :
- {
- strMediaType = clAttribute.item(strAttributeName);
- break;
- }
- case "method" :
- {
- strMethod = clAttribute.item(strAttributeName);
- break;
- }
- case "ref" :
- {
- strRef = clAttribute.item(strAttributeName);
- break;
- }
- case "replace" :
- {
- strReplace = clAttribute.item(strAttributeName);
- break;
- }
- case "resultRef" :
- {
- strResultRef = clAttribute.item(strAttributeName);
- break;
- }
- case "type" :
- {
- strType = clAttribute.item(strAttributeName);
- break;
- }
- default :
- {
- if (!STYLE_LIST[strAttributeName])
- {
- strUserDefineAttrib += strAttributeName + ":" + clAttribute.item(strAttributeName) + "; ";
- }
- break;
- }
- }
- }
- var objSubmission = new XFormsSubmission (strParentId, strAction, strAdd, strEncoding, strId, strMediaType, strMethod, strRef, strReplace, strResultRef, "xforms:submission", strType, strUserDefineAttrib);
- return objSubmission;
- };
|