Javascript For loop not working within a function

Hi all,
I'm a beginner to LiveCycle and I cant seem to get a loop working within a function.  The function is being called successfully because when I manually create the code it works but I am trying to clean things up.
So here is my working example:
function hideContent() {
        MainFlowedSub.LevelsSub.Table1.presence = "hidden";
        MainFlowedSub.LevelsSub.Table2.presence = "hidden";
       ... and so on....
         MainFlowedSub.LevelsSub.Table8.Row1.presence = "hidden";
        MainFlowedSub.LevelsSub.Table8.Row2.presence = "hidden";
       ... and so on....
However when I try and creat a loop instead of listing every sing table/row nothing happens. this is important to my project as there will be alot of different rows depending on radio button selections earlier in the form.  Below is the current state of my code:
function hideContent() {
    var i=0;
     for (i=1;i<=5;i++)
         MainFlowedSub.LevelsSub.Table[i].presence = "hidden";
    var j=0;
     for (j=1;j<=23;j++)
         MainFlowedSub.LevelsSub.Table8.Row[j].presence = "hidden";
    var k=0;
     for (k=24;k<=88;k++)
         MainFlowedSub.LevelsSub.Table8.Row[k].presence = "hidden";
this will then continue as there will be hundreds of rows.
Any help will be greatly appreciated and I am sure I am making a basic error  so thanks in advance.
j

thanks for your help paul.  Again, really appreciated as I know very little about all this.
Unfortunately its still not working... One thing I am sure of is that I am doing something very basic wrong. So here is my code, I have applied your suggestion above which will cover all my data:
To give an understanding, I have 5 tables of content, each has i amount of rows. and I am running this script to clear/remove all items being displayed.
function hideContent() {
    for (var i=1;i<=5;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table[" + i + "]").presence = "hidden";
    for (var i=1;i<=71;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table8.Row[" + i + "]").presence = "hidden";
    for (var i=1;i<=93;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table9.Row[" + i + "]").presence = "hidden";
    for (var i=1;i<=99;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table10.Row[" + i + "]").presence = "hidden";
    for (var i=1;i<=101;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table11.Row[" + i + "]").presence = "hidden";
    for (var i=1;i<=87;i++)
        xfa.resolveNode("MainFlowedSub.LevelsSub.Table12.Row[" + i + "]").presence = "hidden";
It has to be something to do with my For loops because if I manually insert each line it works perfectly.
Thanks again,
johnny

Similar Messages

  • For loop not working & way to include an external file

    Hi everyone, i am new to java and am having some problems with my program.
    I have a for loop but it doesnt work it completely gets ignored and i have
    no idea why it does that.
    IS there a way that i add another option in the menu to open an external file
    which would be similar to this but it would be for cabinBooking. If so how do
    i do that. if opening an external file is impossible then could you please show me an example of how to extend the booking class.
    Any help would be appreciated.
    Thank you very much
    import java.util.Scanner;
    import java.io.*;
    public class Booking{
    Booking(String bId,     String bName,int bNum){
    bookId = bId;
    bookName = bName;
    bookNum     = bNum;
    String bookId;
    String bookName;
    int     bookNum;
    public double calculateBookingPrice(){
    double cost     = bookNum *     genBookingcost;
    return cost;
    double genBookingcost =     80;
    public void     summary(){
         System.out.println();
    System.out.println("Booking Number is: " + bookId + ", ");
    System.out.println("Booking Made for : " + bookName);
    System.out.println("Cost of booking = $" + calculateBookingPrice());
    System.out.println();
    public static void main(String[] args) throws IOException{
    Scanner     keyboard = new Scanner(System.in);
    BufferedReader charInput = new BufferedReader
    (new InputStreamReader (System.in));
    int bookCount = 0;
    char answer;
    Booking[] bookings = new Booking[6];
    do {
         menu();
         System.out.println("book Count = " + bookCount);
         answer = charInput.readLine().charAt(0);
                   if (answer == 'a' || answer == 'A'){
                        System.out.println("Booking     ID : ");
              String idstring     = keyboard.nextLine();
              System.out.println("Booking     Name : ");
              String namestring =     keyboard.nextLine();
              System.out.println("number of people : ");
              int     ppl     = keyboard.nextInt();
              bookings[bookCount] = new Booking(idstring,namestring,ppl);
              bookings[bookCount].summary();
                        bookCount++;
                   }else if (answer == 'b' || answer == 'B'){
                        System.out.println("Enter printing");
                        bookings[0].summary();
                        bookings[1].summary();
                        // this is the loop that it is ignoring GGRRRR!!!
                   for(int i = 0; i >= bookCount; i++){
                        System.out.println("Counter: " + i);
                        bookings.summary();
                   }else if (answer == 'x' || answer == 'X'){
                        System.out.println("Exiting the programme...");
    System.out.println();
    System.exit(0);
    }while (answer != 'x' || answer != 'X');
    public static void menu(){
         System.out.println("********** Main Menu ***********");
              System.out.println(" A. Make General Booking");
              System.out.println(" B. Print Summary");
              System.out.println(" X. Exit program");
              System.out.println("*****************************");
              System.out.println("Select one of the options above");

    in order to extend the Booking class, you can create anew class like this..
    public class CabinBooking extends Booking
       public CabinBooking( /*String bId, String bName,int bNum .. more args or fewer, or none.. */)
        // add new methods or override ones from Booking
    }

  • IPlanet plugin for WebLogic not working - cannot find function named wl_init

    Hi,
    I have been having this issue for the last two days. It relates to
    IPlanet plugin for WbLogic. Following is the error I get:
    [17/Apr/2003:11:41:26] config ( 2069): func_exec reports: cannot find
    function named wl_init [17/Apr/2003:11:41:26] failure ( 2069):
    Configuration initialization failed: Error running init function
    wl_init: unknown error
    Here is my environment:
    SUN E-250 Server
    Solaris 8.0 with recommended Patch-set
    iPlanet-WebServer-Enterprise/6.0SP4
    Web logic 7 SP2
    Here is how I have edited magnus.conf to include the following lines:
    Init fn="load-modules"
    shlib="/usr/iplanet/servers/plugins/lib/libproxy.so" func
    s="wl_proxy,wl_init" Init fn="wl_init"
    #ServerRoot /usr/iplanet/servers/https-cablevision5
    ..... rest of the file ..........
    As you have noticed I have put everything regrding plugin in one line.
    I have also used various other combinations of breaking this line
    into multiple lines but no use.
    What I have also noticed is that if I change the name of libproxy.so
    to some other arbitrary file name that does not exist, even then the
    error message does not change. So it looks like the library is not
    even being loaded.
    The library file is owned by root and has permissions to read and
    execute for everyone.
    I will really appreciate is I can get any help. I have noticed that
    there are folks who have posted similar problem, no one gave an answer
    to them. Please be more generous this time in furnishing with your
    opinion.
    Thanks
    Jamal

    I will try and be as descriptive as possible. I hate the posts that
    dont give any help.
    Anyway you did not mention anything about your obj.conf configuration.
    Here is how it should look, e.g.:
    Init fn="load-modules" funcs="wl-proxy,wl-init"\
    shlib=/usr/local/netscape/plugins/libproxy.so
    Init fn="wl-init"
    <Object name="weblogic" ppath="*/weblogic/*">
    Service fn=wl-proxy WebLogicHost=myweblogic.server.com\
    WebLogicPort=7001 PathTrim="/weblogic"
    </Object>
    Check the following url:
    http://www.weblogic.com/docs51/admindocs/nsapi.html
    Ok,so you probably have those in there. If not, then please check
    that you have directives in obj.conf and the magnus.conf as well.
    Again the service line should be all one line.
    Next, are you proxying by path or by suffix. I.E. do you want
    everything to go to weblogic or just .jsp. You can configure either
    way. This will change your directive. Specifically ppath means proxy
    by path. To proxy by file extension (or what i call suffix) then look
    at this url for specifics:
    http://www.weblogic.com/docs51/admindocs/nsapi.html#exts (notice the
    anchor in the link)
    Post how it goes...
    a.r.
    [email protected]
    [email protected] (Jamal Najmi) wrote in message news:<[email protected]>...
    Hi,
    I have been having this issue for the last two days. It relates to
    IPlanet plugin for WbLogic. Following is the error I get:
    [17/Apr/2003:11:41:26] config ( 2069): func_exec reports: cannot find
    function named wl_init [17/Apr/2003:11:41:26] failure ( 2069):
    Configuration initialization failed: Error running init function
    wl_init: unknown error
    Here is my environment:
    SUN E-250 Server
    Solaris 8.0 with recommended Patch-set
    iPlanet-WebServer-Enterprise/6.0SP4
    Web logic 7 SP2
    Here is how I have edited magnus.conf to include the following lines:
    Init fn="load-modules"
    shlib="/usr/iplanet/servers/plugins/lib/libproxy.so" func
    s="wl_proxy,wl_init" Init fn="wl_init"
    #ServerRoot /usr/iplanet/servers/https-cablevision5
    ..... rest of the file ..........
    As you have noticed I have put everything regrding plugin in one line.
    I have also used various other combinations of breaking this line
    into multiple lines but no use.
    What I have also noticed is that if I change the name of libproxy.so
    to some other arbitrary file name that does not exist, even then the
    error message does not change. So it looks like the library is not
    even being loaded.
    The library file is owned by root and has permissions to read and
    execute for everyone.
    I will really appreciate is I can get any help. I have noticed that
    there are folks who have posted similar problem, no one gave an answer
    to them. Please be more generous this time in furnishing with your
    opinion.
    Thanks
    Jamal

  • For Loop not acting correctly...

    Hi everyone,
    I have this For Loop in JavaScript which is not working correctly and I really have no idea why it is acting like so... I don't if anyone has already encountered this issue and I'd like to know if there's a fix for this or what am I doing wrong...
    I have a normal for until the count is done like this -> for (var c = 0; c < frmResourceReq.instanceManager.count; c++){}
    If I put this loop with only a messageBox it will do it right, so if the count is 1, it will do it once, if the count is 2 it will do it twice...
    The loop with the actual code is not acting like so.. if the count is 1, it will do it once, but if the count is 2 it will do it once also...
    At 1 point it was acting weird so I decided to make the condition with  'c <= frmResourceReq.instanceManager.count'
    Now if the count is 1, it is not working because it crashes once it execute it the second time, but if I have a count of 2 or 3 it will execute the right number of times...
    Does anyone have any idea what is creating this issue, seems like I really can't figure it out.
    Thanks for your time.

    Hi,
    to avoid that the loops condition is unnecessarily calculated again for every iteration it's recommended to save the condition in a variable first.
    for (var c = 0, n = _frmResourceReq.count; c < n; c += 1) {
        //code to execute
    As the instance count of iteration frmResourceReq may change already while the loop runs it can end with unexpected results.

  • Spotlight not working within program. Please HELP!

    Spotlight not working within programs. Cannot not locate files on network volumes.
    For example: if I am using Photoshop or MultiAd Creator Pro, and want to open a file, I will do File>Open and  use spotlight in the "Open" dialog, and it doesn't ever find anything? I can see the files but if I search it fails to locate. Same thing happens if I try to "Place Graphic" In MultiAd and other programs. It appears to be a universal issue regardless of program.
    I tried re-indexing spot light via the system preferences (privacy, drag in volume, remove volume). I also tried re-indexing via terminal.
    I tried mounting the volumes via afp, smb, cifs and nothing works!!
    This issue is handicapping production.
    Anyone??
    Thank you in advance RR

    Spotlight alternatives.
    EasyFind – Spotlight Replacement
    Find Any File

  • Javascript Foucs is not working In IE

    I have tabular in in APEX page
    In tabular form on one textbox onblur="setfocs();"
    And i set focus on button using javascript as below.
    <script type="text/javascript">
    function setfocs()
    document.getElementById('add_row_id').focus();
    </script>
    Javascript in HTML header part of the page.
    'add_row_id' is button id.
    That is working fine in Firefox but not working on IE and Chrome.
    Can any one have idea?
    Thanks

    Hi,
    This is a documented issue. Please see http://www.mkyong.com/javascript/focus-is-not-working-in-ie-solution/
    Cheers,
    PS: Many more resource on the subject here
    Edited by: Prabodh on Jul 31, 2012 3:47 PM

  • Applet work well in appletviewer but do not work within browser

    hi, i created an applet that works well in appletviewer,but it does not work within a firefox browser, it issue a message: java.security.AccessControlException: access denied (java.io.FilePermission imgDir/vsam.jpg read). What can i do to solve this issue please ?

    sign the applet, use doprivileged and trust the applet when you open it.
    Use htmlconverter in jdk/bin folder to convert you applet so it uses
    object tag instead of applet so IE won't try to run it with msjvm.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and reply 18 for the java class file using doprivileged
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • Save for web not working in Photoshop element 6

    Save for web not working in Photoshop element 6. I am using Mac os x version 10.5.8   Anyone know how to fix that please tell me. Thanks

    I just copy the preferences from my computer for you to see what are shown about adobe
    file:///Users/raymondsmith/Library/Preferences/Adobe/
    file:///Users/raymondsmith/Library/Preferences/Adobe%20Illustrator%20CS2%20Settings/
    file:///Users/raymondsmith/Library/Preferences/Adobe%20Photoshop%20CS2%20Paths
    file:///Users/raymondsmith/Library/Preferences/Adobe%20Photoshop%20CS2%20Settings/
    file:///Users/raymondsmith/Library/Preferences/Adobe%20Photoshop%20Elements%206%20Paths
    file:///Users/raymondsmith/Library/Preferences/Adobe%20Photoshop%20Elements%206%20Settings /
    file:///Users/raymondsmith/Library/Preferences/AdobeUM/
    file:///Users/raymondsmith/Library/Preferences/AppleWorks/
    file:///Users/raymondsmith/Library/Preferences/ByHost/
    file:///Users/raymondsmith/Library/Preferences/CD%20Info.cidb
    file:///Users/raymondsmith/Library/Preferences/CDDB%20Preferences
    file:///Users/raymondsmith/Library/Preferences/cfx%23FBSxPfw
    file:///Users/raymondsmith/Library/Preferences/com.adobe.acrobat.90.sh.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.Acrobat.Pro7.0.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.acrobat.sh.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.Acrobat.Uninstaller.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.Adobe%20Help%20Viewer.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.ami.installer.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.bridge2.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.mediabrowser.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.PhotoshopElements.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.Reader_ppc_9.0.plist
    file:///Users/raymondsmith/Library/Preferences/com.adobe.Reader.plist
    file:///Users/raymondsmith/Library/Preferences/com.aol.aim.plist

  • ExportAsFDF javascript method is not working with Reader 10.1.1

    Hi,
    I have pdf document in which I have applied all Extendend Reader Rights. And now when I am trying to exports alll annotation in fdf with Reader 10.1.1 then it is faling to export. However it is working fine with Reader 10.0.0. Looks like this is broken in later version of 10.0.0.
    Please let me know if any alternative solution is there to export all annotation in fdf file thru code.
    Regards,
    Arvind

    I would open a formal support ticket with our developer support folks.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Sun, 27 Nov 2011 22:48:35 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: exportAsFDF javascript method is not working with Reader 10.1.1
    exportAsFDF javascript method is not working with Reader 10.1.1
    created by arvindg007<http://forums.adobe.com/people/arvindg007> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4049525#4049525

  • [svn:fx-trunk] 13257: Fix for @inheritDoc not working on a setter, but works on a getter

    Revision: 13257
    Revision: 13257
    Author:   [email protected]
    Date:     2010-01-04 10:49:13 -0800 (Mon, 04 Jan 2010)
    Log Message:
    Fix for @inheritDoc not working on a setter, but works on a getter
    QE notes: None.
    Doc notes: None
    Bugs: SDK-24727
    Reviewed By: Paul
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24727
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

    steabert wrote:
    Hi,
    I had a similar problem with my Dell Latitude E4310, and apparently also the E6410, E6510.
    The solution for me was to add the following line to /etc/modprobe.d/modprobe.conf:
    options snd-hda-intel model=dell-s14
    I tried that, unfortunately it does not work with this chipset. I do get a different set of channels though but it still cannot record anything. Maybe this chipset is too "new" for alsa. The latest release dates back from the end of January. Support for it is explicitly stated in the changelog to 1.0.24 but perhaps the recording part of it slipped through the cracks. ALSA bug tracking system seems quite closed.

  • Brand new 15" MacBook Pro Retina - unplugged from Thunderbolt Display and Keyboards today find keyboard alpha-numerics not working; except the function keys, delete key, tab key, command/ctrl/shift/alt/fn and arrow keys; and 7/8/9/u/o/j/l nudge cursor

    Brand new 15" MacBook Pro Retina - unplugged from Thunderbolt Display and Keyboards today find keyboard alpha-numerics not working; except the function keys, delete key, tab key, command/ctrl/shift/alt/fn and arrow keys; and 7/8/9/u/o/j/l produce cursor nudges.

    It's a new machine - and the Thunderbolt Display is meant to work with it. You need to just make an appointment at your local Apple Store and have them fix whatever is wrong.
    If you like, you could always try a SMC reset and a PRAM/NVRAM reset to see if either of those will get your keyboard back in working order...
    Clinton

  • Logging for AS not working

    Hi,
    In sm21, I cannot see any logs from the AS. I can only see the ones from CI.
    Any ideas how to solve this issue ?
    Anything is welcomed,
    Thanks.

    Hello
    This thread was locked for the following reasons:
    1) the topic does not relate to PI. This forum is for PI technical issues only.
    2) it is against forum rules to post the same issue on multiple forums - Re: Logging for AS not working
    Regards
    Moderator

  • ICloud for pc not working tried everything

    iCloud for pc not working tried everything ( uninstall - reinstall - delete files - old versions ) nothing helps it just downloads a couple of photos and off again my iPhone uploads perfectly as all the pics goes to the iPad seamlessly, Please Help i'm on windows 8.1 x64, Thanks

    I think that the card reader may in fact be defective, but it just doesn't make sense if I have already used it fine before. I've tried everything on this Apple support page, thank you though.
    Does anyone have any suggestions?

  • Skype 6.3 upgrade for Mac not working

    [Topic title updated by moderator to be more descriptive. Original topic title was: "Skype upgrade for Mac not working"]
    BE WARNED - just because you are being asked to upgrade your Skype, it does not mean it will work on your machine. I am a fairly regular user of Skype and this morning was unable to log-in, being told that I needed to upgrade. I did so to 6.3.0.602 but I was unable to log-in once the software had downloaded. After some research on the forums and finally a text chat with Support, I was told that Skype 6.3.0.602 requires a Mac OSX of 10.9 or above - I have 10.5.8
    "So what can I do", I asked the tech support. The answer is nothing (unless I get new OS X software) - there is no Skype software programme that supports my operating system and no timeframe for when it might be available.
    Huh? That's right. It's just not available. So for now, users with less than OS X 10.9 will be unable to use Skype when they are instructed to upgrade. It really doesn't make sense. But just so you know....

    jessicaed wrote:
    BE WARNED - just because you are being asked to upgrade your Skype, it does not mean it will work on your machine. I am a fairly regular user of Skype and this morning was unable to log-in, being told that I needed to upgrade. I did so to 6.3.0.602 but I was unable to log-in once the software had downloaded. After some research on the forums and finally a text chat with Support, I was told that Skype 6.3.0.602 requires a Mac OSX of 10.9 or above - I have 10.5.8
    "So what can I do", I asked the tech support. The answer is nothing (unless I get new OS X software) - there is no Skype software programme that supports my operating system and no timeframe for when it might be available.
    Huh? That's right. It's just not available. So for now, users with less than OS X 10.9 will be unable to use Skype when they are instructed to upgrade. It really doesn't make sense. But just so you know....
    Please look at the top of the community page, and you will find a box "Search:". Write your problem here "Upgrade not working" and see what crops up. Most likely you will be taken somewher like here: http://community.skype.com/t5/Mac/quot-We-ve-signed-you-out-because-your-using-an-outdated-version/m...  
    Here you will read that the latest versions of Skype will not work on some of the versions of MacOS, and that PPC requires one version, Leopard another, Snow leopard another, Mountain Lion another. They are indoctrinated with a stamp in their forehead to enforce their congregation of true believers to install the latest with all "security fixes" or death is looming. They are not used to software that is 2 years old. 
    So, with Mac, we have different operating systems and different sets of libraries - and things may go belly up if you upgrade - a OS feature is done differently, a libary has been placed inside the OS, and is no longer needed - and if you try to use it, you will be trapped.
    Install the latest version that works for your Mac, and make sure to freeze this. Update the "info.plist" file and tell Skype that you use their latest should they pry. As long as it works, do not change anything!
    And make the change to stop Skype from checking every time you start.

  • Default them for Mac not working firefox 4 beta 1

    Default them for Mac not working Firefox 4 beta 1
    == This happened ==
    Every time Firefox opened
    == I first opend FF4 beta 1 for the first time

    '''Ritrup''':
    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

Maybe you are looking for