表格表单是在带有SQL查询的传统报表(可更新报表)上创建的。它还有一个向导生成的MRU & MRD流程,region源代码有以下代码(写在下面),可以很好地工作,并显示如下所述的列
select
"ROWID",
"EVAL_SR_NO",
(SELECT SKILL_DESC FROM TB_RCMI_EVAL_SKILLS
WHERE SKILL_ID ="TB_RCMI_CNDT_INTV_EVAL"."EVAL_SKILL_ID" ) as
"EVAL_SKILL_ID",
"EVAL_SKILL_REMARKS"
from "#OWNER#"."TB_RCMI_CNDT_INTV_EVAL"
where eval_type='TE'and WF_ID = :P33_WF_ID
UNION ALL
select
"ROWID",
"EVAL_SR_NO",
(SELECT SKILL_DESC FROM TB_RCMI_EVAL_SKILLS
WHERE SKILL_ID ="TB_RCMI_CNDT_INTV_EVAL"."EVAL_SKILL_ID" ) as
"EVAL_SKILL_ID",
"EVAL_SKILL_REMARKS"
from "#OWNER#"."TB_RCMI_CNDT_INTV_EVAL"
where eval_type='GE'and WF_ID = :P33_WF_ID
order by EVAL_SR_NO我的表格形式有3列(即,Sr No & Skill为仅显示格式,备注列为文本区),如下所示:
高级无技能备注
1种Java语言
2个Oracle数据库3个Oracle DBA
4 Oracle Pl Sql
5沟通
6分析思维7逻辑思维8态度
9种领导品质
10业务理解
我需要在Sr No 5和Sr No 6之间添加一个虚拟行(仅用作显示)作为"General Evaluation“。如下所示...
高级无技能备注
1种Java语言
2个Oracle数据库3个Oracle DBA
4 Oracle Pl Sql
5沟通
“综合评价”
6分析思维
7逻辑思维
8态度
9种领导品质
10业务理解
如果你们中的任何一个人能帮我解决这个问题(有一个详细的答案),那就太好了。
我希望这些信息能对你有所帮助。如果我需要提供更多信息,请让我知道
提前等待feedback.Thanks
(‘我使用ApEX 4.1)
发布于 2011-12-13 19:05:44
您真正需要的似乎是一个页面上的两个表格表单,不幸的是,这是不可能的(还没有?)。那么如何解决这个问题呢?除非你真的需要在一个页面上拥有这种编辑功能:我不会,如果你这样做(我的意思是绝对必须),那么就会涉及到javascript。我的建议是:做两个报告,提供一个编辑链接。这也是标准功能。当然,一次不会有多个编辑,但这将是以后最容易维护的。任何习惯都会让你在事后重新思考,所以值得考虑。
如果您真的需要它,我认为这是最舒适的方式:不需要在sql中摆弄,也许可以多写一列。不要浪费联合的双参数和一些“伪”列的排序(因为您需要一些方法来确保双列在特定值之间……)。
Example with the EMP table
地域来源:
select
"ROWID",
"EMPNO",
"ENAME",
"JOB",
"DEPTNO"
from "EMP"
where "DEPTNO" IN (10, 20)
order by "DEPTNO"DEPTNO是一个隐藏项。order by非常重要,因为进一步的处理取决于行的特定顺序。关闭列标题排序(报告属性上的列排序复选框)。
Javascript:
function bind_for_changes(){
//since emp is sorted by deptno, i can loop over the elements in this way
//i also have deptno as a hidden item in the report, so that i can check its value
//since this hidden item is the 4th editable item, its id will be f04_####
//be sure to check the source output if you want to be sure.
//for each input item with name f04 (deptno), do:
//check if its value differs from our stored value.
// if it does, but our var is still -1, then it is only the first record. Do nothing.
// if it does and the var is not -1, then there is a difference between deptnos.
// for example, 10 -> 20.
// this change will be detected on the first row of deptno=20. So the splitter row
// needs to be before this one.
// The input item sits in a TD, the TD in a TR. We need to add a TR element BEFORE
// the current one, so we get the TR and add a new one before it, with a TD in it.
// note the colspan=3, which is the amount of displayed columns. If not sure, check the DOM.
// Or, provide 3 TDs
var deptno = -1;
$("input[name='f04']").each(function(){
if(deptno != $(this).val()){
if(deptno == -1){
deptno = $(this).val(); //first time, first record
//dont change anything
} else {
//a change between deptno's. Add a row after the current one
deptno = $(this).val();
var tr = $(this).parent().parent();
var newtr = $("<tr class='highlight-row'><td colspan=3 class='data'>In between rows!</td></tr>");
tr.before(newtr);
};
};
});
};请注意,就像我在js注释中所说的那样:您需要知道页面将生成什么内容/能够读取源代码/了解DOM。或多或少的可编辑列可能并且会把你的代码搞砸!
例如,在我的页面上,当您查看源代码时,重要的是报告中行的结构:
<tr class="highlight-row">
<td headers="EMPNO" class="data">7782</td>
<td headers="ENAME" class="data">
<label for="f02_0003" class="hideMeButHearMe">Ename</label>
<input type="text" name="f02" size="12" maxlength="2000" value="CLARK" id="f02_0003" />
</td>
<td headers="JOB" class="data">
<label for="f03_0003" class="hideMeButHearMe">Job</label>
<input type="text" name="f03" size="9" maxlength="2000" value="MANAGER" id="f03_0003" />
<input type="hidden" name="f01" value="" id="f01_0003" />
<input type="hidden" name="f04" value="10" id="f04_0003" />
<input type="hidden" id="fcs_0003" name="fcs" value="3C09CABCBA62BE1A064146D162012CEF">
<input type="hidden" id="frowid_0003" name="frowid" value="AAuDjIABFAAAACTAAC" />
<input type="hidden" id="fcud_0003" name="fcud" value="U" />
</td>
</tr>注意输入的ID和名称,以及它们的放置位置。
此外,从顶点4.1 (我相信)开始,在table元素之后有一个映射
<input type="hidden" name="fmap" value="CHECK$01" id="fmap_001" />
<input type="hidden" name="fhdr" value="Select Row" id="fhdr_001" />
<input type="hidden" name="fmap" value="ENAME" id="fmap_002" />
<input type="hidden" name="fhdr" value="Ename" id="fhdr_002" />
<input type="hidden" name="fmap" value="JOB" id="fmap_003" />
<input type="hidden" name="fhdr" value="Job" id="fhdr_003" />
<input type="hidden" name="fmap" value="DEPTNO" id="fmap_004" />
<input type="hidden" name="fhdr" value="Deptno" id="fhdr_004" />这可以从列属性转换而来。但是一定要小心,要多加检查。这不会有什么坏处,而且你仍然需要知道输出代码。

但是,如果所有这些听起来太高级/太难,那么就不要去做了!你只会在事后后悔。更愿意使用标准功能的来做这样的事情:2个普通的报表,带有一个到单个记录表单页面的编辑链接!但如果你非要这样做,在我看来,这是最干净的路径。你只需要知道你在做什么。
https://stackoverflow.com/questions/8485211
复制相似问题