I'm currently try to add the workaround
"save large value" in my application. This is using 2 pages. Can I replace the POST page by an Application Process ?
When I'm trying, it's doesn't work. The Application Process doesn't like : get.addParam. Do you know why ?
Step :
1 - Call clob_submit
2 - $a_PostClob('P35_DESCRIPTION','SAVE','71',clob_SubmitReturn);
-----------------------------------------------------------
<h3> 1- Html Header</h3>
<script src="/i/javascript/apex_save_large.js" type="text/javascript"></script>
<script type="text/javascript">
function clob_Submit(){
$a_PostClob('P35_DESCRIPTION','SAVE','71',clob_SubmitReturn);
}
<h4>function clob_SubmitReturn(){</h4>
if(p.readyState == 1){
$x_Show('AjaxLoading');
}else if(p.readyState == 2){
}else if(p.readyState == 3){
}else if(p.readyState == 4){
$x('P35_DESCRIPTION').value = '';
$x_Hide('AjaxLoading');
doSubmit(/*document.wwv_flow.p_request.value*/'SAVE');
}else{return false;}
}
<h4>function clob_Get(){</h4>
$a_GetClob('GET','71',clob_GetReturn);
}
<h4>function clob_GetReturn(){</h4>
if(p.readyState == 1){
$x_Show('AjaxLoading');
}else if(p.readyState == 2){
}else if(p.readyState == 3){
}else if(p.readyState == 4){
$x_Hide('AjaxLoading');
oEdit1.loadHTML(p.responseText);
}else{return false;}
}
<h4>function doSubmit(r){</h4>
$x('P35_DESCRIPTION').value = ''
flowSelectAll();
document.wwv_flow.p_request.value = r;
document.wwv_flow.submit();
}
-----------------------------------------------------------
<h3>2 - APEX_SAVE_LARGE.js</h3>
/* Extended Javscript Objects */
/*
this adds better aysnc functionality
to the htmldb_Get object
pVar is the function that you want to call when the xmlhttp state changes
in the function specified by pVar the xmlhttp object can be referenced by the variable p
*/
htmldb_Get.prototype.GetAsync = function(pVar){
try{
p = new XMLHttpRequest();
}catch(e){
p = new ActiveXObject("Msxml2.XMLHTTP");
}
try {
var startTime = new Date();
p.open("POST", this.base, true);
if(p){
p.onreadystatechange = pVar;
p.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
p.send(this.queryString == null ? this.params : this.queryString );
return p;
}
}catch(e){
return false;
}
}
/* Begin Post and Retrieve Large Strings */
<h4>function $a_PostClob(pThis,pRequest,pPage,pReturnFunction){</h4>
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,pRequest,pPage, null, 'wwv_flow.accept');
var lSplitter = html_GetElement(pThis);
var lSplitterValue = lSplitter.value;
var i=0;
if (lSplitterValue.length<=4000) {
get.addParam('f01',lSplitterValue);
} else {
while (lSplitterValue.length>4000) {
get.addParam('f01',lSplitterValue.substr(0,4000));
lSplitterValue = lSplitterValue.substr(4000,lSplitterValue.length-4000);
i++;
}
get.addParam('f01',lSplitterValue);
}
get.GetAsync(pReturnFunction);
get=null;
}
<h4>function $a_GetClob(pRequest,pPage,pReturnFunction){</h4>
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,pRequest,pPage, null,'wwv_flow.accept');
get.GetAsync(pReturnFunction);
get = null;
x = null;
}
/* End Post and Retrieve Large Strings */
Sylvain Michaud
-----------------
Homepage : http://www.insum.ca
InSum Solutions' blog : http://insum-apex.blogspot.com