Accessing a javascript variable within a EL, does anyone ....

know how to do this.
I have a variable, say eventid, defined as:
<SCRIPT>
var eventid = "GA20045533";
</SCRIPT>
and a button defined as:
<hx:commandExButton >
   <f:param id="param_eventID" name="eventID" value = "#{window.eventid}" ></f:param>
</hx:commandExButton>but this somehow fails. How can I access this variable within the EL for the param tag??

if you want to access the variable in the same page at the same time?
you can't
if you want to access the variable in other page? wich is called from the form? then you just call the parameter request.getParameter("province")
the value must be the same that the selected index, otherwise use a hidden input for store the selectedIndex

Similar Messages

  • How to access a javascript variable from Java?

    Here is my code:
    function validateLoginForm() {
        var username = document.getElementById('un');
        setCookie('un', username, 3650);
        //etc.
    <%   
        HttpSession httpSession = request.getSession();
        httpSession.setMaxInactiveInterval(30 * 60); //30 minutes
        httpSession.setAttribute("un", username); //!prob here - cannot resolve 'username'
    %>
    }...but how do I access the javascript variable 'username' from the Java code?
    Thanks,
    James

    The only way to pass values between JavaScript and JSP is through cookies. It sucks, I know, but right now that is the only option.
    You already are creating a cookie in JavaScript. So go ahead and read it in Java:
    Cookie[] cookies = request.getCookies();
    for(int i = 0; i < cookies.length; i++) {
        Cookie c = cookies;
    if (c.getName().equals("un")) {
    // Do what you need here.

  • I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    Welcome to the 'wonderful' world of HTML5 e-learning.
    In my view, from the issues I am seeing everywhere, HTML5 output from rapid e-learning tools such as Captivate is not ready for the kind of mobile device e-learning you want to develop.
    Sorry to be pessimistic, but you may need to consider going back to the drawing board and coding it from the ground up.

  • HT1689 I can't access the iTunes store any more.  Does anyone have any ideas what I can do?

    I have never had any issues going to the iTunes store from my account.  Now, all of a sudden, it just says it's loading but never does.  Not sure what's going on.  Any help would be much appreciated.

    Welcome to the Apple Community.
    The following article(s) may help you.
    Can't connect to the iTunes Store

  • Itunes has doubled up the songs on my iPhone but only shows them singly within iTunes. Does anyone know how to fix this?

    My iPhone lists every song (songs that I have imported from cd's, but not purchased through iTunes) twice. iTunes only shows 1 instance of each song. If I delete a doubled up entry from the phone, it deletes the whole song. Has anyone else run into this problem?

    Hey!  You are a gem!  At the moment it seems to be working but I am leaving it connected to iTunes until I updaet to the next version and hopefully that will fix whatever it was that caused the problem.  Thank you a milion times over!  It is 11.14pm over here and all the call centres are closed!
    THANKYOU!

  • JSP Session in JavaScript variable problem

    Hi,
    I have a session variable msgSize that is being set by a Java file in the session.
    aRequest.getSession().setAttribute("msgSize", msgSize);It's value is variable depends on record count of recordset.
    In JSP page where I have to assign it's value to a javascript variable. I am doing this a s follows. I have done this in the JSP file.
    <script type="text/javascript" >
    <!--
    function getVal()
    m=${msgSize};
    -->
    </script>First Problem is I am unable to get this value inside a External JS file. It throws error but inside jsp it is working. How can i use this inside External JS?
    Second problem is once the above code executed value never refreshed to new value?
    Means first time it executed it get value 200 next time again i executed the code the real recordset is 105 but still displaying 200. But when I restart the server next time it takes value 105 by itself....
    How I tackle this problem.?
    Regards,

    problem is I am not refreshing the whole JSP page everytime, only refreshing the partial page using ajax call that's why not getting the session new value...
    any suggestions what to do to get new value?

  • I paid to download a tv show and now I don 't see how to access it.  does anyone know?

    I paid to download an episode of a tv show and now I don't see gow to access it so I can view.  Does anyone know?

    Try to sign out of iTunes and sign back in, that usually fixes authentication problems.

  • Outlook 2007 doesn't show icloud service running.  Does anyone know what the dll for this service is so it can be manually added to outlook?

    Outlook 2007 doesn't show the icloud service running in Windows 7 within outlook.  Does anyone know what the dll for this service is so it can be manually added to outlook?   I've installed the icloud control panel app and set it up to synch everything, but after initially downloading my icloud calendar, it won't process any calendar updates (new entries made on either iphone 4 on ios 5 or outlook). 
    So since the control panel installed, but the service doesn't show running in outlooks "trust center" add-ins list, anyone know the actual dll file it would point to so I can see if I can add it the hard way?

    I had the same issue and figured it out.  First you have to start Outook as administrator.  To do this, shift and right-click on outlook and click run as administrator.  Next you need to enable Hard-disabled add-ins:
    Hard-Disabled Add-Ins
    Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
    To re-enable an add-in
    In the application, click the File tab. 
    Click the ApplicationName Options button.
    In the categories pane, click Add-ins.
    In the details pane, verify that the add-in appears in the Disabled Application Add-ins list.  The Name column specifies the name of the assembly, and the Location column specifies the full path of the application manifest.
    In the Manage box, click Disabled Items, and then click Go.
    Select the add-in and click Enable.
    Click Close.
    Then you need to activate it. 
    To re-enable an add-in
    In the application, click the File tab.
    Click the ApplicationName Options button.
    In the categories pane, click Add-ins.
    In the details pane, verify that the add-in appears in the Inactive Application Add-ins list.  The Name column specifies the name of the assembly, and the Location column specifies the full path of the application manifest.
    In the Manage box, click COM Add-ins, and then click Go.
    In the COM Add-Ins dialog box, select the check box next to the disabled add-in.
    Click OK.

  • Does anyone else still have a problem using iVPN with OS X 10.8.3 and Airport Extreme?

    I am looking for help setting up iVPN. I am using my iMac, an airport extreme, and had recently purchased iVPN. I believe I input everything correct and port forward my Airport Extreme to 1732, but when the counter starts I cant access anything including email and internet. Does anyone know what the problem might be?

    I just verified that I have no issue with photobucket. I use exactly the same setup as yours except my Java security is enabled at the default level.
    Do you have the current version of the Java software installed: Java SE Runtime Environment 7 1.7.0_21. Just because you have the preference panel doesn't mean you have the runtime installed.

  • When I work in DPS, InDesign starts opening old documently by itself. Does anyone know how to make it STOP?

    My InDesign opens a bunch of old documents almost every time I start working with DPS panels. I was told it was a bug and to change the names of docs but I work with HUNDREDS of docs on a large server that others access so this is not practical. Does anyone have suggestions?

    Not that I know of but there may have been objects (picture boxes or text) that was copied from those documents.

  • Accessing instance variables within frames.

    I have 2 jsf within frames that is having one managed bean.
    i would like to access the instance variable defined in one jsf from another jsf. Since the managed bean is getting instantiated for the second jsf, the values in first jsf is getting reintialized.
    Is it possible to access like this? or do we need to have a separate backing bean and call the first from second.

    <script language="JavaScript">
    var scriptVar = "<%= jspVar %>";
    </script>

  • How to access javascript variable's value in a jsp tag?

    Is there any way to access the value of a javascript variable in jsp?

    Hi
    by the way your question is ambigous, i understand the question to some extent here i there is a sample code which may be help full to you. As this problem is faced by me when i was developing some dynamic pages in my company.
    <%@ page language="java" %>
    <html>
    <head>
    <script language="JavaScript">
    var i = 10;
    var k = 20;
    </script>
    </head>
    <%
         String Jspi = "";
         Jspi = ("<script>document.write(i);</script>");
         out.println(Jspi);
         Jspi = ("<script>document.write(k);</script>");
         out.println(Jspi);
    %>
    </body>
    </html>
    This will help u out.
    Cheers
    Rambee

  • Flash/Javascript access of USER Variables

    Hi all,
    I've searched online many many times and have made many attempts in Flash and in Captivate 4, but to no avail, and I'm wracking my brain over it. By now I've almost given up on Captivate, since what has wasted so much time could have been done in a day or so using Flash to make the entire thing. I would like to avoid that though, since this is a University project, not a personal project.
    I need to access USER created variables, both in Flash animations AND in Javascript (i.e. in the execute Javascript field under multiple actions). They need to be accessed this way since there's no default way to multiply variables or append strings of text to variables (things which as an experienced AS2 user I know should be very simple to do). Also, I want to be able to copy the contents of one (user) variable to another (system) variable later on (for LMS).
    So say I have a user defined Captivate variable called 'userPath', and on a certain slide I want to multiply it by 5 in Flash or in Javascript (just an example).
    How could I access it from Flash with AS2? (I've tried _root.userPath, _root.movie.userPath, no luck).
    How could I access it from the Javascript? (I am comfortable with programming, but don't really use Javascript, so I may be having a problem with the notation).
    Any help would be greatly appreciated, since I need to get this work done soon. Many thanks.

    Lboro SB,
    How familliar are you with AS3?  I would recommend altering the CaptivateMaintimeline.as file typically located at C:\Program Files\Adobe\Adobe Captivate 4\ActionScript 3.0.  You can write your custom functions in AS3 to do your multiplication or whatever and it will use this file to compile your Cp4 project.  Just make sure you're publishing your Cp4 project in AS3 in the project properties.  You could also add your function to the list of ExternalInterface.addCallback(... so that your function could be accessible from JavaScript.  Here's my custom function I've put in the CaptivateMaintimeline.as file:
    /JBL: For External Interface setting any type of value
            public function jim_cpSetValue(variable:String, val):void
            //myTrace("cpSetValue variable1 " + variable + " ; val  " + val);
            var arr:Array = variable.split(".");
            var ref = this;
            for(var i=0; i < arr.length -1; i++)
                ref = ref[arr[i]];
            ref[ arr[arr.length -1] ] = val; // This works fine for numbers, booleans and strings
    // JBL: adding callback to set variables in cp via JavaScript
    ExternalInterface.addCallback("jim_cpSetValue", jim_cpSetValue);
    If you want to do this in JavaScript, you need to get a reference to the Captivate main movie.  I do it like so:
        // Set objCaptivate in IE
        CaptivateObj = document.Captivate;
    Then you can call your custom function
        //JBL:  Custom Function to set Captivate Vars via Javascript
        function setCaptivateVariable(myVariable, myValue)
            CaptivateObj.jim_cpSetValue(myVariable, myValue);
        //JBL:  Shortcut function for Getting values from Captivate SWF
        function getCaptivateUserVariable(n)
            return CaptivateObj.cpGetValue(n);
    I also HIGHLY recommend a lightweight .js file by Philip Hutchison that can do much more located here.
    Good Luck,
    Jim Leichliter

  • Accessing java objects from within javascript

    Hello,
    Anyone with an idea of a useful toolkit for accessing java objects from within javascript will be much appreciated.
    Thanks in advance,
    Antana.

    What do you mean by accessing Java objects? Do you mean interacting with an applet via JavaScript? Something else?

  • Access variables within a timer

    How can I access variables within a timer?
    I mean variables, that I can use in another class that extends applet i.e.?

    The Code can be compiled now with the Java Compiler.
    But the image won't move on the screen.
    import java.applet.*;
    import java.awt.*;
    import java.util.*;
    public class ChangingApplet extends Applet {
      private Image EricsBild;
      private int x,y;
      private TimerTask update;
      public void start() {
      EricsBild = getImage(getCodeBase(), "heuschrecke.gif");
      x=5;y=5;
        update = new TimerTask() {
          public void run() {
            if (x<300) x++;
            if (y<200) y++;
            if (x>3) x--;
            if (y>2) y--;
            repaint();
        Timer t = new Timer(false);
        t.schedule(update, 1000, 1000);
      public void stop() {
        update.cancel();
      public void paint(Graphics g) {
        g.drawImage(EricsBild,x,y,this);
    }

Maybe you are looking for