Usage of javascript in a jsp which belongs to portal

I have written the following code in my .jsp which is part of a page flow.
with(document[getNetuiTagName("key")])
alert(getNetuiTagName("currentstatus").value);
This is not working. But if I remove the with statement and give the fullpath
to fetch the value it works well. Please help me on this.

I think you can only refer to something that is a form, image, anchor,
or applet using the document["someString"] syntax. Is that the problem?
Perhaps you could try something like this:
with(document.getElementById(getNetuiTagName(tagId)))
mangala sumanth wrote:
I have written the following code in my .jsp which is part of a page flow.
with(document[getNetuiTagName("key")])
alert(getNetuiTagName("currentstatus").value);
This is not working. But if I remove the with statement and give the fullpath
to fetch the value it works well. Please help me on this.

Similar Messages

  • Passing javascript values to jsp without refreshing the page

    Hi,
    How do u pass a value of a javascript variable to the jsp without refreshing the page ?
    For example, a file called test.jsp in which a javascript variable x contains value 254. I need to pass the value of x to a method declared in test.jsp(same page).

    Hi Mona,
    when i say refresh i do mean a blink of the browser.
    This is a small example i wrote to show you how you can pass javascript varables to JSP variables. If you don't want the refresh to be seen by the user just include this code in a hidden frame on a page and instead of refreshing the entire page, refresh the hidden frame.
    i have to say, i didn't test the code so i don't guarantee it's flawless.
    if you need an more detailed example just tell me, i'll create one, but it won't be for today :)
    <html>
    <head>
         <title>Log in to the system</title>
    </head>
    <body>
    <script>
    //we retrieve the parameter 'user' from the URL
    <%
      String username = request.getParameter("user");
    %>
    var user = "<%= username%>";
    //check if there is a username in the URL
    if(user=="null")
      //there is no username so we log the person in as a guest
      user="guest";
      //we refresh the page and set the user parameter to 'guest'
      //the parameter now contains the javascript variable 'user'.
      //The parameter can be read by the JSP (see the top op this script).
      //This way we gave the javascript variabele to the JSP variable
      location="login.jsp?user="+user;
    else if(user=="guest")
    {  alert("Welcome "+user+", I hope you like this site"); }
    else
    {  alert("Welcome "+user+", I'm glad to see you again"); }
    </script>
    </body>
    </html>

  • Passing JavaScript value to Jsp

    Hi,
    Any idea how to pass a value from javascript to jsp page when the page gets load on browser.
    I use below code but an event is require to pass the value. Is there any code that pass automatically the value from javascript to jsp.
    <html>
    <head>
    <title>Passing Javascript value to Jsp</title>
    <script type="text/javascript" language="javascript">
    var scriptVar = "Noy"
    var WinNetwork = new ActiveXObject("WScript.Network")
    document.write (WinNetwork.username)
    document.index.hiddenTextBox.value = WinNetwork.username
    </script>
    </head>
    <%
    String jspVar = null;
    if(request.getParameter("submit") != null){
         jspVar = request.getParameter("hiddenTextBox");
         out.println("Jsp Var : " + jspVar);
    %>
    <body>
    <form name="index" onSubmit="index.jsp" method="post">
    <input type="hidden" name="hiddenTextBox"><br>
    <input type="submit" name="submit" value="Submit">
    </form>
    </body>
    </html>
    Thanks,
    ~ukbasak

    JSP/Java runs at the server side, produces a HTML page, sends it to the client side and then stops running.
    HTML, containing under each CSS and JS, arrives at the client side and runs at the client side only.
    To invoke JSP/Java using HTML you need to fire a request to the server side. That can be either a plain vanilla <a> link, a <form> to be submitted or an asynchronous Ajaxical request.
    That said, the use of ActiveX in web applications is discouraged. It's a Microsoft IE proprietaty. With other words, it isn't and won't be supported by all alternative browsers which the other half of the world is using.

  • How to pass javascript variable to jsp function

    i want to check which table header (that is <th> in html )is clicked and based on that a jsp funtion do a query in database and should show records in sorted way according to which column head is clicked.
    Table is created in html.
    My function is
    Vector varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    <table border="1">
              <th ><label onClick="<%SelectedColumn="workcase_id";%>">Workcase Id</label></th>
              <th><label onClick="<%SelectedColumn="status_id";%>">Status</label></th>
    <tr><td>etc</td></tr>
    </table>

    im using bean for business login, following mvc model,and i think mvc is one of good design practice to use.
    <jsp:useBean id="workcaseid" scope="session"class="beanFiles.SearchWorkcaseId" />
    varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    just tell me whether it is possible to pass javascript variable to jsp variable or not.i can do it by using hidden input type,using form and submit button.

  • Including external Javascript file in JSP- not working on Mozilla Firefox

    I have a JSP page which includes javascript file as below:
    <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script>
    myJsFile.js has a method testFireFox()
    There is a link on JSP which that calls this method.
    <a href="#" onClick="testFireFox()">Some Text...</a>
    As soon as i click on the link, nothing happens and this error appears on console:
    Refrence Error: testFirefox() is not definedI tried giving the path for JS file in various ways but it did not help.
    Note: This works absolutely fine in Internet Explorer.
    I have not added Javascript to document.ready or onLoad event. It is simply been referred in <Head>
    tag any pointers pls..

    This forum is intended for user support, not for web development issues.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The contributors over there are more knowledgeable about web page development issues with Firefox.
    http://forums.mozillazine.org/viewforum.php?f=25
    You'll need to register and login to be able to post in that forum.

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • How can I assign javascript variables to jsp or java variables.?

    How can I assign javascript variables to jsp or java variables.?

    See I have generated some variables in the javascript which is on the jsp page. I want to assgin these variables to the jsp vaiables. Or how can I access javascript variables from jsp on the same jsp page.

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • How can i assign a Javascript variable to JSP variable

    Hi guys
    how i can assign a javascript variable to jsp expression.,
    e.g.,
    <input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
    function submitform1(String s)
          var s1 = s
    document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
           document.form1.submit();
          return false;
    /*  i want to pass the values thru session whether it is possible */
    pls give sample code
    Reply
    Marimuthu

    You don't have the session.
    All you have is HTTP.
    The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
    Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

  • 500 error while trying to access a jsp which makes use of tiles tags

    Hi all,
    when im trying to access a jsp which makes use of tiles tags, im getting the following error.
    status 500:
    org.apache.jasper.JasperException: The absolute uri: http://struts.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
    what might be the problem?
    Thanks in advance.

    Hi all,
    sorry...got the reason for the above error..missed to include the tld file in WEB-INF.

  • HT201210 hi i have to reset an ipad from work which belonged to another employee and i dont have his passcode.  It says on the ipad that is disabled and connect to itunes but when i connect to itunes it says an error message saying it cant connect no pass

    hi, i have to reset an ipad from work which belonged to another employee.  It says on the screen that it is disabled and connect to itunes but when i try to connect it says error i need the passcode, can anyone help?

    You have to use recovery mode which will totally erase the iPad. Read here.
    iPad: Unable to update or restore - Support - Apple

  • Why is a 'globe' contact available in Global Address List (which belongs to AD), but I cannot find it on AD server?

    I have a topic at link:
    http://social.msdn.microsoft.com/Forums/en-US/7b74fd63-1d0d-449e-9f31-83b707683053/finding-microsoft-document-about-globe-contact-in-outlook-address-book?forum=outlookdev&prof=required
    Please see the post first.
    I dot not make sense about why a 'globe' contact is available in Global Address List (which belongs to AD), but I cannot find it on AD server? I think the cause relates to Exchange server.
    Could you give me an explaination!
    Thanks advance.

    And here the Documentation:
    http://technet.microsoft.com/en-us/library/bb201680.aspx
    Mail contacts
    Mail contacts typically contain information about people or organizations that exist outside your Exchange organization. Mail contacts can appear in your organization’s shared address book (also called the global address list or GAL) and other address lists,
    and can be added as members to distribution groups. Each contact has an external email address, and all email messages that are sent to a contact are automatically forwarded to that address. Contacts are ideal for representing people external to your Exchange
    organization (in the shared address book) who don't need access to any internal resources. The following are mail contact types:
    Mail contacts   These are mail-enabled Active Directory contacts that contain information about people or organizations that exist outside your Exchange organization.
    Mail forest contacts   These represent recipient objects from another forest. These contacts are typically created by directory synchronization. Mail forest contacts are read-only recipient objects that can be updated or
    removed only by means of synchronization. You can't use Exchange management interfaces to modify or remove a mail forest contact.
    Georg

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • I want to assign the value of a Javascript variable to JSP Variable

    I want to assign the value of a Javascript variable to JSP Variable .. for example :
    <%
    Bla Bla Bla
    %>
    <script>
    var JavaScriptVariable="hello"
    </script>
    <%
    String JSPVariable=// The Value of JavaScriptVariable ;
    %>
    How can i do that ??
    Thanks

    >I want to assign the value of a Javascript variable to JSP Variable
    cannot be done.Friend try to understand concepts properly Javascript is always excuted by the browser @clientside where as JSPCode is executed Websever(ServletContainer) @serverside.Through you are combining JSP Code blocks(Tags,Expressions,scriptlets...) & javascript under a single page webserver can only identify what is their under JSP Code blocks.
    Hope this could be an appropriate answer for your question.
    However,you can as well submit a request by encoding your URL with request parameters and the submit to the page and then collect it using request.getParameter(name).
    But under a single context state it is not possible
    REGARDS,
    RaHuL

  • Dimension which belongs to only one of the several fact tables

    Hi,
    I'm newbie in BI. I have good knowledge of DW and Administration (OCP).
    Firstly could you give me, please some link expalining aspects of creating "Business Model And Mapping" better than SE Tutoarial.
    Now how my problems looks like :
    I have several fact tables and dimensions.
    But not all dimensions are shared among all facts.
    So when i try to put in Answers measurements from all facts it's ok - results are retrieved.
    But when i try to add to report some Dimensions attributes which belongs to only one of the facts all facts measurements are gone except measurements for fact table to which dimension attribute is linked to.
    I think i know what is the reason but i don't know how to simply solve it :
    Below is session trace excerpt only with facts measurements :
    RqList
    Liczba Transakcji:[DAggr(Fakty - Transakcje (ZSFK).Liczba Transakcji by [ Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c7 GB,
    Kwota Opłaty Netto:[DAggr(Fakty - Opłaty za Terminale (CBD).Kwota Opłaty Netto by [ Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c11 GB,
    Below iis session trace excerpt with facts measurements and added dimension attribute:
    RqList
    Liczba Transakcji:[DAggr(Fakty - Transakcje (ZSFK).Liczba Transakcji by [ Słownik - Rodzaje Walut.KOD_WALUTY, Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c7 GB,
    Kwota Opłaty Netto:[DAggr(Fakty - Opłaty za Terminale (CBD).Kwota Opłaty Netto by [ Słownik - Rodzaje Walut.KOD_WALUTY, Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c12 GB,
    Second plan is the plan when report retrieves only results for one fact table and null's for others
    Problem is with attribute : "Słownik - Rodzaje Walut.KOD_WALUTY" which is from dimension which belongs only to one fact table.
    So other fact table are not linked to this dimension and therefore this plan cannot retrieve results for them.
    It is obvious that some of the facts cannot share some dimensions with others but i would like to join them on other common attribute
    and my question is how ?
    Thanks's in advance Arkadiusz Masny
    Edited by: Arkadiusz Masny on Dec 10, 2009 6:49 AM

    It's normal behavior. How would fact measure know the value for accurate "non-fact" dimension
    Workaround:
    First solution is:
    Add into logical source of each fact (in logical layer) tables to which belongs dimension attribute and join dimenstion to that fact.
    Second you may:
    Create fact table which join all needed dimensions with some useless fact ( i.e. count). Next you have to set option "Implicit Fact Column" in presentation catalog to use this fact table.
    I can explain it to you in Polish by mail or phone
    You bring me a next topic for my blog (in Polish) http://obiee.pl so I'll write sth about such behavior :)
    Regards

Maybe you are looking for