If statement in Java Script

Hi,
I just want to create a simple IF statement. I have looked at two text books and the on-line help but it still does not work.
I have two fields.
One is called "IfTest"
The other is called "PFValue"
If "A" is entered in field "IfTest" then I want the text message "50:50" to appear in the "PFValue" field. If "A" is not entered the I want "50:25:25" to appear.
The formula I have entered in field "PFValue" is :
ProFormaInv.Invoice.PFValueB::calculate - (JavaScript, client)
if (IfTest.rawValue == "A")
"50:50"
Else
"50:25:25"
But it does not work. What have I done wrong? I have attached the pdf form I am creating which is a Pro Forma Invoice.
Regards
Chris C

Change the code to:
if(ProFormaInv.Invoice.IfTest.rawValue == "A") 
{this.rawValue="50:50";
else
this.rawValue="50:25:25";
Also, your best bet for getting involved in the Designer communinity and responses to your posts is in this forum: http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_designer_es
The forum you are currently in is for Adobe Certified Trainers

Similar Messages

  • In a Conversion file, Using Java Script - IF statement with Greater,Less definitions

    Hail to All Gurus,
    Well, I've been trying to make a conversion file by using if statement of Java script with < , > definitions. unfortunately i got "Evolution error" over and over again.
    Actually i want to convert all dates before 2009 as 2008.12. And the dates which is greater than 2009 will be converted as they are (e.g. 2009.01 or 2010.02 etc.).
    Code is:
    js:if(%external%.toString().substring(0,4)<"200900"){"2008.12"}else{%external%.toString().substring(0,4) + "." + %external%.toString().substring(4,6)}
    SAP EPM version 10.0 SP15 Patch 2
    Build 8586
    Thanks for your help in advance

    Sadi,
    You can write if Statement in transformation not conversion.
    Look at this docs,
    How to Import Master Data and Hierarchies into SAP BusinessObjects BPC 7.5 from SAP NetWeaver BW
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c02d0b47-3e54-2d10-0eb7-d722b633b72e?QuickLink=index&…
    Thanks

  • Java Script for Blackberry Curve 8900

    I have a BB Curve 8900 on Orange in the UK. I am trying to access live football on the BBC website but it states that Java Script needs to be activated. Can anyone help to resolve this?
    Thanks.
    Dazzler

    Hello!
    That setting is on this page:
    from within the Browser App, ( > Options > Browser Configuration).
    You may also find that changing, also on that screen, your Browser Identification to another browser might help your BB interact better with some websites.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I need help writing an if then statement Java Script.

    In the Text Field Properties box I see the Calculate tab where I think that the form can do a logic (IF/THEN) function if I can place the correct Java Script code into the form. Unfortunately; I do not know how to write in Java Script.
         - I have a form with a field identifier called BACompnayAddress (this is the field where they would enter their address).
         - I then have a form field with two radials that says "Is the shipping address the same as the business Address" - "Yes" and "No" (the form identified for the radials is SASame.
    What I am trying to accomplish:
         - If they click Yes, I would like the Shipping Address field (field identifiier ShippingAddressAddress) to fill in the information found in BACompanyAddress and if they click No leave the  field blank to be filled out by the person filling out the form.
    I appreciate any help.
    Thanks,
    Brett

    If that's what it does, that is exactly what you said it needs to do. You said niothing about what should cause it to go back to frame 1.  If you want it to go back to frame 1 with a ROLL_OUT event, then you would add a listener for that. If you want something else to trigger it to go back, then you just need to work that out.
    The only time I can see where an if/else would be needed is if you want it to change frames for every rollover such that if it is in frame 1, then go to frame 2, and vice versa the next time you rollover it.

  • Java script is not working while coming back to the page.

    Hi Experts,
    I am working in jdev 11.1.1.3.0 with ADF BC.
    I am callling javascript in my jsff, while this javascrip is invoking file download method. this java script i am inovking from another button action, because in some case i need to invoke popup and some case i need to invoke file download for this i have taken one button in that button i am invoking these 2 based on some condition. everything is working fine except if i move another jsff and come back to this jsff then the file download is not happening.
    can any one tell me what is the issue here.
    java script:
    function customHandler(event) {
    var exportCmd = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pt_region0:1:cb1")
    var actionEvent = new AdfActionEvent(exportCmd);
    actionEvent.noResponseExpected();
    actionEvent.queue();
    java bean:
    if(downloadFile!=null){
    System.out.println("invoking downloads...............................");
    erks.addScript(context, "customHandler();");
    } if (requestClause != null){
    System.out.println("invoke popup");
    executeSactionCheckVO(requestClause);
    ADFUtils.invokePopup(this.getP2().getClientId(FacesContext.getCurrentInstance()));
    Here my bean is in backing bean scope.
    can any one help what may be the issue here. or if you can tell me how to call file download method from backing that can be great help full to me.
    Edited by: user5802014 on Aug 27, 2010 1:52 PM

    Hi:
    So it's the "erks.addScript(context, "customHandler();");" may not work properly the next time coming back from another jsff.
    And very likely the statement of: var exportCmd = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pt_region0:1:cb1") in your javascript command gave you error. Are you sure that "pt1:pt_resion0:1:cb1" is valid all the time no matter how the page is rendered?
    Please mark my answer as 'Helpful' if it helps.
    Thanks,
    Alex

  • Using XML file in Java script to create Google Map

    Hello,
    I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path.
    Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that will have pop-up info bubbles with additional info inside (using html), once the marker is clicked.
    Here is the XML script example that is used in the tutorial I am following:
    <markers>
    <marker lat="43.65654" lng="-79.90138" html="Some stuff to display in the<br>First Info Window"
    label="Marker One" />
    <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window"
    label="Marker Two" />
    <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window"
    label="Marker Three" />
    </markers>
    ...and this is how it looks when the file is retrieved by the java script and mapped: http://econym.googlepages.com/example_map3.htm
    This is the java script that creates the Google Map. I have emboldened the section of the script that retrieves the data and parses it to create the markers:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA6GoL8P5zqjQlG5A5uM1ETBSUPozAscB0cY3RG8xEGnZyeom4axRySak889rVpvHYRsV4f9OZZzbboA"
    type="text/javascript"></script>
    </head>
    <body onunload="GUnload()">
    <!-- you can use tables or divs for the overall layout -->
    <table border=1>
    <tr>
    <td>
    <div id="map" style="width: 800px; height: 1200px"></div>
    </td>
    <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
    <div id="side_bar"></div>
    </td>
    </tr>
    </table>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
    However, it seems JavaScript is either disabled or not supported by your browser.
    To view Google Maps, enable JavaScript by changing your browser options, and then
    try again.
    </noscript>
    <script type="text/javascript">
    //<![CDATA[
    if (GBrowserIsCompatible()) {
    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";
    // arrays to hold copies of the markers used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];
    var i = 0;
    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    // add a line to the side_bar html
    side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
    i++;
    return marker;
    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 37.251699,-119.604315), 7);
    *// Read the data from testXML2blackpoolformat.xml*
    var request = GXmlHttp.create();
    request.open("GET", "testXML2blackpoolformat.xml", true);
    *request.onreadystatechange = function() {*
    *if (request.readyState == 4) {*
    var xmlDoc = GXml.parse(request.responseText);
    *// obtain the array of markers and loop through it*
    var markers = xmlDoc.documentElement.getElementsByTagName("ConnectoryRecord");
    *for (var i = 0; i < markers.length; i++) {*
    *// obtain the attribues of each marker*
    *var lat = parseFloat(markers[i].getAttribute("lat"));*
    *var lng = parseFloat(markers[i].getAttribute("lng"));*
    var point = new GLatLng(lat,lng);
    *var html = markers[i].getAttribute("html");*
    *var label = markers[i].getAttribute("label");*
    *// create the marker*
    var marker = createMarker(point,label,html);
    map.addOverlay(marker);
    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;
    request.send(null);
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm
    //]]>
    </script>
    </body>
    </html>
    Here is my delima--
    This is the xml format that I need to use because it can accept the rest of my excel file and loop it through the 14,000+ records to create a functioning xml file. This is just a sample (2 records) of the larger file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ConnectoryAug2008>
    <ConnectoryRecord>
         <lng>-117.03683</lng>
         <lat>32.944505</lat>
         <ConnectoryID>1</ConnectoryID>
         <Name>$2.95 Guys</Name>
         <StreetAddress>13750 Stowe Drive</StreetAddress>
         <City>Poway</City>
         <State>CA</State>
         <Zip>92064</Zip>
    <Marker>White</Marker>
         <IndustryGroup>Technical Services</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=1</ConnectoryProfileLink>
    </ConnectoryRecord>
    <ConnectoryRecord>
         <lng>-117.272843</lng>
         <lat>33.13337</lat>
         <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <Marker>Orange</Marker>
         <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    </ConnectoryRecord>
    </ConnectoryAug2008>
    This is the tutorial where I found the formatting techniques to successfully create the large xml file that will format/convert my excel file properly: http://www.mrexcel.com/tip064.shtml
    These variables should appear as html in the info bubble:
    <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    The "Marker" variable instructs Google Maps to label the marker with a particular color. I will be so grateful to the person(s) that helps me get through this wall that I have been hitting for a long time. It's very difficult without having the luxury of peers who know about these types of issues.
    Thank you!!

    Here is the relationship: They both contain geographic coordinates that produce a point on a map. I will use the rest of the information in the second xml file (company name, address, link, etc.) to produce the information for the bubble that will pop up once the marker is clicked.
    My problem is that I need to try to keep the second xml file in a relatively similar format, so the rest of my records will still be accepted. If I had a smaller amount of records I could place them directly into the javascript, but because there are so many records, I need to use an xml file that can be retrieved by the java script. I chose to use the second type of xml file because I can easily copy and past the 14,000+ records that are now in excel document.
    After the xml issue is corrected I need to rework the javascript that is now emboldened so that it will read the new xml file correctly. I included the first xml file so that the readers will understand what type of xml format is currently being used to produce the markers in the tutorial map.

  • Error message in java script using IE6

    I get the following error message on a web page java script with Internet Explorer 6 "C:\WINNT\Desktop\Error Report.htm."
    The java script works fine with IE 5, but not with IE6. Any ideas why or how to fix?
    Thank you,
    Alicia

    There are three scripts, here they are:
    1. Scripts.js
    NS4 = (document.layers);
    IE4 = (document.all);
    ver4 = (NS4 || IE4);
    IE5 = (IE4 && navigator.appVersion.indexOf("5.")!=-1);
    isMac = (navigator.appVersion.indexOf("Mac") != -1);
    isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac));
    function popUp(){return};
    function popDown(){return};
    if (!ver4) event = null;
    if (isMenu) {
    menuVersion = 3;
    menuWidth = 120;
    childOverlap = 5;
    childOffset = 0;
    perCentOver = null;
    secondsVisible = .2;
    fntCol = "#ffffff";
    fntSiz = "11";
    fntBold = false;
    fntItal = false;
    fntFam = "times new roman, times, serif";
    backCol = "#303886";
    overCol = "#91B3EE";
    overFnt = "#000000";
    borWid = 0;
    borCol = "#ffffff";
    borSty = "solid";
    itemPad = 5;
    imgSrc = "";
    imgSiz = 0;
    separator = 1;
    separatorCol = "#ffffff";
    isFrames = false; // <-- IMPORTANT for full window
    navFrLoc = "left"; // <-- display. see below
    keepHilite = true;
    clickStart = false;
    clickKill = false;
    function swapimg( imgid, newimg ) {
    imgid.src = newimg.src;
    if( document.images ) {
    about_on = new Image();
    about_on.src = "./images/about_on.jpg";
    about_off = new Image();
    about_off.src = "./images/about_off.jpg";
    practice_on = new Image();
    practice_on.src = "./images/practice_on.jpg";
    practice_off = new Image();
    practice_off.src = "./images/practice_off.jpg";
    lawyer_on = new Image();
    lawyer_on.src = "./images/lawyer_on.jpg";
    lawyer_off = new Image();
    lawyer_off.src = "./images/lawyer_off.jpg";
    career_on = new Image();
    career_on.src = "./images/career_on.jpg";
    career_off = new Image();
    career_off.src = "./images/career_off.jpg";
    resources_on = new Image();
    resources_on.src = "./images/resources_on.jpg";
    resources_off = new Image();
    resources_off.src = "./images/resources_off.jpg";
    contact_on = new Image();
    contact_on.src = "./images/contact_on.jpg";
    contact_off = new Image();
    contact_off.src = "./images/contact_off.jpg";
    2. hierArrays.js
    arMenu1 = new Array(
    130,
    199,247,
    "Overview","./about/overview.html",0,
    "Pro Bono Activities","./about/probono.html",0
    arMenu2 = new Array(
    190,
    199,287,
    "Commercial Finance","./practice/finance.html",0,
    "Corporate and Securities","./practice/corporate.html",0,
    "Insolvency","./practice/bankruptcy.html",0,
    "Land Use, Local Government and Environmental Law","./practice/land.html",0,
    "Litigation","./practice/litigation.html",0,
    "Real Estate","./practice/realestate.html",0,
    "Tax and Estate Planning","./practice/tax.html",0
    arMenu3 = new Array(
    120,
    199,327,
    "Partners","./lawyers/partners/index.html",0,
    "Associates","./lawyers/associates/index.html",0,
    "Of Counsel","./lawyers/counsel/index.html",0,
    "By Practice Area","./lawyers/practice.html",0,
    "Full Listing","./lawyers/full.html",0
    arMenu4 = new Array(
    135,
    199,447,
    "Contact Information","./contact/info.html",0,
    "Driving Directions","./contact/directions.html",0
    arMenu5 = new Array(
    180,
    199,365,
    "Summer Associate Program","./career/sumassoc.html",0
    3. hierMenus.js
    /*hierMenus.js
    * by Peter Belesis. v3.10.2 000720
    * Copyright (c) 2000 internet.com Corp. All Rights Reserved.
    * Originally published and documented at http://www.dhtmlab.com/
    * You may use this code on a public Web site only if this entire
    * copyright notice appears unchanged and you publicly display
    * on the Web page a link to http://www.dhtmlab.com/.
    * Contact [email protected] for all other uses.
    loader = (isFrames) ? (NS4) ? parent : parent.document.body : window;
    loader.onload = startIt;
    if(NS4){
         origWidth = loader.innerWidth;
         origHeight = loader.innerHeight;
         loader.onresize = reDo;
    isLoaded = false;
    NSresized = false;
    if (!window.menuVersion) {
         clickKill = keepHilite = clickStart = false;
    if (!window.imgHspace) imgHspace=0;
    isWin = (navigator.appVersion.indexOf("Win") != -1)
    mSecsVis = secondsVisible*1000;
    isRight = (window.navFrLoc && navFrLoc == "right");
    fullImgSize = (imgSiz+(imgHspace*2));
    if(!IE5) {
         imgSuf = (isRight) ? ">" : " ALIGN=RIGHT>";
         imgStr = "<IMG SRC='" + imgSrc + "' WIDTH=" + imgSiz + " HEIGHT=" + imgSiz +" VSPACE=2 HSPACE="+ imgHspace +" BORDER=0"+ imgSuf;
         if(IE4) imgStr = "<SPAN STYLE='height:100%;width:"+ (fullImgSize-(isRight?3:0)) +";float:"+ (isRight?"left":"right") +";overflow:hidden'>"+ imgStr +"</SPAN>";
    areCreated = false;
    menuLoc = null;
    function initVars() {
         if(areCreated) {
              for(i=1; i<topCount; i++) {
                   cur = eval("elMenu"+i);
                   clearTimeout(cur.hideTimer);
                   cur.hideTimer=null;
              clearTimeout(allTimer);
         topCount = 1;
         areCreated = false;
         beingCreated = false;
         isOverMenu = false;
         currentMenu = null;
         allTimer = null;
    initVars();
    function NSunloaded(){
         isLoaded = false;
    function NSloaded(e){
         if (e.target.name == mainFrName) {
              initVars();
              startIt();
    function IEunloaded() {
         initVars();
         isLoaded = false;
         setTimeout("keepTrack()",50)
    function keepTrack() {
         if (menuLoc.document.readyState == "complete") {
              initVars();
              startIt();
         else {
              setTimeout("keepTrack()",50);
    function startIt() {
         isLoaded = true;
         if (isFrames) {
              menuLoc = eval("parent.frames." + mainFrName);
              if (NS4) {
                   loader.captureEvents(Event.LOAD);
                   loader.onload = NSloaded;
                   menuLoc.onunload = NSunloaded;
              if (IE4) {
                   menuLoc.document.body.onunload = IEunloaded;
         else {
              menuLoc = window;
         menuLoc.nav = nav = window;
         if (clickKill) {
              if (NS4) menuLoc.document.captureEvents(Event.MOUSEDOWN);
              menuLoc.document.onmousedown = clicked;
         makeTop();
    function makeTop(){
         beingCreated = true;
         if(IE4) {
              topZ = 0;
              for (z=0;z<menuLoc.document.all.length;z++){
                   oldEl = menuLoc.document.all(z);
                   topZ = Math.max(oldEl.style.zIndex,topZ)
         while(eval("window.arMenu" + topCount)) {
              (NS4) ? makeMenuNS(false,topCount) : makeMenuIE(false,topCount);
              topCount++
         status = (topCount-1) + " Hierarchical Menu Trees Created"
         areCreated = true;
         beingCreated = false;
    // the following line was added by Rachel Gockley ([email protected]) on 27 July 2000
    status = "";
    function makeMenuNS(isChild,menuCount,parMenu,parItem) {
         tempArray = eval("arMenu" + menuCount);
         if (!isChild) {
              tempWidth = tempArray[0] ? tempArray[0] : menuWidth;
              menu = makeElement("elMenu" + menuCount,tempWidth,null,null);
         else {
              menu = makeElement("elMenu" + menuCount,null,parMenu,null);
         menu.array = tempArray;
         menu.setMenuTree = setMenuTree;
         menu.setMenuTree(isChild,parMenu);
         while (menu.itemCount < menu.maxItems) {
              menu.itemCount++;
              status = "Creating Hierarchical Menus: " + menuCount + " / " + menu.itemCount;
              prevItem = (menu.itemCount > 1) ? menu.item : null;
              itemName = "item" + menuCount + "_" + menu.itemCount;
              menu.item = makeElement(itemName,null,null,menu);
              menu.item.prevItem = prevItem;
              menu.item.setup = itemSetup;
              menu.item.setup(menu.itemCount,menu.array);
              if (menu.item.hasMore) {
                   makeMenuNS(true,menuCount + "_" + menu.itemCount,menu,menu.item);
                   menu = menu.parentMenu;
         menu.lastItem = menu.item;
         menu.setup(isChild,parMenu,parItem);
    function findTree(men){
         foundTree = false;
         for(i=11;i<men.array.length;i+=3){
              if(men.array) {
                   foundTree = true;
                   break;
         return foundTree;
    function setMenuTree(isChild,parMenu) {
         if (!isChild) {
              this.menuWidth = this.array[0] ? this.array[0] : menuWidth;
              this.menuLeft = this.array[1];
              this.menuTop = this.array[2];
              this.menuFontColor = this.array[3] ? this.array[3] : fntCol;
              this.menuFontOver = this.array[4] ? this.array[4] : overFnt;
              this.menuBGColor = this.array[5] ? this.array[5] : backCol;
              this.menuBGOver = this.array[6] ? this.array[6] : overCol;
              this.menuBorCol = this.array[7] ? this.array[7] : borCol;
              this.menuSeparatorCol = this.array[8] ? this.array[8] : separatorCol;
              this.treeParent = this;
              this.startChild = this;
              this.isTree = findTree(this);
         else {
              this.menuWidth = parMenu.menuWidth;
              this.menuLeft = parMenu.menuLeft;
              this.menuTop = parMenu.menuTop;
              this.menuFontColor = parMenu.menuFontColor;
              this.menuFontOver = parMenu.menuFontOver;
              this.menuBGColor = parMenu.menuBGColor;
              this.menuBGOver = parMenu.menuBGOver;
              this.menuBorCol = parMenu.menuBorCol;
              this.menuSeparatorCol = parMenu.menuSeparatorCol;
              this.treeParent = parMenu.treeParent;
              this.isTree = parMenu.isTree;
         this.maxItems = (isChild) ? this.array.length/3 : (this.array.length-9)/3;
         this.hasParent = isChild;
         this.setup = menuSetup;
         this.itemCount = 0;
    function makeMenuIE(isChild,menuCount,parMenu) {
         menu = makeElement("elMenu" + menuCount);
         menu.array = eval("arMenu" + menuCount);
         menu.setMenuTree = setMenuTree;
         menu.setMenuTree(isChild,parMenu);
         menu.itemStr = "";
         while (menu.itemCount < menu.maxItems) {
              menu.itemCount++;
              status = "Creating Hierarchical Menus: " + menuCount + " / " + menu.itemCount;
              itemName = "item" + menuCount + "_" + menu.itemCount;
              arrayPointer = (isChild) ? (menu.itemCount-1)*3 :((menu.itemCount-1)*3)+9;
              dispText = menu.array[arrayPointer];
              hasMore = menu.array[arrayPointer + 2];
              if(IE5) {
                   newSpan = menuLoc.document.createElement("SPAN");
                   with(newSpan) {
                        id = itemName;
                        with(style) {
                             width = (menu.menuWidth-(borWid*2));
                             fontSize = fntSiz + "pt";
                             fontWeight = (fntBold) ? "bold" : "normal";
                             fontStyle = (fntItal) ? "italic" : "normal";
                             fontFamily = fntFam;
                             padding = itemPad;
                             borderBottomWidth = separator + "px";
                             borderBottomStyle = "solid";
                        innerHTML = dispText;
                   newBreak = menuLoc.document.createElement("BR");
                   menu.appendChild(newSpan);
                   menu.appendChild(newBreak);
                   if(hasMore) {
    //3.10.2 added next 2 statements:
                        if (isRight) newSpan.style.paddingLeft = itemPad+fullImgSize;
                        else newSpan.style.paddingRight = itemPad+fullImgSize;
                        newImage = menuLoc.document.createElement("IMAGE");
                        with(newImage){
                             src = imgSrc;
                             with(style) {
                                  position = "absolute";
                                  width = imgSiz;
                                  height = imgSiz;
                                  left = (isRight) ? itemPad : (newSpan.style.pixelWidth - itemPad - imgSiz);
                                  top = newSpan.offsetTop + itemPad + (isMac ? 0 : 2);
                        newSpan.appendChild(newImage);
              else {
                   htmStr = (hasMore) ? imgStr + dispText : dispText;
                   menu.itemStr += "<SPAN ID=" + itemName + " STYLE=\"width:" + (menu.menuWidth-(borWid*2)) + "\">" + htmStr + "</SPAN><BR>";
              if (hasMore) {
                   makeMenuIE(true,menuCount + "_" + menu.itemCount,menu);
                   menu = menu.parentMenu;
         if(!IE5) menu.innerHTML = menu.itemStr;
         itemColl = menu.children.tags("SPAN");
         for (i=0; i<itemColl.length; i++) {
              it = itemColl(i);
              it.setup = itemSetup;
              it.setup(i+1,menu.array);
         menu.lastItem = itemColl(itemColl.length-1);
         menu.setup(isChild,parMenu);
    function makeElement(whichEl,whichWidth,whichParent,whichContainer) {
         if (NS4) {
              if (whichWidth) {
                   elWidth = whichWidth;
              else {
                   elWidth = (whichContainer) ? whichContainer.menuWidth : whichParent.menuWidth;
                   if (whichContainer) elWidth = elWidth-(borWid*2)-(itemPad*2);
              if (!whichContainer) whichContainer = menuLoc;
              eval(whichEl + "= new Layer(elWidth,whichContainer)");
         else {
              if (IE5) {
                   newDiv = menuLoc.document.createElement("DIV");
                   newDiv.style.position = "absolute";
                   newDiv.id = whichEl;
                   menuLoc.document.body.appendChild(newDiv);
              else {
                   elStr = "<DIV ID=" + whichEl + " STYLE='position:absolute'></DIV>";
                   menuLoc.document.body.insertAdjacentHTML("BeforeEnd",elStr);
              if (isFrames) eval(whichEl + "= menuLoc." + whichEl);
         return eval(whichEl);
    function itemSetup(whichItem,whichArray) {
         this.onmouseover = itemOver;
         this.onmouseout = itemOut;
         this.container = (NS4) ? this.parentLayer : this.parentElement;
         arrayPointer = (this.container.hasParent) ? (whichItem-1)*3 : ((whichItem-1)*3)+9;
         this.dispText = whichArray[arrayPointer];
         this.linkText = whichArray[arrayPointer + 1];
         this.hasMore = whichArray[arrayPointer + 2];
         if (IE4 && this.hasMore) {
              this.child = eval("elMenu" + this.id.substr(4));
              this.child.parentMenu = this.container;
              this.child.parentItem = this;
         if (this.linkText) {
              if (NS4) {
                   this.captureEvents(Event.MOUSEUP)
                   this.onmouseup = linkIt;
              else {
                   this.onclick = linkIt;
                   this.style.cursor = "hand";
         if (NS4) {
              htmStr = this.dispText;
              if (fntBold) htmStr = htmStr.bold();
              if (fntItal) htmStr = htmStr.italics();
              htmStr = "<FONT FACE='" + fntFam + "' POINT-SIZE=" + fntSiz + ">" + htmStr+ "</FONT>";
              this.htmStrOver = htmStr.fontcolor(this.container.menuFontOver);
              this.htmStr = htmStr.fontcolor(this.container.menuFontColor);
              if(this.hasMore) {
                   this.document.write(imgStr);
                   this.document.close();
              this.visibility = "inherit";
              this.bgColor = this.container.menuBGColor;
              if (whichItem == 1) {
                   this.top = borWid + itemPad;
              else {
                   this.top = this.prevItem.top + this.prevItem.clip.height + separator;
              this.left = borWid + itemPad;
              this.clip.top = this.clip.left = -itemPad;
              this.clip.right = this.container.menuWidth-(borWid*2)-itemPad;
              maxTxtWidth = this.container.menuWidth-(borWid*2)-(itemPad*2);
              if (this.container.isTree) maxTxtWidth-=(fullImgSize);
              this.txtLyrOff = new Layer(maxTxtWidth,this);
              if (isRight && this.container.isTree) this.txtLyrOff.left = fullImgSize;
              this.txtLyrOff.document.write(this.htmStr);
              this.txtLyrOff.document.close();
              this.txtLyrOff.visibility = "inherit";
              this.clip.bottom = this.txtLyrOff.document.height+itemPad;
              this.txtLyrOn = new Layer(maxTxtWidth,this);
              if (isRight && this.container.isTree) this.txtLyrOn.left = fullImgSize;
              this.txtLyrOn.document.write(this.htmStrOver);
              this.txtLyrOn.document.close();
              this.txtLyrOn.visibility = "hide";
              this.dummyLyr = new Layer(100,this);
              this.dummyLyr.left = this.dummyLyr.top = -itemPad;
              this.dummyLyr.clip.width = this.clip.width;
              this.dummyLyr.clip.height = this.clip.height;
              this.dummyLyr.visibility = "inherit";
         else {
              with (this.style) {
                   if(!IE5) {
                        fontSize = fntSiz + "pt";
                        fontWeight = (fntBold) ? "bold" : "normal";
                        fontStyle = (fntItal) ? "italic" : "normal";
                        fontFamily = fntFam;
                        padding = itemPad;
                        borderBottomWidth = separator + "px";
                        borderBottomStyle = "solid";
    //3.10.2 modified next statement to one following
    //               if (this.container.isTree && (IE5 || (!IE5 && !this.hasMore))) {
                   if (this.container.isTree && !this.hasMore) {
                        if (isRight) paddingLeft = itemPad+fullImgSize;
                        else paddingRight = itemPad+fullImgSize;
                   color = this.container.menuFontColor;
                   borderBottomColor = this.container.menuSeparatorCol;
                   backgroundColor = this.container.menuBGColor;
    function menuSetup(hasParent,openCont,openItem) {
         this.onmouseover = menuOver;
         this.onmouseout = menuOut;
         this.showIt = showIt;
         this.keepInWindow = keepInWindow;
         this.hideTree = hideTree
         this.hideParents = hideParents;
         this.hideChildren = hideChildren;
         this.hideTop = hideTop;
         this.hasChildVisible = false;
         this.isOn = false;
         this.hideTimer = null;
         this.childOverlap = (perCentOver != null) ? ((perCentOver/100) * this.menuWidth) : childOverlap;
         this.currentItem = null;
         this.hideSelf = hideSelf;
         if (hasParent) {
              this.hasParent = true;
              this.parentMenu = openCont;
              if (NS4) {
                   this.parentItem = openItem;
                   this.parentItem.child = this;
         else {
              this.hasParent = false;
         if (NS4) {
              this.bgColor = this.menuBorCol;
              this.fullHeight = this.lastItem.top + this.lastItem.clip.bottom + borWid;
              this.clip.right = this.menuWidth;
              this.clip.bottom = this.fullHeight;
         else {
              with (this.style) {
                   width = this.menuWidth;
                   borderWidth = borWid;
                   borderColor = this.menuBorCol;
                   borderStyle = borSty;
                   zIndex = topZ;
    //3.10.2 added next statement
                   overflow = "hidden";
              this.lastItem.style.border="";
              this.fullHeight = this.offsetHeight;
              if(isMac)this.style.pixelHeight = this.fullHeight;
              this.fullHeight = this.scrollHeight;
              this.showIt(false);
              this.onselectstart = cancelSelect;
              this.moveTo = moveTo;
              this.moveTo(0,0);
    function popUp(menuName,e){
         if (NS4 && NSresized) startIt();
         if (!isLoaded) return;
         linkEl = (NS4) ? e.target : event.srcElement;
         if (clickStart) linkEl.onclick = popMenu;
         if (!beingCreated && !areCreated) startIt();
         linkEl.menuName = menuName;
         if (!clickStart) popMenu(e);
    function popMenu(e){
         if (!isLoaded || !areCreated) return true;
         eType = (NS4) ? e.type : event.type;
         if (clickStart && eType != "click") return true;
         hideAll();
         linkEl = (NS4) ? e.target : event.srcElement;
         currentMenu = eval(linkEl.menuName);
         currentMenu.hasParent = false;
         currentMenu.treeParent.startChild = currentMenu;
         if (IE4) menuLocBod = menuLoc.document.body;
         if (!isFrames) {
              xPos = (currentMenu.menuLeft) ? currentMenu.menuLeft : (NS4) ? e.pageX : (event.clientX + menuLocBod.scrollLeft);
              yPos = (currentMenu.menuTop) ? currentMenu.menuTop : (NS4) ? e.pageY : (event.clientY + menuLocBod.scrollTop);
         else {
              switch (navFrLoc) {
                   case "left":
                        xPos = (currentMenu.menuLeft) ? currentMenu.menuLeft : (NS4) ? menuLoc.pageXOffset : menuLocBod.scrollLeft;
                        yPos = (currentMenu.menuTop) ? currentMenu.menuTop : (NS4) ? (e.pageY-pageYOffset)+menuLoc.pageYOffset : event.clientY + menuLocBod.scrollTop;
                        break;
                   case "top":
                        xPos = (currentMenu.menuLeft) ? currentMenu.menuLeft : (NS4) ? (e.pageX-pageXOffset)+menuLoc.pageXOffset : event.clientX + menuLocBod.scrollLeft;
                        yPos = (currentMenu.menuTop) ? currentMenu.menuTop : (NS4) ? menuLoc.pageYOffset : menuLocBod.scrollTop;
                        break;
                   case "bottom":
                        xPos = (currentMenu.menuLeft) ? currentMenu.menuLeft : (NS4) ? (e.pageX-pageXOffset)+menuLoc.pageXOffset : event.clientX + menuLocBod.scrollLeft;
                        yPos = (currentMenu.menuTop) ? currentMenu.menuTop : (NS4) ? menuLoc.pageYOffset+menuLoc.innerHeight : menuLocBod.scrollTop + menuLocBod.clientHeight;
                        break;
                   case "right":
                        xPos = (currentMenu.menuLeft) ? currentMenu.menuLeft : (NS4) ? menuLoc.pageXOffset+menuLoc.innerWidth : menuLocBod.scrollLeft+menuLocBod.clientWidth;
                        yPos = (currentMenu.menuTop) ? currentMenu.menuTop : (NS4) ? (e.pageY-pageYOffset)+menuLoc.pageYOffset : event.clientY + menuLocBod.scrollTop;
                        break;
         currentMenu.moveTo(xPos,yPos);
         currentMenu.keepInWindow()
         currentMenu.isOn = true;
         currentMenu.showIt(true);
         return false;
    function menuOver(e) {
         this.isOn = true;
         isOverMenu = true;
         currentMenu = this;
         if (this.hideTimer) clearTimeout(this.hideTimer);
    function menuOut() {
         if (IE4) {
              theEvent = menuLoc.event;
              if (theEvent.srcElement.contains(theEvent.toElement)) return;
         this.isOn = false;
         isOverMenu = false;
         menuLoc.status = "";
         if (!clickKill) allTimer = setTimeout("currentMenu.hideTree()",10);
    function itemOver(){
         if (keepHilite) {
              if (this.container.currentItem && this.container.currentItem != this) {
                   if (NS4) {
                        this.container.currentItem.bgColor = this.container.menuBGColor;
                        this.container.currentItem.txtLyrOff.visibility = "inherit";
                        this.container.currentItem.txtLyrOn.visibility = "hide";
                   else {
                        with (this.container.currentItem.style) {
                             backgroundColor = this.container.menuBGColor;
                             color = this.container.menuFontColor;
         if (IE4) {
              theEvent = menuLoc.event;
              if (theEvent.srcElement.tagName == "IMG") return;
              this.style.backgroundColor = this.container.menuBGOver;
              this.style.color = this.container.menuFontOver;
         else {
              this.bgColor = this.container.menuBGOver;
              this.txtLyrOff.visibility = "hide";
              this.txtLyrOn.visibility = "inherit";
         menuLoc.status = this.linkText;
         this.container.currentItem = this;
         if (this.container.hasChildVisible) {
              this.container.hideChildren(this);
         if (this.hasMore) {
              horOffset = (isRight) ? (this.container.childOverlap - this.container.menuWidth) : (this.container.menuWidth - this.container.childOverlap);
              if (NS4) {
                   this.childX = this.container.left + horOffset;
                   this.childY = (this.pageY+this.clip.top) + childOffset;
              else {
                   this.childX = this.container.style.pixelLeft + horOffset;
                   this.childY = this.offsetTop + this.container.style.pixelTop + childOffset + borWid;
              this.child.moveTo(this.childX,this.childY);
              this.child.keepInWindow();
              this.container.hasChildVisible = true;
              this.container.visibleChild = this.child;
              this.child.showIt(true);
    function itemOut() {
         if (IE4) {
              theEvent = menuLoc.event;
              if (theEvent.srcElement.contains(theEvent.toElement)
         || (theEvent.fromElement.tagName=="IMG" && theEvent.toElement.contains(theEvent.fromElement)))
              return;
              if (!keepHilite) {
                   this.style.backgroundColor = this.container.menuBGColor;
                   this.style.color = this.container.menuFontColor;
         else {
              if (!keepHilite) {
                   this.bgColor = this.container.menuBGColor;
                   this.txtLyrOff.visibility = "inherit";
                   this.txtLyrOn.visibility = "hide";
              if (!isOverMenu && !clickKill) {
                   allTimer = setTimeout("currentMenu.hideTree()",10);
    function moveTo(xPos,yPos) {
         this.style.pixelLeft = xPos;
         this.style.pixelTop = yPos;
    function showIt(on) {
         if (NS4) {
              this.visibility = (on) ? "show" : "hide";
              if (keepHilite && this.currentItem) {
                   this.currentItem.bgColor = this.menuBGColor;
                   this.currentItem.txtLyrOff.visibility = "inherit";
                   this.currentItem.txtLyrOn.visibility = "hide";
         else {
              this.style.visibility = (on) ? "visible" : "hidden";
              if (keepHilite && this.currentItem) {
                   with (this.currentItem.style) {
                        backgroundColor = this.menuBGColor;
                        color = this.menuFontColor;
         this.currentItem = null;
    function keepInWindow() {
         scrBars = 20;
         botScrBar = (isFrames && navFrLoc=="bottom") ? (borWid*2) : scrBars;
         rtScrBar = (isFrames && navFrLoc=="right") ? (borWid*2) : scrBars;
         if (NS4) {
              winRight = (menuLoc.pageXOffset + menuLoc.innerWidth) - rtScrBar;
              rightPos = this.left + this.menuWidth;
              if (rightPos > winRight) {
                   if (this.hasParent) {
                        parentLeft = this.parentMenu.left;
                        newLeft = ((parentLeft-this.menuWidth) + this.childOverlap);
                        this.left = newLeft;
                   else {
                        dif = rightPos - winRight;
                        this.left -= dif;
              winBot = (menuLoc.pageYOffset + menuLoc.innerHeight) - botScrBar ;
              botPos = this.top + this.fullHeight;
              if (botPos > winBot) {
                   dif = botPos - winBot;
                   this.top -= dif;
              winLeft = menuLoc.pageXOffset;
              leftPos = this.left;
              if (leftPos < winLeft) {
                   if (this.hasParent) {
                        parentLeft = this.parentMenu.left;
                        newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
                        this.left = newLeft;
                   else {
                        this.left = 5;
         else {
              winRight = (menuLoc.document.body.scrollLeft + menuLoc.document.body.clientWidth) - rtScrBar;
              rightPos = this.style.pixelLeft + this.menuWidth;
              if (rightPos > winRight) {
                   if (this.hasParent) {
                        parentLeft = this.parentMenu.style.pixelLeft;
                        newLeft = ((parentLeft - this.menuWidth) + this.childOverlap);
                        this.style.pixelLeft = newLeft;
                   else {
                        dif = rightPos - winRight;
                        this.style.pixelLeft -= dif;
              winBot = (menuLoc.document.body.scrollTop + menuLoc.document.body.clientHeight) - botScrBar;
              botPos = this.style.pixelTop + this.fullHeight;
              if (botPos > winBot) {
                   dif = botPos - winBot;
                   this.style.pixelTop -= dif;
              winLeft = menuLoc.document.body.scrollLeft;
              leftPos = this.style.pixelLeft;
              if (leftPos < winLeft) {
                   if (this.hasParent) {
                        parentLeft = this.parentMenu.style.pixelLeft;
                        newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
                        this.style.pixelLeft = newLeft;
                   else {
                        this.style.pixelLeft = 5;
    function linkIt() {
         if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
         else menuLoc.location.href = this.linkText;
    function popDown(menuName){
         if (!isLoaded || !areCreated) return;
         whichEl = eval(menuName);
         whichEl.isOn = false;
         if (!clickKill) whichEl.hideTop();
    function hideAll() {
         for(i=1; i<topCount; i++) {
              temp = eval("elMenu" + i + ".startChild");
              temp.isOn = false;
              if (temp.hasChildVisible) temp.hideChildren();
              temp.showIt(false);
    function hideTree() {
         allTimer = null;
         if (isOverMenu) return;
         if (this.hasChildVisible) {
              this.hideChildren();
         this.hideParents();
    function hideTop() {
         whichTop = this;
         (clickKill) ? whichTop.hideSelf() : (this.hideTimer = setTimeout("if(whichTop.hideSelf)whichTop.hideSelf()",mSecsVis));
    function hideSelf() {
         this.hideTimer = null;
         if (!this.isOn && !isOverMenu) {
              this.showIt(false);
    function hideParents() {
         tempMenu = this;
         while (tempMenu.hasParent) {
              tempMenu.showIt(false);
              tempMenu.parentMenu.isOn = false;
              tempMenu = tempMenu.parentMenu;
         tempMenu.hideTop();
    function hideChildren(item) {
         tempMenu = this.visibleChild;
         while (tempMenu.hasChildVisible) {
              tempMenu.visibleChild.showIt(false);
              tempMenu.hasChildVisible = false;
              tempMenu = tempMenu.visibleChild;
         if (!this.isOn || !item.hasMore || this.visibleChild != this.child) {
              this.visibleChild.showIt(false);
              this.hasChildVisible = false;
    function cancelSelect(){return false}
    function reDo(){
         if (loader.innerWidth==origWidth && loader.innerHeight==origHeight) return;
         initVars();
         NSresized=true;
         menuLoc.location.reload();
    function clicked() {
         if (!isOverMenu && currentMenu!=null && !currentMenu.isOn) {
              whichEl = currentMenu;
              whichEl.hideTree();
    window.onerror = handleErr;
    function handleErr(){
         arAccessErrors = ["permission","access"];
         mess = arguments[0].toLowerCase();
         found = false;
         for (i=0;i<arAccessErrors.length;i++) {
              errStr = arAccessErrors[i];
              if (mess.indexOf(errStr)!=-1) found = true;
         return found;
    //end

  • Need java script 6.26 to use banking software keep getting "the connection was reset" error Java appears on addon blocked list

    I am trying to use Team One Credit Unions CU@home to access my accounts. Their support team tells me I need Java script 6.26. I show that on my add on list but it also states Java is blocked on the blocked software list. How do I get Java script running so I can do my home banking or at least test it to be sure that is the issue. I have tried running this program with Java enabled and disabled with the same results.

    To avoid confusion: http://kb.mozillazine.org/JavaScript_is_not_Java
    See:
    * http://kb.mozillazine.org/Java
    * http://kb.mozillazine.org/JavaScript
    Java 6 U26 is about the Java plugin.
    You can see in "Tools > Add-ons > Plugins" if the Java plugin is installed and also on the about:plugins page via the location bar.
    * http://www.java.com/en/download/help/testvm.xml - How do I test whether Java is working on my computer? - 1.4.2_xx, 1.5.0, 6.0

  • How create indesign using Java Script

    I am new in indesign and want to create indesign application using JavaScript.
    When i use AppleScript to create Indesign Application i use this statement
    tell application "Adobe InDesign CS5.5"
    set myDocument to make document with properties
    end tell
    Indesign Application create sucessfully.
    How create Indesign Application using JavaScript ?
    or what is equivelent statement of ( tell application "Adobe InDesign CS5.5" ) in Java Script.
    There are some java scripting example given on forum or in sdk.These all example start with app.
    when I debug these java script using ExtendScript ToolKit 3.6 It give error on app (undefined app).I think this app ia application object.
    How create  indesign application object  app in javascript ?
    While this script run sucessfully when i put these script in C:\Program Files\Adobe\Adobe InDesign CS5.5\Scripts
    and to run these script use Scripts panel (choose Window > Utilities > Scripts), then double-click the script name in the Scripts panel in indesign application.But In this case first i start indesign application and then choose Window > Utilities > Scripts then double-click the script name in the Scripts panel.
    I want to create Indesign Application (instance) using JavaScript.When I run or (debug) my JavaScript in any javaScript tool like ExtendScript ToolKit 3.6 then Indesign application should start, like in Apple Script.
    Thanks

    Thanks Vamitul for reply
    For example when i run SelectObjects.jsx An InDesign CS5.5 JavaScript in ESTK  then message prompt "Target Adove Indesign CS5.5 is not running. Do you want to lanch." Then on click yes Indesign application start.
    I want to Know how indesign object "app" is created to start Indesign application on click yes.
    http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/In DesignScripting/InDesign-ScriptingTutorial.pdf
    Like in VB to create indesign object we use CreateObject("InDesign.Application"). In javascript how create object say "app" of InDesign Application.
    For example if  i write
    var myDocument = app.documents.add();
    var myTextFrame = myDocument.pages.item(0).textFrames.add();
    myTextFrame.geometricBounds = ["6p", "6p", "24p", "24p"];
    myTextFrame.contents = "Hello World!";
    in a simple text file and save it with .js extention and to open this double click on this  it give error undefined "app".
    Source :Microsoft JScript runtime error
    So how define "app" or create indesign object ?
    Thanks

  • Using a java script comfirmation in delete record function?

    Hello;
    I am trying to write a confirmation script in Java to delete
    a record. I don't want it to delete the whole table of information,
    just the record teh delete button is attached to using the ID. Here
    is my script, and then the code on the page:
    <script language="JavaScript">
    function confirmDelete(id) {
    if (confirm ("Are you sure you want to delete this record?"))
    document.HREF.action="ProjectCat-Action.cfm?id="+id;
    document.HREF.submit();
    return false;
    </script>
    Here is the query I am trying to use it with:
    <cfquery name="catMan" datasource="#sitedatasource#"
    username="#siteUserID#" password="#sitePassword#">
    SELECT Categories.Name AS ViewField1, Categories.CategoryID
    AS ID
    FROM Categories
    </cfquery>
    <head>
    </head>
    <body>
    <cfloop query="catMan" startRow="#URL.startRow#"
    endrow="#endRow#">
    <cfoutput>
    #ViewField1#
    <form action="ProjectCat-Action.cfm" method="post">
    <input type="hidden" name="ID" value="#ID#">
    <input type="submit" name="proj_Delete" onClick="return
    confirmDelete('#ViewField1#')" value="Delete"></form>
    </cfoutput>
    </cfloop>
    </body>
    #Note: there is code here in my loop query for next and
    previous buttons, I just didn't post that code because it doesn't
    pertain to this question.
    Is there also a way to make the Java Script state in the spot
    where it says, "Are you sure you want to delete this record" to
    make it say "Are you sure you want to delete #ViewField1#?" (the
    name of the record being deleted) ?
    Thank you!
    Phoenix

    just pass 2 arguments to your js function - id AND name of
    category:
    <input type="submit" name="proj_Delete" onClick="return
    confirmDelete(#ID#,'#ViewField1#')" value="Delete">
    and the function:
    function confirmDelete(id,name) {
    if (confirm ("Are you sure you want to delete " + name + "
    category?"))
    document.HREF.action="ProjectCat-Action.cfm?id="+id;
    document.HREF.submit();
    return false;
    but creating a separate form for each category displayed on
    the page is
    very inefficient - you should revise your code... you do not
    even need a
    form, really... just use <a href=...> to call your js
    function, or an
    <input type=button ...> (without any <form ..>
    tags) if you absolutely
    must have a button to click...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Opening ADF page from java script

    I am trying to use window.open(url, winName) to open an ADF page from java script.
    I have set the same winName but when i call the window.open method every time it opens up a new window.
    The code is as below:
    <html>
    <head>
    </head>
    <body>
    <script>
    function openwin() {
    window.open("about:blank", "winDocPrint", "width=800,height=600,location=no");
    </script>
    <form action="http://127.0.0.1:7101/RegionRefresh-ViewController-context-root/faces/EnterAndDisplay?_afrLoop=3611588465186&_afrWindowMode=0&_adf.ctrl-state=zoaas2mc3_4" target="winDocPrint" onsubmit="openwin">
    <input type="submit" value="Print Comments Call ADF">
    </form>
    </body>
    </html>
    when I click the button first time, it opens a new window, and keeps opening a new windows on clicking the button again.
    I want it to use the same window that was opened first time.
    Any help would be appreciated.
    Thanks,
    Sandeep M.
    Edited by: user8895611 on Mar 25, 2010 11:44 PM

    Hi,
    you need to keep the window handle reference so you can access the same window
    http://www.irt.org/script/874.htm
    Frank

  • Can a Button call a java script and then proceed with the creation

    Hi all,
    I have a simple APEX form on a table,
    with simple function as create and apply changes,
    some items of the form are computed by a "Computation"
    I need the create button to show the computed values, before move to the next page, then proceed with the creation ( submission)
    I have tried to show the values by a java script, but after clicking the button OK of the javascript msg, no submission performed ,
    details:
    the java script is called in the URL of the Button,
    it only contains a alert statement
    is there a way to let the button do that
    or may be the case could be solved by another idea!!!
    rgrds,

    Hi Varad,
    It is Before header of course. I forgot to mention this.
    Yes, you are right Varad, I have read again the question and seems original request was to show Computation that is done in After Submit, more javascript is required of course.
    One possibility is to create On Demand process called COMPUTEITEM where you compute your item, and in the end of on demand process it prints it
    htp.p(:P1_X)
    Then put in HTML header of your page
    <script language="JavaScript" type="text/javascript">
    function setShowItemSub(pThis){
       var l_This   = $x(pThis);
       var ajaxRequest = new htmldb_Get(null, $v('pFlowId'),  'APPLICATION_PROCESS=COMPUTEITEM', $v('pFlowStepId'));
       ajaxRequest.add($x(l_This).id, $v(l_This));
       var gReturn = ajaxRequest.get();
       alert(gReturn);
       ajaxRequest = null;
      doSubmit('aa');
    </script>And in Button URL textarea put:
    javascript:setShowItemSub('P1_X');
    Then no need in After Submit process anymore
    I have put this now in http://apex6.revion.com/pls/apex/f?p=225:1
    COMPUTEITEM On demand process is :
    :P1_X := :P1_X || ' Added this trail';
    htp.p(:P1_X);Of course, all this should be modified accordingly
    Regards,
    Oleg

  • Calling Java function from java script function

    Hello,
    I have a jsp in which on button click i am calling a java script function. now there is some data that i want to insert in a table on click of the same button. But in order to do that i need to write java code. but if i write java code inside the script function that is called on button click it doesnt work. what i understand is that i need to make a java function inside the jsp & call that from the script function. can someone tell me how to do that ?
    this is the code i have written
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
              <%     if(regTemp != "")
                        MakeConnection mc1 = new MakeConnection();
                        con1 = mc1.DBConnection();
                        String temp = "1";
                        System.out.println("inside the if loop for regTemp");
                        String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
                        stmt1 = con1.prepareStatement(query1);
                        stmt1.setString(1,regTemp);
                        stmt1.setString(2,temp);
                        /*stmt1.setString(3,temp);
                        stmt1.setString(4,"01-jan-2005");*/
                        rsinst = stmt1.executeQuery();
              %>
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);

    <%@ page import = "Utils.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.lang.String.*"%>
    <%@ page import = "java.text.*" %>
    <%@ page import = "java.util.*"%>
    <%
         String insertValues[] = new String[10];
         String regTemp = "";
         java.sql.Connection con1 = null;
         java.sql.ResultSet rs1 = null;
         java.sql.PreparedStatement stmt1 = null;
         java.sql.Statement stmtinst = null;
         java.sql.ResultSet rsinst = null;
         java.sql.Connection con = null;
         java.sql.PreparedStatement stmt = null;
         java.sql.ResultSet rs = null;
    %>
    <HTML>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script language = "javascript">
    /*Client side validations go here*/
    function submitForm()
         document.frmQueryBuilder.submit();
    function selectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = true;
    function deselectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = false;
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
                   document.frmQueryBuilder.temp.value ="newOne";
                   document.frmQueryBuilder.submit();
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);
    </script>
    </head>
    <BODY>
    <%
    int MaxCount = 15;
    int iCount1 = 0;
    int iCount2 = 0;
    int iCount3 = 0;
    String query = "";
    String eMailAddresses = "";
    StringBuffer sbMail = new StringBuffer();
    //String strValue[] = new String [MaxCount];
    //try
         String strCriteria [] = new String [10];
         String strCondition [] = new String [10];
         String strValue1 [] = new String [10];
         String strCombo [] = new String [10];
         for (iCount3 = 0; iCount3 < 10; iCount3 ++ )
              strCriteria[iCount3] = "";
              strCondition[iCount3] = "";
              strValue1[iCount3] = "";
              strCombo[iCount3] = "";
         if (request.getParameter ("txtAction") != null)
              //String nothing = request.getParameter("chk"+iCount2);
              //System.out.println("Value of checkbox : " +nothing);
              String strQuery[] = new String [MaxCount];     
              StringBuffer sb = new StringBuffer();
              String AccessQuery = "";
              String strTmpQuery = "";
              String strTmpRefType[] = new String [4];
              int QueryLen = 0;
              int ModifyLen = 0;
              int QueryLenNew = 0;
              String strTmpRefType1 = "";
              String strTmpRefType2 = "";
    String strTmpRefType3 = "";
         String strTmpRefType4 = "";
              strQuery[0] = "SELECT STUDREGID, NAME,STUDID,PROGRAM,BRANCH,CPI,EMAIL FROM STUDREGDTLS WHERE";
              sb.append(strQuery[0]);
              for (iCount3 = 1; iCount3 < 11; iCount3 ++)
                   iCount1++;
                   strCriteria[iCount3 - 1] = request.getParameter("criteria" + iCount1);
                   strCondition[iCount3 - 1] = request.getParameter("condition" + iCount1);
                   strValue1[iCount3 - 1] = request.getParameter("value" + iCount1);
                   strCombo[iCount3 - 1] = request.getParameter("combo" + iCount1);
              System.out.println("Loop"+iCount3);
                   if (!request.getParameter("criteria" + iCount1).equals("null"))
                        System.out.println("Started getting parameters");
                        strTmpRefType1 = request.getParameter("criteria" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  System.out.println("Entered anywhere if of Anywhere");
                                  strTmpRefType2 = "LIKE";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType2 = "LIKE";
                             else
                                  System.out.println("Anywhere & Startswith not selected");
                                  strTmpRefType2 = request.getParameter("condition" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  strTmpRefType3 = "\'" + "%" request.getParameter("value" iCount1)+ "%" + "\'";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType3 = "\'" request.getParameter("value" iCount1)+ "%" +"\'";
                             else if (request.getParameter("condition" + iCount1).equals("="))
                                            strTmpRefType3 = "\'" + request.getParameter("value" + iCount1)+ "\'";
                                            System.out.println(strTmpRefType3);
                                  else
                                            strTmpRefType3 = request.getParameter("value" + iCount1);
                        strTmpRefType4 = request.getParameter("combo" + iCount1);
                        System.out.println("Value of strTmpRefType2" +strTmpRefType2);     
                   strQuery[iCount3] = " upper(" strTmpRefType1 ") " strTmpRefType2 " upper(" strTmpRefType3 ") " strTmpRefType4 "";
                        System.out.println("Making Qyery"+iCount3);
                   sb.append(strQuery[iCount3]);
                   if (request.getParameter ("txtAction") != null)
                             MakeConnection mc = new MakeConnection();
                             con = mc.DBConnection();
                             QueryLen = sb.length();                         
                             ModifyLen = strTmpRefType4.length();
                             QueryLenNew = (QueryLen - ModifyLen);
                             sb.delete(QueryLenNew, QueryLen);
                             AccessQuery = sb.toString();
                             System.out.println(AccessQuery);
                             stmt = con.prepareStatement (AccessQuery);
                             rs = stmt.executeQuery();
    %>
    <table width="563" >
    <tr><td><DIV CLASS="windowtitle">Student Search</DIV></td></tr>
    <tr><td><DIV CLASS="udGroupBoxHdrDiv">Enter Search Criteria</DIV></td></tr>
    <tr><td CLASS="bgcol">
    <FORM name=frmQueryBuilder METHOD='POST'>
    <INPUT TYPE=hidden Name='txtAction' value='S'>
    <table >
    <%
         for(iCount1 = 1; iCount1 < 11; iCount1++)
                   System.out.println (strCriteria[iCount1-1]);
                   if(iCount1 == 9)
    %>                         <TR valign=top>
    <%
                   else
    %>                          <TR>
    <%
    %>
    <TD width="47"><LABEL CLASS="assoctext">Criteria </LABEL></td><td width="150">
              <SELECT NAME='<%="criteria" + iCount1%>' size="1">
    <OPTION VALUE='null'>- - - - - - - - - - - - - - - - -</OPTION>
         <OPTION VALUE='AGE' <%=strCriteria[iCount1-1].equals("AGE")?"selected":""%>>AGE</OPTION>
         <OPTION VALUE='BRANCH' <%=strCriteria[iCount1-1].equals("BRANCH")?"selected":""%>>BRANCH</OPTION>
         <OPTION VALUE='CPI' <%=strCriteria[iCount1-1].equals("CPI")?"selected":""%>>CPI</OPTION>
         <OPTION VALUE='DEPARTMENT' <%=strCriteria[iCount1-1].equals("DEPARTMENT")?"selected":""%>>DEPARTMENT</OPTION>
    <OPTION VALUE='DREAMCOMP' <%=strCriteria[iCount1-1].equals("DREAMCOMP")?"selected":""%>>DREAM COMPANY</OPTION>
    <OPTION VALUE='PROGRAM' <%=strCriteria[iCount1-1].equals("PROGRAM")?"selected":""%>>PROGRAM</OPTION>
    <OPTION VALUE='SKILLSET' <%=strCriteria[iCount1-1].equals("SKILLSET")?"selected":""%>>SKILL SET</OPTION>
    <OPTION VALUE='WORKEX' <%=strCriteria[iCount1-1].equals("WORKEX")?"selected":""%>>WORK EX</OPTION>
    </SELECT>
              </TD>
         <TD width="88">
              <SELECT NAME='<%="condition" + iCount1%>'>
                   <OPTION VALUE='<=' <%=strCondition[iCount1-1].equals("<=")?"selected":""%>><=</OPTION>
                   <OPTION VALUE='>=' <%=strCondition[iCount1-1].equals(">=")?"selected":""%>>>=</OPTION>
                   <OPTION VALUE='=' <%=strCondition[iCount1-1].equals("=")?"selected":""%>>EXACT MATCH</OPTION>
                   <OPTION VALUE='ANYWHERE' <%=strCondition[iCount1-1].equals("ANYWHERE")?"selected":""%>>ANYWHERE</OPTION>
                   <OPTION VALUE='STARTSWITH' <%=strCondition[iCount1-1].equals("STARTSWITH")?"selected":""%>>STARTS WITH</OPTION>
              </SELECT>
    </TD><TD width="38"><LABEL CLASS="assoctext">Value </LABEL></TD>
    <TD width="186"><INPUT NAME=<%="value" + iCount1%> value='<%=strValue1[iCount1-1]%>' size="20" >
    </TD>
    <TD width="187"><SELECT NAME='<%="combo" + iCount1%>'>
                   <OPTION VALUE='AND' <%=strCombo[iCount1-1].equals("AND")?"selected":""%>>AND</OPTION>
                   <OPTION VALUE='OR' <%=strCombo[iCount1-1].equals("OR")?"selected":""%>>OR</OPTION>
              </SELECT>
    </TD>
    </TR>
    <%
    %>
    </table>
    </td></tr>
    <tr><td align=center>
    <BR>
    <INPUT CLASS="butstyle" type="button" id="cmdSave" enableAlways = "0" value="Submit" onclick="return submitForm();" >
    </td></tr>
    </table>
    <table width="698">
    <tr><td colspan = 6><DIV CLASS="udGroupBoxHdrDiv">Students Matching the Required Crieria</DIV></td></tr>
    <TR>
         <TD CLASS="tblhdr" width="50"></TD><TD CLASS="tblhdr" width="155">Student Name</TD>     <TD CLASS="tblhdr" width="150">Student
    Id</TD><TD CLASS="tblhdr" width="150">Program</TD><TD CLASS="tblhdr" width="150">Branch</TD><TD CLASS="tblhdr" width="62">CPI</TD>
         </TR>
    <%          int i = 0;
         if (request.getParameter ("txtAction") != null)
                   while( rs.next())
    %>
    <%                         System.out.println("Entered Output Loop"+ rs.getString("Name"));
                             System.out.println("Entered Output Loop.........."+ rs.getString("Email"));     
                             sbMail.append(rs.getString("Email")).append(",");
                             regTemp = rs.getString("STUDREGID");
                             i++;
                             System.out.println("student reg id........."+regTemp);
                             System.out.println("value of i........."+i);
    %>                    
                   <TR CLASS="bgcol">
                             <TD width="25"><INPUT TYPE="checkbox" NAME='<%="chk" + iCount2%>' id='<%="chk" + iCount2%>' VALUE=""></TD>
                             <TD width="155"><INPUT NAME=txtName size=20 value='<%=rs.getString("NAME")%>'></TD>
                             <TD width="150"><INPUT NAME=txtStudId size=20 value='<%=rs.getString("STUDID")%>'></TD>
                             <TD width="150"><INPUT NAME=txtProgram size=20 value='<%=rs.getString("PROGRAM")%>'></TD>
                             <TD width="150"><INPUT NAME=txtBranch size=20 value='<%=rs.getString("BRANCH")%>'></TD>
                             <TD width="62"><INPUT NAME=txtCpi size=4 value='<%=rs.getString("CPI")%>'></TD>
                   </TR>
                             <INPUT type="hidden" NAME=hdnEmail value='<%=rs.getString("Email")%>'>
                             <INPUT type = "hidden" NAME = studRegId value = '<%=rs.getString("studRegId")%>'>
                             <INPUT type ="hidden" NAME =temp value ="">
    <%
                             iCount2++;
         eMailAddresses = sbMail.toString();
                   if (con != null)
                             con.close();
    //catch( Exception e)
              System.out.println ("ERROR " + e);
              if (con != null)
                        con.close();
    %>
    </table>
    <table width="698" align=center>
    <tr><td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Select All" onclick="return selectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Deselect All" onclick="return deselectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Send Mail" onclick="sendMail(<%=iCount2%>)" >
    </td>
    </tr>
    </table>
    </FORM>
    </BODY>
    </HTML>
    <%     System.out.println("value inside hidden var temp"+request.getParameter("temp"));     
         if((request.getParameter("temp") != null) && (request.getParameter("temp").equals("newOne")))
         //if(regTemp != null)
              MakeConnection mc1 = new MakeConnection();
              con1 = mc1.DBConnection();
              String temp = "1";
              System.out.println("inside the if loop for regTemp");
              String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
              stmt1 = con1.prepareStatement(query1);
              stmt1.setString(1,regTemp);
              stmt1.setString(2,temp);
              /*stmt1.setString(3,temp);
              stmt1.setString(4,"01-jan-2005");*/
              rsinst = stmt1.executeQuery();
    %>

  • Calling java script in view

    Hi gurus,
    I am stuck with some issu, here is my issue as fallows
    Scenario:
    I am planning to open outlook client by passing some java script and i want to attach history of the email like same as reply button in MSoutlook
    - To call java script i am using webwidget UI element in WDJ and on action of  button i am calling that java script like as fallows
    String html = ReplyAll_class_j.callActiveXFromHTML(this.wdComponentAPI,"toemail", "fromAdd", "Subject of email",  <html><body>htmlbody</body></html>);
    wdContext.currentContextElement().setHtml(html);
    -  in java class i am passing some java script like as fallows
    public static String callActiveXFromHTML(IWDComponent compAPI,String toMailAddress,String ccEmailAddress,String mailSubject,String htmlBody) {
    Script is here
    the Issue is when i click the button it is not opening the outlook client but it is doing when i am click on the tab to recall the component, I thought it is doing this because i am passing "this.wdComponentAPI" as a parameter, but i dont know other solutions so please help me in this issue
    thanks in advance
    Anu

    Hi,
    I am not sure why is that statement "WE CANNOT CALL JS from WDJ"???? I did that pretty number of time in my developments. Can you please try the below mentioned way...
    Inside your method what ever you write to open the JS window
    String htmlcontent="Your HTML Content";
    try
    byte[] html=new byte [ 4096 ] ;
    html=htmlcontent.getBytes("UTF-8");
    wdContext.currentContextElement().setVaHTML(html);
    IWDWindow win =wdThis.wdGetAPI().getComponent().getWindowManager()
              .createNonModalExternalWindow(WDWebResource.getWebResource(html, WDWebResourceType.HTML).getURL(),"window Name As per your choice");
    win.setWindowSize(600,600);
    win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    win.removeWindowFeature(WDWindowFeature.MENU_BAR);  
    win.show();
    catch(WDURLException url)
    wdComponentAPI.getMessageManager().reportException("WDURLException::"+url.toString(),true);
    Regards,
    SrinivaS

  • Returning/passing Java script variable/value to PL/SQL environment

    Hi,
    Can someone give me a sample code about how to return a Java script variable to PLSQL environment?
    for example, I have a javascript function that returns timestamp in milisecond, I then want to write PLSQL code to call this java script function and save its value in a number-typed plsql variable for further calculation, I dont know how the two scripting language communicate.
    Thank you very much
    Binh
    null

    This is quite simple.
    I assume that you are able to define html form side through pl/sql. Suppose your new pl/sql value is v_time then in the procedure that you write include one more statement
    htp.p('<Input type=hidden name="v_time" value="">');
    and also in the form invocation,
    htp.p('<form name=app method=post action="time_handler" onSubmit="return false;">');
    and to the end you must be having a submit
    to it attach a onClick function that calls
    simply our validate function..
    eg htp.p('<Input type=submit value="process"
    onClick="validate();">');
    Include in the head portion
    the following script using htp.p procedure
    function validate()
    app.v_time.value=<calculated value>;
    return app.submit();
    Hope this helps.
    Nat
    null

Maybe you are looking for

  • HT201210 why do i get an unknown error when trying to restore my Iphone 3GS,

    i was informed (by app store icon i had apps that needed to be updated , i said ok to the 2 updates , the phine then asked me (as usual) to insert my pass word it said i had used wrong pass word and re-enter it which i did this then  set my phone to

  • Apple tv activation problem

    Why is the activation on my apple tv taking over than 45 minutes?   It just doesn't make sense.

  • Satellite Pro M10 Screen phosphor values

    Dear all, I'm trying to set up the Adobe calibration on my M10. Would you know where may I find the phosphor values for the TFT? Tnx in advance, All the best Takis

  • DCS does not update when file saving windows appear

    I am using LabView (with Fieldpoint opc) to control plant operations. When I save a labview file and the Save the VI window appears with the files/directories etc, everyprocess running on the computer freezes, input/output data from fieldpoint does n

  • English Trial version

    I downloaded a 30 trial version of PhotoShop to try.  This version is in some foreign language, how do I get a English version? Thanks