Problem with the help of the $s javascript function to fill a page element

Hello Oracle APEX community,

I work on a page dashboard of exploration down and have been a problem when I try to fill a Page of text (hidden or not) element using javascript built in function $s.
The feature works very well when the data is a number such as dept_id (even if the field type is varchar type). However, trying to pass what is a text the process fails, unless a value is hardcoded as parameter to the function. So, for example, I have a table with constituents by State counties. I would like to fill out (filter) a table based on when you click a bar for a State without having to submit the page. I use dynamic actions and built in javascript function in the SQL code for the graph to achieve; But even once, it works fine when I use a field varchar as the FIPS code (FIPS for Texas is "48"), but when I try to fill the page element by using the abbreviation of the State "TX" (new varchar), it fails.

Here is an example of code that works:
SELECT 'javascript:$s("P1_DEPTNO",'||d.deptno||')' LINK,
d.dname LABEL,
sum(e.SAL) sal
FROM emp e, dept d
where e.deptno = d.deptno
group by 'javascript:$s("P1_DEPTNO",'||d.deptno||')', d.dname 
And here is an example of code that does not work:
SELECT 'javascript:$s("P1_DEPTNO",'||d.loc||')' LINK,
d.dname LABEL,
sum(e.SAL) sal
FROM emp e, dept d
where e.deptno = d.deptno
group by 'javascript:$s("P1_DEPTNO",'||d.loc||')', d.dname 
However, when I hard code a value the script text works:
SELECT 'javascript:$s("P1_DEPTNO","BOSTON")' LINK,
d.dname LABEL,
sum(e.SAL) sal
FROM emp e, dept d
where e.deptno = d.deptno
group by 'javascript:$s("P1_DEPTNO","BOSTON")', d.dname
ORDER BY d.dname 
I encounter this problem on several versions of the APEX: (4.0.2.00.07 - local installation) and (4.1.0.00.28 - apex.oracle.com)

Does anyone know of this problem and how to solve? I have looked for the parameters of the element of the page itself and can not understand.
I rewrote my sql to use the fields of value of my tables instead, but I have a few objects on the page that will really depend on the data of base characters instead.

Thank you
Wayne

In your javascript that you generate, surround your value with quotes and it will then should always work with the numbers and strings (your channels are probably interpreted as variable names and that they do not exist when running, so slip out).

Example:

SELECT 'javascript:$s("P1_DEPTNO","'||d.loc||'")' LINK,

Published by: gti_matt on August 16, 2011 09:50

Tags: Database

Similar Questions

  • Problem with the assignment of functions to the keyboard. Help, please!

    Hello

    I'm trying to get the help of the keys on the keyboard to control the navigation of the timeline. I use the code AS3 work the first time, but a little crazy then past and stops working for some reason any. You are supposed to be able to navigate along the timeline with the arrow keys (go back)

    I'm sure there is an easy solution to this problem but I am new to AS3 and it cannot know.

    Any info would be greatly appreciated.

    See you soon.

    Code on the first frame of the timeline (left label)

    Stop()

    stage.addEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_3);

    function f1_KeyDownHandler_3(event:KeyboardEvent):void

    {

    switch (event.keyCode)

    {

    Case Keyboard.LEFT:

    {

    gotoAndStop ('Center')

    break;

    }

    Case Keyboard.RIGHT:

    {

    gotoAndStop ('left')

    break;

    }

    }

    }

    Code used on the fifth framework of timeline (Center label)

    Stop()


    stage.addEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_2);


    function f1_KeyDownHandler_2(event:KeyboardEvent):void



    {

    switch (event.keyCode)

    {


    Case Keyboard.LEFT:

    {

    gotoAndStop ('left')

    break;

    }

    Case Keyboard.RIGHT:

    {

    gotoAndStop ('right')

    break;

    }

    }

    }

    Code used on frame timeline tenth (good label)

    Stop()


    stage.addEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_3);


    function f1_KeyDownHandler_3(event:KeyboardEvent):void


    {

    switch (event.keyCode)

    {


    Case Keyboard.LEFT:

    {

    gotoAndStop ('Center')

    break;

    }

    Case Keyboard.RIGHT:

    {

    gotoAndStop ('left')

    break;

    }

    }

    }

    You must remove the earphone prior actions such as:

    Stop();

    stage.addEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_1);

    function f1_KeyDownHandler_1(event:KeyboardEvent):void
    {

    switch (event.keyCode)
    {

    case Keyboard.LEFT:

    {
    stage.removeEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_1);
    gotoAndStop ('Center');
       
    break;

    };

    case Keyboard.RIGHT:

    {
    stage.removeEventListener (KeyboardEvent.KEY_DOWN, f1_KeyDownHandler_1);
    gotoAndStop ('left');

    break;

    }

    }
    }

  • Problem with the tool pen creating a fill when I want only the stroke

    Hello

    I'm having a problem. I create a simple spider for a project. Initially, I used the pen tool to make the legs. He worked for a bit, then started suddenly in an area that I has yet to draw with the fill color. I don't know what I did to cause this happens. Any help would be appreciated. Thank you

    colorkey stroke.png

    This form shows a yellow fill, probably from the last shape you drew.  If you select the form and clear the fill, your drawing will return to black lines only.

  • Problems with the maximum number of items on a page boundary?

    I have a page with 106 points that subjects very well, but when I add another element (a text field) get a 404 page error when I click on the submit button. I had a glance at [m-2399990], which mentions that the 'rendered by page elements' limit is 100. I'm not sure that this limit is the problem or not. I would be very happy any help you can give.

    Thank you very much
    Christopher

    Hi Christophe,

    I had the same problem, the solution was to divide the only forum in two tab pages.

    More than 100 items on form or a Page

    Hope this helps

    Concerning
    mozkavra

  • Problems with the print screen function

    I have 2 PCs, one with a monitor 17' and the other with a 24 "monitor: I use the screen function print on both the PC with a 17 '' monitor prints normally, but the one with the 24" print screen WIDE, is it possible I can do the PC with the monitor 24 "print normally as the monitor 17" don't?

    Hi David,

    Please contact the Microsoft community. We will be happy to help you with your concern.

    According to the description, screenshot image is large and you want to get it in normal size. Am I wrong?

    Screenshot should give a 1:1 copy of the screen, you can check the zoom value, but it will be set to 1 x when you open it.

    Please send us a screenshot of the screen so that we can check that the size and let you know.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/how-do-i-post-a-screen-shot-on-this-forum/c86de820-C620-401c-A804-9f6337cd3053

    Thank you

  • Problem with the CAE policy function

    Hi all
    I'm trying to set the tables of data with the DTV and get "ORA-28112: cannot run the political function" error when I query the table.
    ---------------------------------------------------------------------------------------------------------------------------
    -My diagram is "sales".
    grant Ridge no matter what context of balances;

    -created the context by using this statement
    create or REPLACE context sales_APP_CTX using PKG_SECURITY ACCESSIBLE on a GLOBAL scale;

    -Package specifications
    CREATE or REPLACE PACKAGE PKG_SECURITY
    function vpd_sec_pol_func return varchar2;
    procedure set_sales_app_context (p_user varchar2, p_security_level varchar2);
    end;
    /


    -package body
    CREATE or REPLACE PACKAGE BODY PKG_SECURITY
    ---------------------------------------------------------------------------------------------
    function vpd_sec_pol_func return varchar2 is

    -v_user varchar2 (100): = UPPER (portal.wwctx_api.get_user);
    Start
    If not for the user ("SALES", "ORACLE") then
    return ' State in (select State from app_user_states where user_id = sys_context ("SALES_APP_CTX", "APP_USER"))';
    on the other
    Returns a null value.
    end if;
    end;
    ---------------------------------------------------------------------------------------------
    procedure set_sales_app_context (p_user varchar2, p_security_level varchar2) is
    Start
    DBMS_SESSION.set_Context ('SALES_APP_CTX', 'APP_USER', p_user);
    -dbms_session.set_context ('SALES_APP_CTX', 'SECURITY_LEVEL', p_security_level);
    end;
    ---------------------------------------------------------------------------------------------
    end;
    /

    -The policy has added to the table
    Start
    dbms_rls.add_policy
    (object_schema = > 'SALES')
    object_name = > "SALES_SUMMARY"
    POLICY_NAME = > "SALES_SUMMARY_POLICY"
    function_schema = > 'SALES. "
    policy_function = > ' PKG_SECURITY. VPD_SEC_POL_FUNC',.
    statement_types = > 'SELECT, INSERT, UPDATE, DELETE.
    update_check = > TRUE);
    end;

    -I was able to put into context using sqlplus in running the procedure
    exec ('TEST_USER', 'R') PKG_SECURITY.set_sales_app_context;
    ---------------------------------------------------------------------------------------------------------------------------

    What I am doing wrong?

    Thank you

    Hello

    ORA-28112 only tells you that there is real error messages in a trace file on the database server. I forgot if the trace file is generated in the bdump or udump directory. Post messages.

    The political function should look like this:

    FUNCTION policy_function (object_schema IN VARCHAR2, object_name VARCHAR2)
            RETURN VARCHAR2 
    

    You don't have to use the arguments (I do not usually), but they have to be there. The system will call your function with two arguments of VARCHAR2, so he must accept two arguments of VARCHAR2.

  • Problems with the screen capture function

    Very well. I've read the help file on the computer and perform a search on screen captures on the forums, I found the help file.

    My screenshot function does not work. I tried different combinations of buttons according to what each recommended help file and it does not work.

    I worked with other operating systems that allow the user to enter a settings menu and manually configure a key for the screenshots.  Is this possible with vista?  If Yes, where can I find it?  The help files are a little vague.

    I should also mention that I am not the first owner of this laptop, so it is quite possible that the previous owner has changed a setting somewhere along the way.

    Any help is appreciated. Thank you.

    PrintScreen and ALT + PrintScreen are the usual combinations.  Check the manual for your specific computer model to see if using a different combination. See if paste in a program other than Paint made work.
    Boulder computer Maven
    Most Microsoft Valuable Professional

  • Problem with the external PHP function

    I'm working on a registration page. This is the list of instructions that I have that must be met for the registration succeed:

    If (isset($_POST['register']))
    {
    If ($_POST ['username']! = ")
    & & (strlen($_POST['username']) > = 4)
    & & (strlen($_POST['username']) < = 20)
    & & alpha_numeric($_POST['username']) == TRUE
    & & $_POST ['password']! = ''
    & & (strlen($_POST['password']) > = 4)
    & & (strlen($_POST['password']) < = 20)
    & & alpha_numeric($_POST['password']) == TRUE
    & & $_POST ['mot_de_passe2'] == $_POST ['password']
    & & $_POST ['email']! = ''
    & & valid_email($_POST['email']) == TRUE
    & & $_POST ["email2"] == $_POST ['email']
    & & $_POST ['accepts'] == TRUE
    & & checkUnique ('user_data', 'username', $_POST ['username']) = TRUE
    (& & checkUnique ('user_data', 'email', $_POST ['email']) == TRUE)

    External functions "checkUnique' at the bottom just do not seem to work. I can easily sign up with a username or email that already exists in the database.

    This is the code for the external function:

    function checkUnique ($table, $field, $compared)
    {
    $query = mysql_query ("SELECT '.mysql_real_escape_string ($field)'. OF ".mysql_real_escape_string ($table)." WHERE ' ".mysql_real_escape_string ($field)." " ' = "'.mysql_real_escape_string ($compared).'"')";

    If (mysql_num_rows ($Query) == 0)
    {
    Return TRUE;
    }
    on the other
    {
    return FALSE;.
    }
    }

    AngryCloud wrote:
    > External functions "checkUnique' at the bottom just don't seem to work.
    > I'm easily able to sign with a username or an email that is already in the
    > database.

    No, it won't work: you are surrounding the name of the field in quotation marks.
    You should also remove magic quotes if they are enabled. Change of the
    function to this:

    function checkUnique ($table, $field, $compared) {}
    If (magic_quotes_gpc()) {}
    $table = stripslashes ($table);
    $field = stripslashes ($field);
    $compared = stripslashes ($compared);
    }
    $table = mysql_real_escape_string ($table);
    $field = mysql_real_escape_string ($field);
    $compared = mysql_real_escape_string ($compared);

    $result = mysql_query ("SELECT $field FROM $table
    WHERE $field = '$compared' ");
    {if (mysql_num_rows ($result) == 0)}
    Return TRUE;
    }
    else {}
    return FALSE;.
    }
    }

    Of course, you will also need to connect to MySQL and select
    the database before calling the function.

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • I ve using Muse for quite some time now. I love. But when you use the latest version and a new website I have a problem with the FTP export function.

    I've never had this happen before? I ve used Muse for a long time now and it has always worked well.

    Download Muse ONLY php and css files when I use export to the FTP host. No html? It has never happened before.

    If I export to HTML and use my regular FTP program to transfer to the correct host folder it works fine.


    In fact, if I try to update the site of work of Muse, to load on the FTP host, Muse removes html files in the folder and the site no longer works...

    Anyone?

    Please try to check if the exported file includes all of the files, try to export again in a new folder, and then check.

    Thank you

    Sanjit

  • Problem with the creation and display of intelligent insights

    I have a problem with the intelligent preview function. I use Lightroom 6.4 on Windows 10.

    • When I hit the "Original Photo" icon under the histogram in the develop Module, nothing happens: the remans icon exactly the same and no record Preview Smart is created in the catalog folder.
    • When I create a Smart overview in the library Module (library-> Previews-> generate Smart previews), a Preview Smart folder is created in the catalog folder, BUT , in the module development, l ' icon below the histogram says still 'Original Photo': it does not seem to recognize that a smart preview is available.

    Any idea?

    Rob.

    If everything works as you want, so you can leave the open Historgram.

  • I have a mac book pro 2009 model, now when I try to load it, there is no green light on the adapter and the laptop does not charge. Not sure if there is a problem with the card or the battery or the laptop. Kindly help

    I have a Mac book pro 2009 model, when I try to load it it not there no green light on the adapter and he is in charge. Not sure if there is a problem with the adapter or the battery or the laptop. Kindly help... Thank you

    Have you tried:

    Portable Apple computers: Troubleshooting MagSafe adapters - Apple Support

    This is the Office Mac Pro forum. I asked that your post be moved to the MacBook Pro laptop forum.

  • lately and I don't know why I see a pop up of a problem with the script. can some1 help me?

    There is a pop up of a problem with the script. He asked end and contuniue the script. I didn't have this problem before. Please help me this is getting really annoying. He asks a lot

    I changed a theme and almost never have a problem again...

  • my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    My iphone 6 has started having the same problem. Its literally the GPS. Saying that it does not find me at all. Ive seen say location for more than an hour in the suburbs of chicago. It started to happen to me after I downloaded the latest update for the iphone. I hope they react and let you know what is happening because I'm dying to know as well.

  • Problem with the installation of the assembly please help

    I get this messege and he says that the problem is "Microsoft.VC90.CRT, version ="9.0.21022.8", publicKeyToken ="1fc8b3b9a1e18e3b"processorArchitecture ="x 86", type ="win32

    Please help me with this problem because I can not install programs or updates

    Hi killerinthesand,

    What version of Windows are you using?
    Please check this thread on the forum for Games for Windows.  It is a similar problem with the same error as yours.  Try the steps you propose to see one of them will help to solve your problem.  This is most likely a problem to produce a Games for Windows client.  Have you installed this recently too?

    http://forums.gamesforwindows.com/t/566.aspx

    Let us know the results, Kevin
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Hi.I download Microsoft Security Essentials and installation becomes a problem with the code: 0 x 80070643. If you can help me...

    Hi.I download Microsoft Security Essentials and installation becomes a problem with the code: 0 x 80070643. If you can help me...

    Support Microsoft Security Essentials forums
    http://social.answers.Microsoft.com/forums/en-us/category/MSE

    Can I install Microsoft Security Essentials [or any other anti-virus/anti-spyware application] to clean my already infected computer?
    http://social.answers.Microsoft.com/forums/en-us/msescan/thread/87058857-D181-4019-a723-efd9a49d9275

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

Maybe you are looking for

  • Windows 8 request password - I don't want to enter

    At the start of my laptop it shows my email address and asks for my password. I don't want to enter a password. How can I get rid of this because my wife wants to use the computer

  • Help C: disk full

    How to transfer my files from C: to D:? I've heard people tat right click. After a right-click what should I do? Please explain to mi in a long-running method. Thank you

  • write the Bay of cluster

    I have a table of cluster (global variable) that I am filling with all the elements that need to be connected on my experience are doing inside the Subvi. The Subvi is called each loop to check the pressure on my analog channel. When the pressure rea

  • Cascading Menus strangeness

    I met some strangeness with cascading menus which is neither intuitive nor documented.  I use cascading menus to help the user to complete and modify a table containing a limited set of choices.  The intention is that many of the level 1 menu choices

  • Internet connection required: Server error: 0x800CCC90, error number: 0x800CCC92

    Original title: Windows Mail in Vista Can anyone help please.  I tried to open my email this morning - as usual - and it asks me to enter my username and password.  I did it several times but it won't let me and I get as part of the error message: -.