Can't Select Oracle Apex Card Link Value

耗尽温柔 提交于 2019-12-11 19:07:00

问题


I have created a standard report page and selected the "cards" for the Report Template (in the Layout and Presentation).

The following is the code that loads the data

DECLARE

  l_query VARCHAR2(4000);
  l_app number := v('APP_ID');
  l_session number := v('APP_SESSION');

  //Bug happens on the ':11:' part, page 1 works fine
  l_url VARCHAR2(500) := (APEX_UTIL.PREPARE_URL(
           p_url => 'f?p=' || l_app || ':11:' || l_session || '::NO:::',
           p_checksum_type => 'SESSION'));
BEGIN
  l_query:= 
    'SELECT 
       post_id,
       user_id CARD_SUBTEXT,
       image CARD_IMAGE,
       title CARD_TITLE,
       ''' || l_url || ''' CARD_LINK,
       text CARD_TEXT
     FROM posts';

  IF v('P1_TEXT_SEARCH') IS NOT NULL THEN
    l_query := l_query||' '||'
    WHERE 
    (   
     CONTAINS(title, ''' || v('P10_TEXT_SEARCH') || ''') > 0 
    ) OR
    (
     CONTAINS(text, ''$' || v('P10_TEXT_SEARCH') || ''') > 0
    )
   ';
  END IF; 
  htp.p(l_url || ': ' || l_query);
  RETURN l_query;
END;

The l_url variable is my attempt to load the "Post" page which will eventually have the post_id sent in the URL. The page number for the Post page is 11.

When I use "1" (Home page) as the page number it worked fine. But when I used 11 an odd error occurs

Firstly the standard error

 1 error has occurred

   - Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00911: invalid character

But the odd part is a line of text is spat out at the very top of the application that says the following:

javascript:apex.navigation.dialog('f?p=4000:11:15325469163221::NO:::\u0026p_dialog_cs=Q1H4HM_OXFo_ZS45s-NOciyBPvE0vUNqa7JH2d-wczZD8Yom-OFjYOrWO4XNE6ciYtHJ0MCQL8cbir4OVFGtUg',{title:'Create Master Detail',height:'480',width:'800',maxWidth:'1200',modal:true,dialog:null,resizable:true,minWidth:500,minHeight:400},'a-Dialog--wizard',this);: SELECT post_id, user_id CARD_SUBTEXT, image CARD_IMAGE, title CARD_TITLE, 'javascript:apex.navigation.dialog('f?p=4000:11:15325469163221::NO:::\u0026p_dialog_cs=Q1H4HM_OXFo_ZS45s-NOciyBPvE0vUNqa7JH2d-wczZD8Yom-OFjYOrWO4XNE6ciYtHJ0MCQL8cbir4OVFGtUg',{title:'Create Master Detail',height:'480',width:'800',maxWidth:'1200',modal:true,dialog:null,resizable:true,minWidth:500,minHeight:400},'a-Dialog--wizard',this);' CARD_LINK, text CARD_TEXT FROM posts Content-Type:text/html; charset=utf-8 Cache-Control:no-store Pragma:no-cache Expires:Sun, 27 Jul 1997 13:00:00 GMT X-Frame-Options:DENY 

It's just plain and doesn't look like it's meant to happen.

I tried copying page 11 and trying it on page 12 but that didn't work.


回答1:


The odd error looks like it could be fixed by allowing embed in frames. http://www.danielmcghan.us/2011/08/new-browser-security-attributes-in-apex.html

The query parse may have failed if l_url contains quotes, so maybe try

replace(url,'''','"')

And I don't think there's no need to use v() in these locations

IF :P10_TEXT_SEARCH IS NOT NULL THEN -- this also referred to different page
l_app number := :APP_ID;
CONTAINS(title, '$'||:P10_TEXT_SEARCH) > 0 


来源:https://stackoverflow.com/questions/34377578/cant-select-oracle-apex-card-link-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!