[英]How to specify the 5 apex items on my javascript code at oracle apex
[英]how to i connect my databse from oracle using this code in apex
我正在使用apex 4.0,并使用预制的报告,HTML,jQuery JavaScript和CSS在一个区域中构建了一个报告,我想从Oracle数据库中检索数据。
如何从我的Oracle数据库中检索此代码中的数据?
<a class="offline-button" href="../index.html">Back</a>
<script src="#WORKSPACE_IMAGES#people.js" type="text/javascript"></script>
<div id="example" class="k-content">
<div id="clientsDb">
<div id="grid" style="height: 380px"></div>
</div>
<style scoped>
#clientsDb {
width: 692px;
height: 413px;
margin: 30px auto;
padding: 51px 4px 0 4px;
background: url(#WORKSPACE_IMAGES#clientsDb.png) no-repeat 0 0;
}
</style>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
data: createRandomData(50),
pageSize: 10
},
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true
},
columns: [ {
field: "FirstName",
width: 90,
title: "First Name"
} , {
field: "LastName",
width: 90,
title: "Last Name"
} , {
width: 100,
field: "City"
} , {
field: "Title"
} , {
field: "BirthDate",
title: "Birth Date",
template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
} , {
width: 50,
field: "Age"
}
]
});
});
</script>
</div>
您可以通过不同的方式来执行此操作,但是由于您的帖子信息很少,因此我将主要尝试回答您的问题“如何从Oracle数据库中检索数据”
<script language="JavaScript1.1" type="text/javascript">
function getYourDataTableList (narrowText, empSelect) //getYourDataTableList should be the table you would like to retrive
{
var empSelectObj = document.getElementFirstName(FirstName);
var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getYourDataTableList ,0);
ajaxRequest.add('P1_FirstName_NARROW',narrowText.value);
ajaxResult = ajaxRequest.get();
if(ajaxResult)
{
empSelectObj.options.length = 0;
var empArray = ajaxResult.split("~empsep~");
for(var i=0; i < empArray.length; i++) {
var colArray = empArray[i].split("~colsep~");
empSelectObj.options[i] = new Option(colArray[1], colArray[0]);
}
}
else
{
empSelectObj.options.length = 0;
}
ajaxRequest = null;
}
</script>
-该代码不是测试人员,也不是全部功能,我建议您遵循此示例
http://www.dba-oracle.com/t_html_db_apex_ajax_application_express.htm
还要考虑如果您使用的是iFrame,则可能会遇到以下问题:(如果iframe src是与visualforce页面不同的服务器,则浏览器将不允许javascript访问内容,因为这将被视为跨站点脚本攻击。 )
来源 : http : //boards.developerforce.com/t5/Apex-Code-Development/How-we-get-the-iframe-data-in-apex-page-using-javascript/td-p/446781
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.