Item value as url

I need to dynamically generate a URL from a SQL query. Basically, the query is grabbing the server name and other parameters. I tried creating a hidden page item, with source as "SQL Query" and generated my url into that item. Then I wrote a javascript function, something like:
<script language = "javascript">
function myURL()
window.open($x('P1_HIDDEN_ITEM_URL').value);
</script>And finally, for the link that needs to use the url, i used the following:
<a href="javascript:myURL();" target="_blank"><span class="style1">Click my link</span></a> --> <b>the value in a href is javascript: myURL();</b>
But, this doesn't seem to be working. In IE, I get a blank page with this in the address bar:
javascript:myURL(); And in Firefox, all I get is a blank new tab.
I tested the code in Firebug. The function call works perfectly there and opens the link that i need. I think there is something missing in the "a href".
I've done this previously but this time i'm hitting a wall. Can someone point me in the right direction?
Any help is appreciated.

I solved my problem. I was unnecessarily complicating things.
All I needed to do was:
<a href = &P1_HIDDEN_ITEM_URL. target=_blank> click my link </a>

Similar Messages

  • How to send a list item value to URL to open data related to item value

    Hi,
    Iam using Apex4.0 and iam facing some problem. Iam unable to send selected list item value to the url specified in the HTMl region.
    Here i want to open the data related to list item value in other page.
    List item - :Familyp
    i want to pass this selected value to the url and when ever user selected the list item and clicks on the url, then it should display the item value related data in new page.
    I tried with &FamilyP in url but it's not working. Any one help me plz.
    Regards
    Vamsi.Tata

    Is it a normal Select list or Multi Select list?
    If you have select list that allows you to select multiple options then you cannot pass it through URL. Multi-select /Shuttle keep colon separated list in the item, and this confuses Apex because the Apex URL uses colons for a different purpose. No escaping or URL encoding will help.
    If it is normal select list that allows selection of only one option then you can pass through the url. Unless of course the data has a colon in it.
    For multi-select, and when the value contains colon, the only way is to save the value in session state, same page item or any other place like Application Item, and then reference it at the other end. Never pass through the URL.
    Regards,

  • Reference Item value in URL

    I want to use a URL to branch from one application/page to a 2nd application/page and pass a value from an item on the 1st application/page to an item on the 2nd application/page - and within the URL also submit the 2nd application/page.
    The first application/page reflects an employee's detail, with a button to go to the 2nd app to view that employees asset detail.
    The 2nd application/page has two regions, one for a parameter field for Employee ID and a 'run' button; the second is an asset report using the parameter field as a filter for the report. The report runs on page load - when the button is pressed - a branch back to the same page happens to reload the page, this time with a filter to show the filtered report.
    On the 1st app, I am using a button and branch to page/url before processing.
    I am able to craft the URL to be able to pass a value to a page item in the 2nd application if I hard code the 'value' for the item:
    f?p=106:1:&SESSION.:RUNQUERY:::P1_EMPL_ID:12:
    This will go to page one in app 106, retain Session ID and put the value 12 into the page item (parameter field) P1_EMPL_ID.
    Question:
    1) How do I (or can I) reference an item value from app 1 in the URL instead of passing the actual value? v(P2_ID) instead of 12 ??
    2) Even when using a hard coded value like above, using 12... the parameter field gets the value, the page submit seems to run - but the report does NOT get refreshed until I press the button again. The button is - Submit as "RUNQUERY" - there is a branch back to page 1 on submit after processing when button pressed: RUNQUERY (Submit).
    So 2 questions:
    how do I reference an item value in a URL?
    am I referencing the submit part of the URL correctly?
    Thanks in advance...
    Rich

    Matt,
    The URL created when selecting the button on the first app/page is:
    http://xx.xx.xx.xx:8080/apex/f?p=106:1:3605812006071032:RUNQUERY:::P1_EMPL_ID,P1_UNASSIGNED:1%2C0
    The first app/pg button branches to this URL. I don't think the branch or REQUEST that this button makes has anything to do with the desitination app/pg REQUEST that that page is supposed to act on... That REQUEST value is also supposed to be in the URL (for me it is 'RUNQUERY').
    The desitination page is picking up the values for P1_EMPL_ID and P1_UNASSIGNED... and if I hit the button with the REQUEST value of RUNQUERY the report runs and is filtered by the values.
    I looked at the different branches there are on the destination page - and there are two that branch back to the same page.
    One is a Before Computation branch, that resets the fields back to defaults, clears cache for pg1 and is conditionally called by the 'RESET' button that resides next to the SUBMIT button... and then branches back to itself (pg 1).
    One is an After Processing branch that does no setting values or clearing cache - just branches back to itself (pg 1) and is called conditionally by the 'SUBMIT' button (RUNQUERY).
    Additional detail:
    1- When first logging into a session - and opening page 1 of the destination app - the values for the parameters are blank and the report result is 'no data found'.
    2- When first logging into a session and opening page of the 1st app, then hitting the button to branch using the URL to the destination page... the parameters are filled in, and the report result is 'no data found'
    3- In both cases - if you press the submit button (RUNQUERY) the report results show data. (either unfiltered due to no parameter values, or filtered with parameter values)
    4- if you press the submit button (RUNQUERY) on the destination page and remain in the same session, go back to the 1st app/pg, select a record... then the branch using the URL works, reflecting a filtered report. The session state for the Destiniation page is not reset - the values remain in state.
    So I don't think that an unexpected branch is happening. It seems like the RUNQUERY in the URL is not being passed or picked up and acted on.
    Rich
    Edited by: rdarlin2 on Oct 27, 2010 9:27 AM

  • Set item value at other page via URL-redirect

    Hi, I have a button and I want to open a new window with it using an url-target.
    </br>
    </br>
    javascript:window.open ('f?p=&APP_ID.:143:&SESSION.::NO:143:P143_KDT_ID,P143_MESSAGE:&P140_KDT_ID.,&P140_MESSAGE.') </br>
    </br>
    When I use branching I get an error that there is no page to branch to. I don't understand why. As a workaround I use an url-redirect when the button is pressed, but I'm stuck on getting the current item value into the target page. I tried using $v('P140_MESSAGE') but I can't get the url valid.

    Jacob,
    The problem was that when the HTML for the button is rendered, the value of P1_ITEM from session state was "glued in" to the generated URL at that time. If you then entered a value for the iterm, even though your onChange AJAX technique changed the value in session state it was too late to change the already generated HTML for the button, specifically the URL target for the button.
    I created a Set Item2 button on your page with this for the URL attribute:
    javascript:window.open('f?p=&APP_ID.:2:&SESSION.::NO::P2_ITEM:' + document.getElementById('P1_ITEM').value);
    Let me know if that does what you need.
    There is another problem and I don't know the cause. When you click the button, it opens the new window properly but leaves the original page in an error state of some kind. I could not reproduce this in my application using the same js, so I'll be interested in how you solve that.
    Scott

  • Redirecting an item value to another page..

    Hi,
    I am trying to auto-populate couple of values on page 2 when I click a button on page 1. Tried setting the item values using the comma separated list and also by re-directing to an url. Hit an issue when the values that need to be set itself contain a comma within itself. Could you let me know if there is any other de-limiter that I can use instead of a comma while setting the item values.
    For instance:
    There is a button on Page 58. When this button is clicked, I should be redirected to page 45 in the application and the values in P58_Name and P58_LocId should be auto-populated in P45_Name and P_45LocId.
    Only when there is NO comma in value of P58_Name, this works fine. But, when there is a comma in P58_Name this is what happens:
    P58_Name = Mickey, Mouse
    P58_LocId = 145
    Once the button is clicked on page 58, the fields in page 45 are auto-populated as below:
    P45_Name = Mickey
    P45_LocId = Mouse
    Will there be a way to use a different de-limiter in the comma separated list? Kindly help.
    Thanks,
    P

    the trouble is that the comma in the item name messes up with Apex URL structure, since it uses a comma separated list of item names and values..
    You can set another item with the escaped value of the item in Javascript using the escape function(builtin)
    escape( $v('ITEM_NAME'))or in PSLQL using APEX_UTIL.URL_ENCODE or HTF.encode functions
    and then refer that new item in the Branch instead of the old one one(with commas)

  • Handling of pictures changed? Item values not properly updated in Beta 3?

    I had created an application which allows to upload an image for a row, basically based on what's done in the demo app for the products table.
    Today, I exported the app and then uninstalled Beta 2 and installed Beta 3. Installation finished without any problems - so far so good, but after I recreated my tables etc. and then imported the application, the image handling just didn't work any more...
    I took a look at the demo app in Beta 3 and saw that unlike before, it looks like the blob content is no longer being inserted into the DEMO_IMAGES table, but instead remains in wwv_flow_files (now called htmldb_application_files?). This feels wrong somehow, IMO the former approach moving the file content into the custom table was much safer and cleaner.
    Also, I noticed when I open an edit page from a report link and look at the session state then, the page item values don't get updated properly (in fact nothing gets updated except for the PK value I clicked on the report page) - this feels totally wrong as well (and I suspect some kind of coincidence here why the picture upload or display doesn't work any more like before)...strange enough, the items on the page show the expected values, but in session state display they are all empty (R).
    Is it intended to leave it this way? Why did it have to be changed at all?
    Somehow frustrated,
    Holger

    Holger,
    You are witnessing a couple things here.
    One - for Production XE, the configuration of the Database Access Descriptor for the embedded PL/SQL Gateway makes use of the request-validation-function. This is a function which validates the procedures being invoked from the URL. Out of the box, only those suitable for running XE are enabled. Otherwise, any publicly executable procedure in the database could be invoked directly from the URL, and for security reasons, this needed to be locked down. Search for "Restricting Access to Oracle Database XE" in the online help and you'll see instructions how to open up this validation function for your custom procedures which are invoked directly from the URL.
    Two - you are correct, the Demonstration Application was modified to use the global upload table instead of the custom upload table in your schema. Given the security decision (mentioned above), it was a choice between not locking down the procedures which could be invoked from the URL, or providing a demonstration application which would work for all customers out of the box. Obviously, we chose the latter. From a security standpoint, I highly recommend you to use your own table as you were before.
    As far as your comments about session state and the report link, nothing has changed in this regard. This is consistent and expected behavior. I confirmed this is consistent with HTML DB 2.0 and XE Beta. Scott discussed this on the OTN Application Express forum in a number of places, including here: Re: Automated Row Fetch, when does the value hit the session state?
    Thank you for your feedback. I do appreciate it.
    Joel

  • How to set item values without using fields in branch's ACTION block?

    Okay, I will try to say this in a easy way so it is not weird.
    I have created a button, SAVE, that has a Branch of branch type: Branch To Function Returning A Page. This is my code for the branch:
    if :P2008_NAP_SUPPORTING_MATERIALS = 'Yes' then
    return '2092';
    else
    return '2040';
    end if;
    The code for this type of branch is stored in the ACTION block of the Branch page. The ACTION block for a Branch of branch type: Branch To Function Returning A Page is different than the ACTION block for a Branch of branch type: Branch To Page Or URL.
    I need to set some item values with some specific values, which I can do with a branch type: Branch To Page Or URL. This is not possible with the branch type: Branch To Function Returning A Page. The ACTION block is totally different.
    How can I set some values on say Page 2040 from Page 2008 without using fields in the branch's ACTION block?
    Thank you in advance,
    Maggie

    Andy and Scott,
    I love seeing different perspectives in solving problems, it opens my eyes to new ways of looking at/using the tools (reserved words and 'Function returning a Page', etc.).
    One of my pet peeves has been that on branches I was limited to only 10 variables to be passed (I know, who would want more - but there was an instance where I had to pass more), and an even more frustrating time when using report Column Linking, which limits me to 3 variables.
    At least with the Branch linking I can use your suggestion Andy and add the variable setting statements into the function. I am assuming of course (and I should be able to) that I will be able to set more that 10 variables in a IF condition prior to the RETURN statement. This method will be much more understandable, for me, when looking through the branch at a later time to see what is happening, than an URL link where all the variable are strung out 'in a line' so to speak.
    I will still need to use URL Target branching on Links contained within a Column Attribute when I need to pass more than 3 variables, of which I have several places where I do this.
    Thomas

  • Item value on column link is not posted in 3.0

    Hi,
    I've on page 120 a column link to page 122 with 3 items: P120_X, P120_Y, P120_Z with the values set #P120_X#, #P120_Y#, #P120_Z# . If the value of P120_Z = # , then only P120_X und P120_Y are available at Page 122. P120_Z is NULL. My Version is Apex 3.0 now. This was working in Apex 2.0. Any idea how to solve this issue.
    Thanks and Regards
    Juergen

    Juergen,
    I don't know why it worked in 2.0 but if you pass # as the item value in a URL without encoding it it will look like the start of a named anchor reference.
    Just another reason not to pass arbitrary character data in URLs; stick with numeric primary keys as much as possible.
    Scott

  • Passing LOV Value on URL

    I've tried searching through the forumn and the documetation for APEX, but I could not find how to pass an LOV value on the URL.
    I.E: Multi-Select list with values 1;3;5 selected.
    You can't put 1;3;5 in the URL's item value spot as the semi-colons will throw off the parsing of the URL.
    Obviously an LOV with only 1 selected value is possible as it does not require any semi-colons.
    Ideas?

    Passing the value on the URL is a must here is why:
    The functionality being provided is a basically a search that appears inside of an iframe that is styled to look just like a standard pop up. The search functionality allows for different criteria to be searched upon based upon a number of given fields at the top. At some points it is nicer to provide default search criteria based upon the context of the parent page's item values in session state (which is usually not editable by the user); one of these being from a value set from a multi-select list.
    The page when opened will open with the default criteria already applied with the list of selectable items being shown. Going through the DOM to obtain the item is not an option because
    1) The page should not visibly refresh after it opens and loads.
    2) Even if visible page refresh were an option: The iframe is calling a page that can be shared between other pages (meaning its searching function is atomic and reusable) and the source value item can and does change. Which in turn means that the element's ID is not referenceble unless it was passed into the page. But then again, refreshing a page and rednering it twice does not look good.
    Passing the value on the URL would be most advantageous as it requires only a single page render inside the iframe.

  • Hide value from url

    This forum has been a greate help, I learned a lot by asking questions here.
    Have a customized query that generated a link icon to another page. The url pass the primary key along with some item values to the linked page. It works.
    My question is if I compared my url link (by hovering the mouse to the link icon) to a link that was generated by APEX using same primary key and items, I see my homemade url exposes all the item values that I have passed to. However, apex generated page only exposed the primary key value, the rest seems a combination of hex charactier. How can I make it behave like the apex generated link icon ? thanks.
    example of the generated url by hovering the mouse on the link icon
    from APEX:( just the item part in the url), it seems apex always prefix 2c for each susequent item value after primary key)
    PID,ITEM1,ITEM2:496%2C128%2C128
    my own
    PID,ITEM1,ITEM2:496,128M,ercury%20Beauty%20/%20Bun%20Test
    Wan

    Wan,
    I am not sure if there is any direct way to do that, however %2c is the standard HTML url encoding character which represents a comma(",") and %20 is for space.
    http://www.w3schools.com/TAGS/ref_urlencode.asp
    If you are interested in hiding values in the url you can encrypt the item values before page branch and decrypt using the same algorithm once you reach to the target page. But this will slow down the page branching and also it require extra efforts to develop page branching algorithm of each url navigation. Thanks.
    Regards,
    Manish

  • Handling HTML-reserved characters in passed item values

    I've got a pair of pages in an application where one gets an item value from an inline value of a report on the other page. Since the link I created is conditional, I used the concatenate html string method to create the link. However, some of the values that are getting passed contain "+" as part of the value. How can I get this value to pass via the concated HTML string?
    Here's the SQL I'm using:
    SELECT x.*
    ,decode(x.source,'S','<a href ="f?p=&APP_ID.:403:&SESSION.::&DEBUG.:RP:P403_PAGE_LOAD,P403_LOT_NO,P403_ATTRIBUTE:1,'||x.lot_no||',\'||to_char(x.attribute)||'\">S</a>','P') as icon
    FROM x
    where x.attribute sometimes contains the "+" character.
    Any help would be appreciated!

    Thank you both for replies ....
    Since these urls are generated through code, what is the best way to go about it ?
    Could you please explain a little about using of hash map in this case?
    and excpet using escape characters, is there any other way to do it ?
    Thanks again

  • 2.2 item values passing w oracle reports

    Since upgrading from 1.6 to 2.2, The url to an oracle report does not pass the item value to the report.. also, it drops the item value and just leaves the &. This was working fine in 1.6...
    This is my link in htmldb:
    http://apps.mytxi.com/reports/rwservlet?report=e:\\prod\\reports\\agg_production.rdf&server=schedserver&destype=cache&desformat=pdf&cmdkey=dbuser1&P18_LOB=&P8_LOB.&p18_tkt_loc=&P8_TKT_LOC.&p18_date99=&P8_DATE99.&p8_draft_approval=&P8_DRAFT_APPROVAL."
    and this is what it does when you call the report:
    http://apps.mytxi.com/reports/rwservlet?report=e:\\prod\\reports\\agg_production.rdf&server=schedserver&destype=cache&desformat=pdf&cmdkey=dbuser1&P18_LOB=&p18_tkt_loc=&p18_date99=&p8_draft_approval=
    any help will be greatly appreciated...
    thanks

    Steve - Try upper-casing each item value expression (&P18_TKT. instead of &p18_tkt.) and see if that fixes it. If it does, then check the setting of Exact Substitutions in the application's attributes. If that is No, set it to Yes. If it was No and you change it to Yes, you should then be able to use the original link you were using with the lower-case expressions. However it you find the setting to be No and upper-casing the expressions doesn't help or if you find the setting to be Yes or you change it to Yes and neither lower-case nor upper-case expressions work, we will have to look into it further. If you do change the setting from No to Yes, you will have to locate all item name expressions in your application that might not have the trailing period and add the period.
    Scott

  • AjaxRequest not assigning Application Item value

    Hello,
    I have an application item called DESTINATION_PAGE and a page item called P63_NEXT_PAGE. I have an Application process that does the following:
    declare
    begin
    select get_page(:PLATFORM) into :DESTINATION_PAGE from dual;
    htp.p(:DESTINATION_PAGE);
    end;
    This is my AjaxRequest in P63 Header:
    function getPage(platformID){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_PAGE', 0);
                             ajaxRequest.add('PLATFORM', platformID);
                             ajaxRequest.add('APPLICATION_ID', $("#P63_APPLICATION_ID").val());
                             ajaxResult = ajaxRequest.get();
    $("#P63_NEXT_PAGE").val(ajaxResult);
    alert($("#P63_NEXT_PAGE").val());
    $("#DESTINATION_PAGE").val(ajaxResult);
    alert(&DESTINATION_PAGE.);
    From my above 2 alerts, the page item (P63_NEXT_PAGE) gets the correct page number of 14, but the application item (DESTINATION_PAGE) still has the old page number of 63! Please help, this is really frustrating because I need to use the Application Item in a URL request. I've tried using $s('DESTINATION_PAGE',ajaxResult) as well as additional functions, but my Application Item still is not updating correctly.
    Thanks in Advance!
    Johnny

    Hello Jarola,
    I have tried using the SET_SESSION_STATE, but the problem is I need to grab a new value from a select list prior to assigning value to the Application Item. Here is my new DA that I created to set session state. The problem is that P63_PLATFORM_ID still has the old value at this point which is why I thought I had to use an AjaxRequest:
    declare
    page_no number;
    BEGIN
    select get_page(:P63_PLATFORM_ID) into page_no from dual;
    APEX_UTIL.SET_SESSION_STATE('DESTINATION_PAGE',page_no);
    END;
    Any idea how I can get the new value in P63_PLATFORM_ID prior to running the above PL/SQL DA?
    Thanks,
    Johnny

  • How to passback report item value

    Hi,
    Below coding is passback value from popwindow to the screen fields. P2_BOOKING_NO,P2_CUSTOMER_CODE,P2_REF_CUSTOMER_CODE are form fields. i have a report, that report have booking_no a reference key of form field booking_no. So both form and report table has booking no. So using join to retreive or passback the report data also. my problem is how to passback the report data. below coding is only for form field. i dont know how to passback report item value from popup window to the screen.
    popup window javascript:
    <script language="JavaScript">
       function passBack(passVal1, passVal2, passVal3)
       opener.document.getElementById("P2_BOOKING_NO").value = passVal1;
       opener.document.getElementById("P2_CUSTOMER_CODE").value = passVal2;
       opener.document.getElementById("P2_REF_CUSTOMER_CODE").value = passVal3;
       opener.document.getElementById("P2_REF_CUSTOMER_CODE").focus();
       close();
    </script>
    Link in popup window:
    javascript:passBack('#BOOKING_NO#','#CUSTOMER_CODE#','#REF_CUSTOMER_CODE#');
    page javascript:
    function callMyPopup (formItem1,formItem2,formItem3) {
        var formVal1 = document.getElementById(formItem1).value;
        var formVal2 = document.getElementById(formItem2).value;
        var formVal3 = document.getElementById(formItem3).value;
        var url;
      url = 'f?p=&APP_ID.:3:&APP_SESSION.::::P3_BOOKING_NO,P3_CUSTOMER_CODE,P3_REF_CUSTOMER_CODE:' + formVal1 + ',' +
    formVal2 + ',' + formVal3;
      w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
      if (w.opener == null)
      w.opener = self;
      w.focus();
      }How to do this?
    Skud
    Edited by: skud on May 20, 2011 5:47 PM

    Hey Skud,
    I am trying to implement something similar and definitely need assistance. Were you able to resolve this issue?

  • Setting an item value before print report in BI Publisher

    Hi,
    I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
    I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
    Is there any way to set the item value on the page before branching to the report?
    Your help is greatly appreciated.
    -Marsha

    Marsha,
    You can do that as follows:
    1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
    2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
    3- In your page >> edit >> HTML header >> type in :
    <script language="JavaScript" type="text/javascript">
    function set_date()
    v_date = $x('P20_DATE_HIDDEN').value;
    $x('P20_DATE_LETTER_SENT').value = v_date;
    </script>
    Hope this helps,
    Sam
    Please reward good answers by marking them correct or useful!

Maybe you are looking for