Problem with Javascript in JSP

Hi Guys,
I have this problem with my JSP page. I am using a javascript function
which calls a function within a bean. The problem that I have is that I get an error when trying to call the following function :
function refDataTypes_onchange()
Vector empNames = DBQuery.getResult();
I get a runtime error at the line Vector empNames = DBQuery.getResult;
Any ideas would be much appreciated.
Below is the whole code:
Thanks in advance
FRank
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<%@ page import="java.util.*, java.lang.*" %>
<%-- Declare the java bean for the countries to be queried --%>
<jsp:useBean id="DBQuery" class="DBQuery" scope="page" />
<%-- Bean property searchCondition is not set to query countries --%>
<jsp:setProperty name="DBQuery" property="searchCondition" />
<%
Vector empNames = DBQuery.getResult();
%>
<HTML>
<BODY BGCOLOR="GREY">
<SCRIPT LANGUAGE="JavaScript1.1">
function refDataTypes_onchange()
Vector empNames = DBQuery.getResult();
</SCRIPT>
<FORM NAME = form1>
Please enter in the following details
<p>
Reference Type :::====
<select name="refDataTypes" onchange="refDataTypes_onchange()">
<option value ="1"></option>
<% for(Enumeration enum = empNames.elements();enum.hasMoreElements();)
String nextEmpName = (String)enum.nextElement();
%>
<option value =<%=nextEmpName%>><%=nextEmpName%></option>
<%
%>
</select>
<BR>
<BR>
Emp No
<INPUT TYPE="text" NAME=txtAge >
<BR>
<BR>
<INPUT TYPE="button" VALUE="Check Details" NAME=butCheckForm >
</FORM>
</BODY>
</HTML>

Thanks dimadoo
I need my JSP to do the following :
When a user selects a option from a select list. There is a textfield which I want to populate based on the option that thas been selected from the list.
I tried the following :
<% Vector empNames = DBQuery.getResult(); %>
and it does not even go into the bean.
Will this work if I refresh the page?

Similar Messages

  • Problem with Javascript and opening a new page

    Hi,
    I'm developping a website with Java Server Faces.
    I've a problem with JavaScript.
    I have a table, and each row of that table, has a button, to display more information about that specific row. I want to display this information in a new window. For this I want to use JavaScript.
    The new window, of course, needs some information of the other window, to show the right data.
    The first time I click the 'more-information-button', it works perfectly, but from than on, he keeps showing the same information...
    Here is my jsp-page of the first page (the one with the table):
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
             <f:loadBundle basename="languages.MessageBundle" var="bundle"/>
            <html>
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>- UCV-Period -</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                        <h:dataTable binding="#{UcvPeriod.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd" rows="5"
                            style="left: 24px; top: 168px; position: absolute" value="#{UcvPeriod.dataTable1Model}" var="currentRow">
                            <h:column binding="#{UcvPeriod.column1}" id="column1">
                                <h:outputText binding="#{UcvPeriod.outputUcvPeriod}" id="outputUcvPeriod" value="#{currentRow['UCVPERIOD']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{UcvPeriod.outputText2}" id="outputText2" value="#{bundle.ucvPeriod_columnHeader_ucvPeriod}"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{UcvPeriod.column11}" id="column11">
                                <h:commandButton action="#{UcvPeriod.btnDetails_action}" binding="#{UcvPeriod.btnDetails}" id="btnDetails" value="+" onclick="window.open('Details.jsp')"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{UcvPeriod.outputText21}" id="outputText21" value=""/>
                                </f:facet>
                            </h:column>
                        </h:dataTable>
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>Here is my action, when someone clicks on the 'more-information-button':
    public String bthnDetails_action() {
       Object s = outputUcvPeriod.getValue();
       BigDecimal ucvPeriod = (BigDecimal)outputUcvPeriod.getValue();
       this.getSessionBean().setUcvPeriod(new Integer(ucvPeriod.intValue());
       return "detail_ucvperiod";
    }Here is my constructor of the Detailspage.
        public Details() {
             this.txtUcvPeriod.setValue(this.getSessionBean().getUcvPeriod());
        }Here is the navigation part for this part of my faces-config.xml .
    <navigation-rule>
       <from-view-id>/UcvPeriod.jsp</from-view-id>
       <navigation-case>
           <from-outcome>detail_ucvperiod</from-outcome>
           <to-view-id>/UcvPeriod.jsp</to-view-id>
       </navigation-case>
    </navigation-rule>Thx a lot....
    Anneke

    See the tutorial "Sharing Data Between Two Pages" at http://devservices.sun.com/premium/jscreator/standard/learning/tutorials/data_sharing_twopages.html and the FAQ "How can I pass data between pages without creating SessionBean variables in Creator?" at http://devservices.sun.com/premium/jscreator/standard/reference/faqs/technical/javasource/passing_data.html. Since you can open a new window when your button is clicked, the tutorial and FAQ will explain ways to pass your data to the new window.

  • Problem with JavaScript in URL iView

    Hi,
    I am facing a problem with javascript when i am trying to access my application through URL iView. In the javascript window.top is used to access the frames in the window. But the EP is not recognizing it as valid. what exctly the problem and please suggest me a solution.
    Ashok.

    Hi,,
    thanks for the quick reply. But what i asked was different. I will put it in different way. I have deployed a application in Web Application Server and trying to access it through URL iView. My application is pure J2EE application with html,jsp and JS files. In javascript we used window.top property of the java script which is working fine MS IE. The problem is window.top is a IE specific property which is not having any equallent open standerd so EP is throwing a java script error. As I know the only possible solution for this problem is inherating IE rendaring capabilities to iView(i.e iFrame). is there any way to do that?
    Ashok.

  • JSF problems with Javascript

    Hi everyone!!
    The situation is this: I have a datable with one of its columns make an h:commanLink, which has two f:params, its actionListener is a function of a ManagedBean. This is JSF, not MyFaces. In IE, When the link is pressed, it shows a javascript error: " 'elements.idVar' is null or it's not an object ", however in Firefox, it works perfectly. I have been looking for the problem and it have to do with this:
    </form><a href="# onclick="clearFormHiddenParams_formResultado('formResultado');document.forms['formResultado'['formResultado:_idcl'].value='formResultado:dtTablaResultados:0:_id10';document.forms['formResultado']['idVar'].value='37';document.forms['formResultado']['idMun'].value='168'; document.forms['formResultado'].submit(); return false;"><span id="formResultado:dtTablaResultados:0:itColumna3" title="AREA COSECHADA EN CULTIVOS PERMANENTES">1,230</span></a></td>
    </tr>
    <tr class="standardTable_Row2">
    <td><span id="formResultado:dtTablaResultados:1:itColumna1" style="text-align:center;" title="C&oacute;digo Municipio">718</span></td>
    <td><a href="javascript:void(0)" onclick="javascript:window.opener.opener.showLink('SASAIMA')"><span id="formResultado:dtTablaResultados:1:itColumna2_l" title="Municipio">SASAIMA</span></a></td>
    <td><form id="formResultado:dtTablaResultados:1:_id9" method="post" action="/ConsultaEstadisticasGeo/resultadoConsulta.jsf" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="com.sun.faces.VIEW" id="com.sun.faces.VIEW" value="_id39:_id41" /><input type="hidden" name="formResultado:dtTablaResultados:1:_id9" value="formResultado:dtTablaResultados:1:_id9" /><input type="hidden" name="idVar" /><input type="hidden" name="idMun" /><input type="hidden" name="formResultado:_idcl" />
    <script type="text/javascript">
    <!--
    function clearFormHiddenParams_formResultado_dtTablaResultados_1__id9(curFormName) {
    var curForm = document.forms[curFormName];
    curForm.elements['idVar'].value = null;
    curForm.elements['idMun'].value = null;
    curForm.elements['formResultado:_idcl'].value = null;
    //-->
    </script>
    the way JSF manage the params. The error, acdording to the message shonw by IE is in this line: curForm.elements['idVar'].value = null;
    The code of the JSP is this:
    <h:commandLink     actionListener="#{consultaEstadisticasMB.detalleEstadistica}">
         <f:param name="idVar" value="#{consultaEstadisticasMB.idColumna3}" id="idVar" />
         <f:param name="idMun" value="#{registro[0]}" id="idMun" />
         <h:outputText title="#{consultaEstadisticasMB.columna3}" id="itColumna3" value="#{registro[2]}" />
    </h:commandLink>
    Waht can i do? (Not using MyFaces, because I can�t do that)
    Thanks for your answers!!

    I have run into this same problem with javascript and the colon. I am not sure if the colon is a valid character for a javascript identifier (one would think the RI developers would have checked it out though!?!).
    Anyway, my workaround is to search through the Javascript DOM for the widget you want to obtain a reference to, using part of its id. After all, you know its id, you just can't use it as a javascript reference. In your Javascript code, do something like:
        var inputWidgets = document.getElementsByTagName("input");
        var targetInput;
        for(var i = 0; i < inputWidgets.length; i++)
           var inputId = inputWidgets.id;
    if(inputId.indexOf("yourInputId") != -1)
    targetInput = inputWidgets[i];
    break;
    It's a lot of effort to just get a reference to a form widget....but it works (I pasted in the code and changed it a bit, so it might not work as is, but at least it demonstrates the idea).

  • Problem with JavaBeans in JSP.IT'S URGENT!!!

    Hi, i have problems with JavaBeans in JSP.
    In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
    <jsp:useBean id="paramBean" class="licentza.ParamBean" />
    <jsp:setProperty name="paramBean"
    property="nume"
              value='<%= request.getParameter("numeUser") %>' />
    where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
    And i get this error:
    Generated servlet error:
    D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
    ParamBean paramBean = null;
    What is the problem?Thank you.

    Hi,
    Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
    Rajesh

  • Webcontrol problems with javascript

    Hello,
    the page I want to navigate making me problems in my webcontrol. The same page works fine if I go there manually with the Internet Explorer. I force webcontrol to use another IE version than default. I changed regedit >
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
    and a new key for my application with value 2af8(11000)
    If I do not force this version the used version in the webcontrol seems to be to old.
    I think that my application does not use the settings of my IE because if I use IE manually it works.
    I used Google and I can not find a property to force the webcontrol to activate javascript - it seems that I have to change this by the "global" settings.
    Edit: I do not exactly know if its javascript. The error is a script error.
    It does not help to suppress this errors - the page is not working correctly

    Hello,
    in the meantime I tried GeckoFX to solve the issue, but I get another problem later so I come back to the native webcontrol. To get help I will translate the error message because I can not attach a screenshot
    "Scripterror
    URL: http://www.transerv2000.de/DesktopModules/SNITNET_Metrix/js/rma_main.js
    Do you want to continue? Yes / No"
    Because I see the .js I think that this is an issue because of javascript.
    If I navigate to this site and do some work I have no problems. This is why I think that the used IE in my webcontrol is having other settings?!
    Please help and thanks alot.
    Edit: If I supress javascript errors, I got not Messagebox but the content dont work - so I really think that it is a problem with javascript. As I said, if I use the IE as application the page works fine.

  • Problem with Sessions in JSP

    Hi,
    I am working on a JSP based website, where I am facing problem with sessions. The user is asked to login by providing her id and password. If found correct, a bean is created and populated with all her details and placed in session scope. I plan to use the information stored in the bean on other related pages until she logs out.
    <jsp:useBean id="validUser" scope="session" class="UserBean" >
    <c:set target="${validUser}" property="userId" value="${fn:trim(dbValues.UserId)}" />
    <c:set target="${validUser}" property="userName" value="${fn:trim(dbValues.UserName)}" />
    </jsp:useBean>
    <c:redirect url="userHome.jsp" /> The user is presented her homepage - 'userHome.jsp', where she can find various links, like 'Update Profile', 'Pay Registration Fees', 'Book Room' etc. The information stored in the bean is available on 'userHome.jsp'page.
    <A HREF='userHome.jsp'>Home</A>
    <A HREF='editPersonal.jsp'>Update Profile</A>
    <A HREF='registrationFee.jsp'>Pay Registration Fees</A>
    <A HREF='bookRoom.jsp'>Book Room</A>
    <A HREF='logout.jsp'>Logout</A> The problems are:
    1. Whenever user clicks on any of the above mentioned links and moves to any page, the bean comes out as null.
    <%-- Verify that the user is logged in --%>
    <c:if test="${validUser == null}">
    <jsp:forward page="loginForm.jsp">
    <jsp:param name="origURL" value="${pageContext.request.requestURL}" />
    <jsp:param name="errorMsg" value="You must be logged in to access this site." />
    </jsp:forward>
    </c:if> 2. The URL shows an additional jsessionid, which my client doesn't want to see.
    3. On every click on any link, the value of this jsessionid changes.
    What I presume, when I am clicking on different links, my session changes, and so I am seeing a different jsessionid. And since session is changing, therefore the bean is not available in a different session.
    All this works fine with localhost, problem comes into picture, when I upload my pages to the server.
    Puzzled, can anyone help, where am I going wrong? Let me add here, I am new to JSP and hence don't have much resources with me.

    There are several ways sessions can be exchanged between the browser and the server in a j2ee web application.
    1. The default is through cookies. However when the client does not accept cookies, the server appends the session id to the url.
    2. Some servers also facilitate session information exchange using session id in the url even if the client does accept cookies. This is usually ahieved through a setting in some server configuration file.
    You will have to find out why the server in your application is appending the session id to the url.
    Whatever be the case, the server should be able to look up the session from the incoming request (be it from the session id in the url or a session cookie).
    When session information is exchanged through the JSESSIONID in the url, you should ensure that each and every url that goes to the server has this input parameter. To do that all links and form post urls in your servlet/jsp should be treated with a call to encodeURL().
    For example, in a jsp
       <a href = "<%=response.encodeURL("/nextJsp.jsp")%>">Click here </a>
    or
       <form action = "<%=response.encodeURL("/nextJsp.jsp")%>">
       </form>etc.
    ram.

  • Problem with JavaScript getPageNumWords

    Using AR7.0.9. I have a problem with the JavaScript method doc.getPageNumWords and the associated machinery for keeping
    track of the words on a page. And I'm wondering if it's a bug,
    or something which is not properly defined by the PDF spec.
    The situation is illustrated by the test file:
    http://www.amrita-cfd.org/4adobe/word-count/test1.pdf
    It would appear that the word machinery is aware of
    the text in the /Xform's used by /Widget annotations.
    But the text is locked in the first time the
    machinery is activated on a page i.e. visible /Widget's
    are included and invisible ones are ignored.
    But since /Widget's can be turned on and off
    it's then possible for the word-cache to become out of sync
    with respect to the visible text on the page.
    Note that a widget which is invisible when
    the document is opened, but visible when
    doc.getPageNumWords is first called is included
    in the word list i.e. the word-cache is computed
    once in a just-in-time fashion.
    Is the above a known problem, or an inconsistency that has
    not been considered before? One solution would be
    to add an optional parameter to getPageNumWords
    that would force the word-cache to be recomputed,
    when needed. Thus removing the need to keep automatic
    track of which widgets to include and exclude.
    James Quirk

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Problem with JavaScript snipet that DreamWeaver is writing

    I am having a problem with code that DreamWeaver (CS3) is
    writing. I'm fairly certain the problem is in a small piece of
    JavaScript that DreamWeaver is composing.
    This is a fairly complex problem, so bear with me.
    First - What I am trying to make happen: When on a page on my
    site (the-oilman.com) I want a link that opens a new window in the
    on-line store at a different site (AMSOIL.com). I need to leave
    both the page on my site open and have this 'store' page open.
    First of all this is working fine, using the 'Open Window'
    'behavior' in DreamWeaver. If someone wants to change windows (or
    tabs) and go back to my page, leaving the 'store' window open also
    - the problem is set up to happen. If from back at my site, you
    click on the same or a different link that goes back to the 'store'
    either on the same page or a different page at AMSOIL.com - the
    'store' window goes to the correct page, but the 'store' window
    does NOT come on top. When they click on a link to go back to the
    'store' I need the 'store' window to come to the top. If they have
    previously put something in the cart, and come back and add
    something else to the cart in the 'store' by coming in from
    different links on my site the 'store' is working correctly because
    I leave it open the whole time.
    snipets of code that DreamWeaver is writing for my site
    (the-oilman.com):
    from the head:
    <script>
    <!--
    CSAct[/*CMP*/ '129AABC1'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,true,true,tr ue,true,true);
    CSAct[/*CMP*/ '129AAC63'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,true,true,tr ue,true,true);
    CSAct[/*CMP*/ '10D39F40'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso','store',0,0,true,true,tru e,true,true,true,true);
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    //-->
    </script>
    code from 2 different links that is using this script:
    <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso"
    target="store" onClick="MM_openBrWindow('#','store','')"
    csclick="10D39F40">Buy Now</a>
    <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store"
    title="AMSOIL Store at AMSOIL.com" target="store"
    onClick="MM_openBrWindow('http:www.amsoil.com/redirect.cgi?zo=52257&amp;page=store','stor e','')">On
    Line Store</a>
    I believe what I need is a longer javascript. Instead of just
    "window.open" I need an "if" but my javascript knowledge is very,
    very limited.
    I need it to first check that if the window named 'store' is
    open then 'focus' it, or if it is not open to open the window named
    'store'.
    Will this fix my problem? If so, please help me write the
    lines of code to do it.
    If this isn't the solution, what is the problem and the
    solution?
    A separate question but related: if you look in the two
    different links codes, in the function call one of them uses a
    'null' page reference and the other repeats the full link reference
    from the href= . Both seem to work, but which is the correct or the
    preferred syntax. My guess is there are some browsers that this
    will give a problem, but which way is preferred.
    Don Dawson
    mailto:[email protected]

    Create a new page. Try to apply this same behavior to a link
    on that new
    page. Look at the code. Can you reproduce the problem there?
    The code you
    show below has oodles of GL stuff in it. Do you need that GL
    markup?
    What operational sequence did you go through to get this
    behavior call?
    onClick="MM_openBrWindow('#','store','')"
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "pad graphics" <[email protected]> wrote in
    message
    news:[email protected]...
    >I am having a problem with code that DreamWeaver (CS3) is
    writing. I'm
    >fairly
    > certain the problem is in a small piece of JavaScript
    that DreamWeaver is
    > composing.
    >
    > This is a fairly complex problem, so bear with me.
    >
    > First - What I am trying to make happen: When on a page
    on my site
    > (the-oilman.com) I want a link that opens a new window
    in the on-line
    > store at
    > a different site (AMSOIL.com). I need to leave both the
    page on my site
    > open
    > and have this 'store' page open. First of all this is
    working fine, using
    > the
    > 'Open Window' 'behavior' in DreamWeaver. If someone
    wants to change
    > windows (or
    > tabs) and go back to my page, leaving the 'store' window
    open also - the
    > problem is set up to happen. If from back at my site,
    you click on the
    > same or
    > a different link that goes back to the 'store' either on
    the same page or
    > a
    > different page at AMSOIL.com - the 'store' window goes
    to the correct
    > page, but
    > the 'store' window does NOT come on top. When they click
    on a link to go
    > back
    > to the 'store' I need the 'store' window to come to the
    top. If they have
    > previously put something in the cart, and come back and
    add something else
    > to
    > the cart in the 'store' by coming in from different
    links on my site the
    > 'store' is working correctly because I leave it open the
    whole time.
    >
    > snipets of code that DreamWeaver is writing for my site
    (the-oilman.com):
    > from the head:
    > <script>
    > <!--
    > CSAct[/*CMP*/ '129AABC1'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,t
    > rue,true,true,true,true);
    > CSAct[/*CMP*/ '129AAC63'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,t
    > rue,true,true,true,true);
    > CSAct[/*CMP*/ '10D39F40'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso','store',0,0,tr
    > ue,true,true,true,true,true,true);
    > /
    > function MM_openBrWindow(theURL,winName,features) {
    //v2.0
    > window.open(theURL,winName,features);
    > }
    > //-->
    > </script>
    >
    > code from 2 different links that is using this script:
    > <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso"
    > target="store" onClick="MM_openBrWindow('#','store','')"
    > csclick="10D39F40">Buy
    > Now</a>
    > <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store"
    > title="AMSOIL
    > Store at AMSOIL.com" target="store"
    >
    onClick="MM_openBrWindow('http:www.amsoil.com/redirect.cgi?zo=52257&amp;page=sto
    > re','store','')">On Line Store</a>
    >
    > I believe what I need is a longer javascript. Instead of
    just
    > "window.open" I
    > need an "if" but my javascript knowledge is very, very
    limited.
    > I need it to first check that if the window named
    'store' is open then
    > 'focus'
    > it, or if it is not open to open the window named
    'store'.
    > Will this fix my problem? If so, please help me write
    the lines of code to
    > do
    > it.
    > If this isn't the solution, what is the problem and the
    solution?
    >
    > A separate question but related: if you look in the two
    different links
    > codes,
    > in the function call one of them uses a 'null' page
    reference and the
    > other
    > repeats the full link reference from the href= . Both
    seem to work, but
    > which
    > is the correct or the preferred syntax. My guess is
    there are some
    > browsers
    > that this will give a problem, but which way is
    preferred.
    >
    > Don Dawson
    > mailto:[email protected]
    >

  • Problem with javascript/PHP/ oracle 10g smart quotes

    I have a problem with my php form that passes the text field to a javascript object. When I copy text from MS Word that includes smart quotes, the form inputs that into the database as ? (upside down) marks. The charset of the DB is WE8MSWIN1252. How do I store these smart quotes as regular quotes? And also if I can do any conversions on the front end (js or php). I tried doing some conversion but to no avail. Any help would be appreciated thank you. “double”

    Decide if you want your HTML pages in Windows code page 1252 or Unicode UTF-8. Then, make sure the pages are properly tagged as either "text/html;charset=windows-1252" or "text/html;charset=utf-8". Use HTTP header Content-type or the corresponding <META HTTP-EQUIV=...> tag. Then, set NLS_LANG environment variable for your PHP engine to either AMERICAN_AMERICA.WE8MSWIN1252 or to AMERICAN_AMERICA.AL32UTF8, depending on which encoding you selected for your HTML.
    -- Sergiusz

  • Problem with JavaScript code in Page Attributes, modal popup...

    Hello all!
    I'm encountering a problem with a modal popup I wrote in JavaScript.
    h3.
    The situation*
    A user sees an interactive report with rows that are clickable, so these rows are links. Upon clicking the name of something in a row, some items get a certain value and a modal popup shows on the screen. In this modal popup, there are details regarding that particular row the user has clicked, but the problem_ here is...
    The modal popup closes itself only seconds after it has been opened.
    This must be because I've probably made a mistake somewhere in my code, but I just can't figure out where... It also appears that when I click on a row link, the popup shows, but the progress bar of my toolbar seems to show a loading bar (as if I refreshed the page).
    h3.
    My code*
    This code is located in the _"Function and Global Variable Declaration"_ part, under the _"JavaScript"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    function showhide(x){
    $x('REGION1').style.display = ( x == 'REGION1') ? 'block' : 'none';
    $x('REGION2').style.display = ( x == 'REGION2') ? 'block' : 'none';
    $x('REGION3').style.display = ( x == 'REGION3') ? 'block' : 'none';
    $( function(){
      $('#ModalForm').dialog(
         modal: true,
         autoOpen: false,
         width: 500,
         height: 350,
         buttons:{ Close: function(){closeForm();}        
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        $('#ModalForm').dialog('close');
        $(document).ready(function() {
            $('a.temppop').click(function() {
                openForm();
        });This code is located in the _"Header Text"_ part, under the _"Header"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>This code is located in the _"Column Link"_ part, you get there by going to the _"Report Attributes"_ of the region called _"Template overview"_ on page 24. This region is an interactive report.
    Link Text: #FOODTEMPLATENAME#
    Link Attributes: class="temppop"
    Target: Page in this Application
    Page: 24
    Item 1, name: P24_MEALID; item 1, value: #MEALTYPEID#
    Item 2, name: P24_TEMPLATEID; item 2, value: #FOODTEMPLATEID#So basically I call the function to open the modal popup by the class name. When a link with that class name in it is clicked, it opens the popup.
    To remind you of the problem, the modal popup closes seconds after it has been opened. How do I fix this?
    Thanks in advance.
    (APEX version 4.1.1.00.23)

    Come on guys... I really need to know this. :(

  • Problem with JavaScript in DPS

    Hello,
    i have little problem with one HTML page in DPS. We've created HTML form, which is formatting output with JavaScript and then passing to local mail client via mailto. It works nicely in Safari on desktop, it works in Safari on iPad BUT it don't work in DPS, when we use it as HTML content (frame on page where form is loaded). Unfortunately, there is no way how to learn what's wrong - on iPad it works, it's not working just in DPS (and it's not working in Viewer on desktop too).
    Anyone have any idea what to do?
    Script is fairly simple, it's my compilation of other works, because i'm not JS programmer, just i'm skilled with google-copy-paste... So there can be some VERY trivial error, but i don't know correct syntax...
    very simple version of this form, which is not working in DPS (but everywhere else), is here
    http://dl.optio.cz/mailtoExample.html
    Thanks for any help!

    Hello,
    when used in DPS browser, it's working (as part of HTMLresources.zip). I don't know if this will help, but here is small game, which works correctly in DPS in web overlay. when you move any red circle, it will let you send results via email. But this is too complicated for my minimal skills.
    http://dl.optio.cz/Hra_en/
    Anyway, thanks for help
    Martin

  • Problem with javascript jsp

    Hi,
    I am using following htl in my jsp.
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    I am using the following javascript in on submit event
    alert(document.form.markets.length );But i am getting "undefined" in my alert box.However if there are more such checkboxes named market...i am getting the length as output.
    what may be the problem?
    Thanks
    Vivek

    i tried this and its working fine:
    alert(document.forms[0].markets.length );
    <form>
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    <INPUT type=CHECKBOX name='markets' value='911|6' >
    </form>

  • Problem with javascript confirm() in a JSP

    I'm trying to use a confirm() box in a jsp. I've looked at tons of examples and I still have the same problem. If I just add this to my page the prompt will pop up as expected: (of course it doesn't really do anything.)<SCRIPT LANGUAGE="JavaScript">
    confirm( "Are you sure you want to delete?" )
    </SCRIPT>As soon as I add an if clause around it it doesn't even pop up anymore, such as:if (confirm("Are you sure you want to delete?")){
    <%
         Do some jsp stuff
    %>
    else {
    <%
         Do some jsp stuff
    %>
    }I can include more of the code if needed. This code is for deleting some files, so I want to add an "are you sure prompt?". If they hit ok it will delete, otherwise cancel the operation.
    I assume that the "if confirm( "Are you sure you want to delete?" ) " should wait for a reponse before continuing. Any help is appreciated.
    Thanks,
    James

    You can use Javascript to confirm a delete, and delete an object in the following manner.
    //link to delete an object..
    <a href="thisPage.jsp?delete=<%= itemID %>"
       onClick="return confirm('Are you sure you wish to delete this item?');">delete</a>Then, at the top of the JSP pageif(request.getParameter("delete") != null)
       //do whatever to delete, then load the page as normal
    }Now, your item will be deleted, and the page will be refreshed to show the changes.

  • Problem with onload in jsp page

    Hi all,
    I had two jsp pages, a search and a results page. I need to enter some search criteria in the first page and based on that criteria i will be getting the results in the results jsp. Now, when i click the back button in the results page, i need to go to the search page and the values which i entered in the search page needs to be present there. But the problem is i had a javascript function which runs on loading of the search page. This function will set all the values in this search page to empty whenever we go to the search page. I am calling this javascript function as follows in my search jsp page.
    <body onload="setdefaultvalues('<%=name%>');">
    I am having the code for the back button in the results page as follows.
    <INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1);resetvalue(name);" class="button">
    The problem i am facing is whenever i go to the search page by clicking on the back button, the values in the search page are getting empty because of the onload method. There is no way that i can remove this onload method as i require it for setting the values in the search page evrytime i get to that from other modules as it is the main page for my module. So, is there anyway that i can stop this function from executing when i come from the results page or is there any other way that i can store the values in the search page when going from the results page.

    i think you really should have the result page include your search page contents rather than having the user need to click back as you'll end up with all sorts of nightmares in caching & session object management to be honest. if the search page is complex use javascript to hide contents and let the users expand them when they want to re-search.
    however, if you feel you must i would suggest the following:
    in your result page:
    session.setAttribute("userQuery","true"); (you probably actually want to put a container object with the query information in here)
    in your search page you could have something like:
    <body <% session.getAttribute("userQuery")==null { %>onload="setdefaultvalues('<%=name%>');"<% } %>>
    -or-
    <body onload="setdefaultvalues('<%=name%>',<%=session.getAttribute("userQuery")==null?"true":"false"%>);">
    function setdefaultvalues(name,run) { if ( !run ) return;....}
    you'll have to decide when to remove the object though cause once its set its there until the session expires or you remove it.
    hope that helps, good luck!

Maybe you are looking for

  • Wwjps.jar & wwjpstag.jar

    I'm trying to build a JSP Portal Page, following the documentation "Oracle HTTP Server Integrating JavaServer Pages with Oracle9iAS Portal" I cannot find the wwjpstag.jar or wwjps.jar in the JPDK. Can someone email it to me and any other files (like

  • [SOLVED] Arch Kernel causes problems

    Since my very first time installing Arch, i was getting some errors like Cannot parse block device ids for /dev/sdb2 Cannot find root device /dev/sdb2 and eventually i had found a work-around, by taking the kernel and initramfs files (both 2.6.25.20-

  • "SHOW ALL" command in RMAN

    Hi I need to understand, what does RMAN use to read configuration info in case of No Recovery catalog. We all know that it read from Control file about backup information. But, when my database is in NOMOUNT mode, I connect to rman target / Then I ru

  • My iphone4s will not let me text one contact?

    My iPhone 4s will it let me text one contact

  • Don't want WebDav System Authentication window to appear.

    I've just upgraded my iMac G5 to OS 10.4.9. I don't have a .mac account and don't want one at this time. However, a window keeps popping up while I'm working on the desktop saying, "WebDAV system authentication problem" and asking for a password to l