最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Interactive report Oracle apex passing string attribute to JavaScript variable - Stack Overflow

programmeradmin1浏览0评论

I have an interactive report in Oracle Apex 4.1. I need to pass a column value to an apex item when i click a link button on that interactive report. I have searched on Google and found a solution :

onclick="$s('P4_PAGEITEM', #COLUMN_NAME#); return false;" 

But it seems it's only working for numbers. When I try passing a string value it always returns wrong number format.

Also, can I access an interactive report column value from JavaScript?

I have an interactive report in Oracle Apex 4.1. I need to pass a column value to an apex item when i click a link button on that interactive report. I have searched on Google and found a solution :

onclick="$s('P4_PAGEITEM', #COLUMN_NAME#); return false;" 

But it seems it's only working for numbers. When I try passing a string value it always returns wrong number format.

Also, can I access an interactive report column value from JavaScript?

Share Improve this question edited Oct 15, 2012 at 7:13 Tom 7,0281 gold badge28 silver badges40 bronze badges asked Oct 15, 2012 at 5:51 syantsyant 2717 silver badges16 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

#COLUMN_NAME# is a substitution string. It will literally put the value of the column for that row in the string.
When the value is a number, it will generate

onclick="$s('P4_PAGEITEM', 9875); return false;"  

Now, if the value would be a string

onclick="$s('P4_PAGEITEM', ALLEN); return false;"  

To deal with this, alter your link with adding quotes around #COLUMN_NAME#

onclick="$s('P4_PAGEITEM', '#COLUMN_NAME#'); return false;"  

Also, can I access an interactive report column value from JavaScript?

All HTML on the page you see is accessible from javascript/jQuery and only requires you to use the correct selector. You do need to understand HTML and the DOM though.
A good start is always using a browser with the correct tools which will allow you to inspect elements, html, dom, javascript, css,... An example is the Firebug plugin for Firefox.
Targeting values in a report requires you to know its markup which you can find by inspecting the generated page html. Keep in mind that page and region templates can make a difference depending on the theme you are using.

If you are stuck on this, post a new question about it and provide html and an explanation of what you are trying to get at. This question is an example of targetting values in a table: How to select a row element value from Oracle APEX 4 Classic Report (row element from a table tags)

have you tried using quotes arround your column value ? :

onclick="$s('P4_PAGEITEM', '#COLUMN_NAME#'); return false;"

It works for me.

发布评论

评论列表(0)

  1. 暂无评论