Accessing substitution variables in static uploaded javascript file

Hi there,
I just created variables and a pageinit function in my page header and try to access these variables (Flow_Id, Page_Id etc) within a js-file I uploaded into workspace static files.
I try to use them within an URL ( e.g. "f?p="+ Flow_Id + ":100:" + Session_Id ), but they are -undefined- and thus lead to a 404-Page!
Here is the code:
onload="pageinit()"             //in page html body attribute
//and the following code in the html header
<script type="text/javascript">
<!--
var Flow_Id; // application id
var Page_Id; // page id
var Session_Id; // session id
var Request; // request value
function pageinit(){
Flow_Id = html_GetElement('pFlowId').value; // application id
Page_Id = html_GetElement('pFlowStepId').value; // page id
Session_Id = html_GetElement('pInstance').value; // session id
Request = html_GetElement('pRequest').value; // request value
//-->
</script>Can someone please point me to the right direction!?
Thank you very much.
Regards
Johnny

Hi Paul,
I tried with IE 8 now and could at least find out now, which lines of code are responsible for the error:
addmenu(menu=[                    
"mainmenu",                    
69,                         
153,                         
1,                         
style1,                         
1,                         
"left",                         
1,                          
0,                         
,"Home","f?p=" + $v('pFlowId') + ":100:" + $v('pInstance'),,"",1 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
,"Tab2","show-menu=list01","tab2.html","",1
,"Tab3","f?p=300:1:","tab3.html","",1
,"Tab4","show-menu=list04","tab4.html","",1
])It must be the way I try to create the first URL (for Home) I already mentioned, because if I hard-code the URL, it works without errors.
I could hard-code the URL, but then I always get a new session-id. So, at least I need to find a way of accessing the current session-id here.
As mentioned before, I also tried to set global variables within a javacript function in the page header and assigning the current values for the session and app-id and reference these variables within the js-file I uploaded to the static files. But that did not work either. These variables were undefined.
I guess they were undefined because at the time when the function was processed the variable might not have been set yet.
But I followed exactly the solution Carl Backstrom mentioned in some of his posts some years ago. God bless him.
I am not a javascript expert, so maybe you got a hint for me!?
Thanks again for your support.
Johnny

Similar Messages

  • Using &APP_ID. in uploaded javascript file

    Hi dev's,
    I fumbling around with a quite annoying problem.
    When I create a javascript directly inside the "Header Text" of my page the script works perfectly:
    &lt;script type="text/javascript">
    function fnc_setTreeItem (pItem)
      var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);
      get.add(pItem,$x(pItem).value)
      gReturn = get.get();
      get = null;
    &lt;/script> But when I use an uploaded javascript file instead because the source code becomes to much then the script runs on an error:
    <!-- Custom js, css, libs -->
    &lt;script type="text/javascript" src="#APP_IMAGES#ukd_monitoring.js">&lt;/script> Firebug error description:
    syntax error
    E()apex_ns_3_1.js (line 1)
    ? in apex_ns_3_1.js@1("ContentArea")apex_ns_3_1.js (line 1)
    $x("ContentArea")apex_3_1.js (line 1)
    $x_Style(["BB", "ContentArea", "ContentBody" 0=BB 1=ContentArea 2=ContentBody], "display", "")apex_3_1.js (line 1)
    $x_Show(["BB", "ContentArea", "ContentBody" 0=BB 1=ContentArea 2=ContentBody])apex_3_1.js (line 1)
    filterAttributeRegions(a.htmldbButtonListCurrent f?p=4000:4...1,150#HEAD, "#HEAD")apex_builder.js (line 1)
    propTest()apex_builder.js (line 1)
    ? in apex_3_1.js@1()apex_3_1.js (line 1)
    [Break on this error] var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);\nIs there a possibility to get the APP_ID work inside an uploaded file?
    Best regards,
    Tobias

    Hello Tobias,
    Use $v('pFlowId') instead. That should work...
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Uploading javascript file under static files

    We uploaded the javascript file under static files. By default the mime type is "application/octet-stream". We are accessing this js file in our application however this is not working.
    Is this because the mime type is "application/octet-stream"?
    Please let us know how to change the mime type to javascript.

    Actually, we were having the same problem and determined it to be an IE bug. If we upload the .js file using Firefox, it saves as the correct mime type, x-javascript. If we use IE8, it gets uploaded as octet. Because of this, Firebug did not recognize the file, we got the following error: "the resource from this url is not text: " with the link to the uploaded file. Hence, none of the functions included in the file worked in our application.

  • I need to access/pass variables'(s) of a .swf file into another .swf file.

    Hi all,
    I have basic knowledge of Flash and AS3.0.
    Suppose i have a flash swf file(main.swf). In this main.swf
    file, i loaded another swf file(sub.swf) by writing the following
    code snippet in main.swf file as shown in Attach Code:
    Now, how to acess the data present in main.swf into sub.swf.
    Note: Here data represents values/data stored in
    variables/objects of main.swf file.

    Does this actually work -- assigning variables directly on the loader?  I'm interested in setting flash variables on the loaded SWF, but I get a compilation error when trying something similar:
    Error: Access of possibly undefined property x through a reference with static type flash.display:Loader.
         [exec]
         [exec]             textLdr.x = 50;
    I also tried casting the loader to Object, which compiles but then fails at runtime.
    -Dave

  • Substitution Variables in Essbase Load Rules File

    Hi,
    Has anyone tried using substitution variables in Load Rules File Header definition?
    I need to load data based on the Year & I have different Files for 3 Years- CurYr, BudYr1 & BudYr2. Is it allowed to specify the Year Substitution variable in the Rule File Header? I am getting an error while loading.
    Appreciate your thoughts.
    Thanks,
    -Ethan.

    Tim,
    Thanks for the response.
    I figured it out. The error message I was getting was because of some parsing issue. I have defined Year as "FY12" in quotes. I removed quotes & it worked.
    Thank You.
    Ethan.

  • Upload javascript files for edge animate banner to work in  Content Management System (was: how do upload...)

    how do upload the javascript files for the html edge animate banner to work in my Content Management System module. At present, the html cannot function because the reference javascript files are missing.

    I am not very sure how the CMS manage their content but basically the javascript files need to be in the same folder as the HTML file for Animate content to play.

  • Substitution variable in sql load rules file

    Okay gurus,
    I need a little guidance, I have to replace the value of 201020 and 2008 from substitution variables. I have created the variables and set them up globally on the essbase server.
    201020 = FW00
    2008 = FY00
    WHERE ACT.FISCAL_WEEK_ID <= 201020
    AND ACT.FISCAL_YEAR_ID > 2008
    AND RTDIV.DIV IN (1,2,3,4,5,6,7,8,9,99) (This is the query with hard coded values of week and year)
    When i m trying to put sub variables there , its throwing the error. please find below the way i was trying to do it.
    WHERE ACT.FISCAL_WEEK_ID = '&FW00'
    AND ACT.FISCAL_YEAR_ID = '&FY00'
    But unfortunately, its throwing error Error: 1021001 Failed to Establish Connection With SQL Database Server. See log for more information
    I know that this is the generic error because if i put the hard coded value in sql load rules it works fine.
    Is it the right way to out sub var in sql load rules???
    Please advice and thanks in advance.

    Hi Genn,
    I tried to see the app log for sql but i m afraid that there is nothing in there, the only error message which I am getting in app log is this:
    Failed to Establish Connection With SQL Database Server. See log for more information
    Its an ASO cube and initially i was using the variable as FY00 AS "2008" it did not work and than i tried without quotes in variable but is still not working.
    Any idea..thanks in advance.

  • Unable to access process variable value in the DXFA file

    Hi,
    I am using the On-Demand-Assembly solution accelerator to stitch forms. I am trying to access a process variable inside the dxfa file.
    This is the syntax i used: <c:forEach var="templateItem" items="${requestScope.paramsMap.templateList}"> The templateList value is not being fetched. The same code works fine if I hard code the items.
    paramsMap is set as the Parameters Map variable in the invokeODADocument service.
    Any suggestions on what I might be missing here??
    Thanks.
    Regards,
    Vidya

    Vidya Kesavan,
    Just a shot in the dark here, but I think you may have a typo in "requestScropt.paramsMap.templateList" where "paramsMap" should be "paramsmap" in the context of the CSC template. That could be the cause, making it impossible for ODA to find the variable you're referencing. (I believe it's "paramsmap" within the CSC regardless of what name you have the Parameter Map process variable.)
    Stefan
    Adobe Systems

  • Use uploaded JS file

    Hi all,
    How to use uploaded javascript file in page. Here i tried the following way but not getting the result.
    Created a file named att_val.js and uploaded that file shared component->static file. and added the following code to the HTML Header section of the Page attributes.
    <script src="#APP_IMAGE#attr_val.js" type="text/javascript"></script>
    When i press a button the function in attr_val should be called. But it is not callling the function.
    Thanks.

    Hi,
    Try
    <script src="#APP_IMAGES#attr_val.js" type="text/javascript"></script>NOTE! plural IMAGES, not IMAGE
    if that do not work, try also
    <script src="#WORKSPACE_IMAGES#attr_val.js" type="text/javascript"></script>Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Edited by: jarola on Dec 6, 2011 2:56 PM

  • Essbase substitution variable used for SQL Dimension load-URGENT

    Hi All,
    I am creating one dimension through SQL Dimension load rule writing by parent child build rule. The SQL query is like below---
    distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date(&Proc_date,'dd/mm/yyyy')
    When I fixed the value of proc_date (e.g.- '27/09/2008') then it is retrieving data properly, but when I try to make the same as a essbase variable as shown above (to give user the priviledge to select for which date data will be fetched from RDBMS to create the dim) and after setting the aforesaid value of that variable in essbase subs var screen and click 'OK/Retrieve' in rule,it is returning no rows executing the query as well as no error coming.
    I guess in query nothing is wrong but the subs variable part is not working. Can anybody please give some insight to resolve the problem.
    In this context, I would like to mention that I will have to use substitution variable in some other rule file also to automate the load process. How can I use essbase subs variable in SQL load rule? Could you please show me a proper summarise query illustrating how to use the subs var in aforesaid purpose for the sake of understanding?
    Thanks in advance.

    Hi,
    Sorry for delayed response. Appreciate your inputs. At last I have found out the solution which is as below----
    distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date('&Proc_Dt','dd/mm/yyyy')
    after setting the substitution variable as Proc_Dt and set the value as 27/09/2008 (without any quotation mark or such sign) now I checked and now it is retrieving fine.
    Thanks & Regards.

  • Substitution variable in javascript

    Can you use the value substitution variables like WORKSPACE_IMAGES and IMAGE_PREFIX in a javascript function? When I use the $v function to retrieve the value it returns undefined.

    Hello peter,
    >> Can you use the value substitution variables like WORKSPACE_IMAGES and IMAGE_PREFIX in a javascript function?
    The actual substitution action is performed by the APEX engine as part of the rendering page process. That means that the substitution string must be available to the APEX engine, and for JavaScript code it can happens only for inline code.
    If you are using an external JavaScript file, you can’t use substitution strings directly. All the variables that the JavaScript code can use must be part of the current page. That’s why the APEX engine automatically adds some very common (and very needy) substitution strings, like APP_ID, APP_PAGE_ID and SESSION, as hidden item on every page. You can mimic this to add the specific substitution strings you need.
    In your page template, you can add something like:
    <script type="text/javascript">
    var workspaceImage = '&WORKSPACE_IMAGE.';
    var imagePrefix = '&IMAGE_PREFIX.';
    </script>As these variables are declared outside any specific JavaScript function, they will be defined as global variables, and as such will be available to all your JavaScript functions in the external file. Adding it to your page template will make them available on all your application pages.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Forthcoming book about APEX: Oracle Application Express 3.2 – The Essentials and More

  • Accessing JSP variables in Included Javascript

    Hey All,
    I want to hide my javascript to be viewed on the client browser.
    I know we can do that with the javascript include ,But i am using JSP variables in
    Included javascript.I can't access those variables any more.
    Does anybody know any workarround.
    Thanx
    Vijay

    Hi Vijay,
    I am also facing the same problem of hiding javascript in the client browser. My javascript variables are getting initialised on the fly using JSP. Since JSP is compiled on the server side, one can't compile .js file on the client side.
    What u can do is to divide your page into frames with
    <frameset rows="100%,0%">. Now put your form hidden fields or the .js file in frame 2 which is not visible to the user and then assign your jsp variables in the frame2 html/jsp page. Now access your variables from frame2 in frame1 using
    var i = parent.frames[1].document.forms[0].elements[0].value
    Assuming that there is 1 form and 1 hidden field in frame2 html/jsp page.
    I hope u get the logic rite....
    I had done it for application but problem is that our users are real MORONS and they keep doing ctrl+F5 which takes them to the Indexpage.
    If you get some other solution then please mail it to my email address
    [email protected]
    Regards
    Vimlesh

  • How do i stop the "Opening Ads" download javascript file everytime i access a website which uses googledoubleclick ads??

    Every time a access a website which has embedded googledoubleclick ads in it, i get this pop up-like thing which tells me to download a javascript file called "ads", from http://googleads.g.doubleclick.net and it asks me to save it... i would love to send a screenshot, but this question text area doesn't allow me...
    therefore, i have uploaded the snapshot .jpeg file on my website so you can see it. This has been bothering me a lot, sometimes there are pages which have embedded 5 ads, and i get a pop up for each ad. Mind you, it's not the window popup that you get, it's a download popup...
    snapshot link:
    http://www.avosarafian.com/snapshot.jpg
    regards,
    Amjo

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • Issue with rule file and Substitution variable

    Hi All,
    I am using Essbase 9.3.3
    I created a rule file with 5 dimensions in which 3 dimensions I defined in columns and two dimensions I gave it as header in data column with comma seperated.
    Among those two dimension members, one is an account member with "/" in it within quotes and other is a substitution variable.
    The member assigned for that Substitution variable has a space in between and is updated within quotes in variables list.
    When I try loading data, I am getting an error saying that two members are not valid.
    Eg: "Tax/Unit",&Scenario is not valid.
    &Scenario - "Budget Q1"
    Can some one please suggest on the issue.
    I am not facing any problem in calc scripts or reports scripts using the substition variable.
    Thanks in advance

    Mark,
    Modifying the default files is dangerous and ill advised. You could always just add a style sheet (inline or linked) to your application that overrides that one setting while you wait on the permanent fix.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

Maybe you are looking for

  • Customer statements - Email & print at the same time - Is this possible?

    Hi all, We generate customer statements at regular intervals and send them to the customers, through mail, fax and email. We have a print program which generates the customer statement. For some customers we want the statements to be printed as well

  • What are the printers/scanners compatible with My mac air

    Hi, Im trying to find a a Printer & scanner compatible to My mac book air? as Ive Had 2 different printers and booth were compatible with My mac Book air to print only But NOT SCAN??? Please advise which printer/scanners are compatible? Thank you , M

  • Inventory agent

    Running ZenWorks 11 and installing inventory agent on all servers. Having issue where VMs running on Xen 11 not working due to a serial number not being passed. Any idea how to get around this?

  • I am attempting to convert a PDF to excel it will not convert

    I am attempting to convert a PDF to excel it will not convert

  • Need help in FMS

    Hi I my website I want to upload videos or recors videos. through webcam. I am new in this field. I have some doubts regarding video uploading to FMS. I think to use Fms for storing videos. Can I able to convert uploadded video by the user using FFMP