Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Submit button not working when i call a javascript function through onload

940786Jul 9 2012 — edited Jul 10 2012
Hello guys!

I have the following code under "HTML Header and Body Attribute" of the page which is used to save CLOB into database from textarea and retrieve it into the textarea. I am using this due to the 32k limit.
<script language="JavaScript" type="text/javascript">
 
function clob_set(){
        var clob_ob = new apex.ajax.clob(  
            function(){
                var rs = p.readyState 
                 if(rs == 1||rs == 2||rs == 3){  
                    $x_Show('AjaxLoading');  
                }else if(rs == 4){  
                    $s('P2_CLOB',p.responseText);  
                    $x_Hide('AjaxLoading');  
                }else{return false;}  
            }  
        );  
      
        if(!$v_IsEmpty('P2_CLOB')){clob_ob._set($v('P2_CLOB'))};
    }
      
    function clob_get(){
        var clob_ob = new apex.ajax.clob(
            function(){
                var rs = p.readyState
                if(rs == 1||rs == 2||rs == 3){
                    $x_Show('AjaxLoading');
                }else if(rs == 4){
                    $s('P2_CLOB',p.responseText);
                    $x_Hide('AjaxLoading');
                }else{return false;}
            }  
        ); 
        clob_ob._get();  
    }
          
</script>
I am calling one of the functions under "Page HTML Body Attribute" as onload = "javascript:clob_get();"

I have a PLSQL after header process for this.
declare
l_clob clob:= empty_clob();

begin

apex_collection.create_or_truncate_collection(p_collection_name=>'CLOB_CONTENT');
dbms_lob.createtemporary( l_clob, false, dbms_lob.SESSION );

SELECT clob_column
INTO l_clob
FROM my_table
WHERE namn = 'abc';

apex_collection.add_member(p_collection_name => 'CLOB_CONTENT',p_clob001 => l_clob);
end;
This is working just fine. Now, I have a plsql process which saves the details entered in some textfields on the same page and saves it into the database. After I introduced this javascript call, it has stopped working. I get a "*HTTP Bad Request*".

Can anyone please explain why is this happening and how can i solve this? Any inputs are highly appreciated.
Thanks!

Edited by: gaurav_ojha on Jul 10, 2012 1:19 AM

Edited by: gaurav_ojha on Jul 10, 2012 1:21 AM

Edited by: gaurav_ojha on Jul 10, 2012 1:23 AM

Edited by: gaurav_ojha on Jul 10, 2012 1:24 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2012
Added on Jul 9 2012
2 comments
371 views