Hide all subforms by using a loop function

Hello

I have a base control that displays or hides a subform if a box has been checked or not.

If (checkbox.rawValue == 1) {}

This.Presence = "visible";

}

else {this.presence = "hidden":}

}

Now, this check box controls the visibility of several subforms, so I would have a function in a script object that I can call each subform calculate event.

I named the script object "common good".  At first, I tried just an if/then statement as above, but "this" is meaningless in function.

So I resorted to the creation of a loop.  I tried to do a test loop to hide all subforms, but it does not work.   Once I have run, I can add an if/else statement that allows to hide currentElement if the box is checked, but for simplicity I didn't at that point.

Any tips?  I derived this loop an example for the mistakes of control loop of Niall O'donovan.

function HideSubforms (myParentObject) {}

Declaring variables

var allChildElements;

var intNumElements;

var currentElement;

var i;

Get all children nodes of the parent element

allChildElements = myParentObject.nodes;

Total number of items in the object

intNumElements = allChildElements.length;

Loop through all child elements

for (i = 0; i < intNumElements; i ++) {}

currentElement = allChildElements.item (i);

If (currentElement.className = "subform") {}

currentElement.presence = 'hidden ';

}

}

} / / End of the function

You must pass the subform to root as an argument to this function.

Common.HideSubforms (this.parent.parent);

On my screen, I was calling this function on the initialize event of the TextField1 inside Subform2.

I need to go (Page1) rootnode property to this function to work.

Thank you

Srini

Tags: Adobe LiveCycle

Similar Questions

  • What is the function to hide all pages in a form?

    Hello

    What function I could use to hide all pages in a form?

    For example: when a user click on a button, I want to hide all the pages of the form.

    Thank you.

    Hello

    This works because the script in parentheses () is re-run until the value of i is 25.

    The loop is built in three parts:

    var i = 1;     He declares the variable i and sets with an initial value of 1

    I have<=25;     this="" is="" a="" test,="" the="" loop="" runs="" until="" i="" is="" greater="" than="">

    i ++ which increase the value of i by 1 every time the loop is executed

    When you put is all together that...

    for (var i=1; i<=25; i++)
    {
         // script in here will run 25 times
    }
    

    If you use a hidden for the number of pages field, you must set this default value at design time (object > range of value). So the for statement would look like this:

    for (var i=1; i<=totalNumberPages.rawValue; i++)
    

    You don't need to change the variable i of all.

    Hope that helps,

    Niall

    Ensure the dynamics

  • How to hide all instances of subform (via a click event of the button) except the last instance.

    When my form is rendered, it can contain multiple 'case' of a subform full page.  So basically, I have a subform labeled "Info" that spans a full page. Depending on how the form is used when a new instance is added to the document it essentially new creates an entire page.

    What I'm trying to hide all instances of subform ("Info"), except the LAST instance that is always on the last page.

    Theoretically, by hiding all previous subform instances (for example, 1-4) and keep only the last instance, it will reduce the number of pages 5-to-1.

    Hope it makes sense.

    SO I guess I need a way to get the number of instances of complete subform, then hide all instances, but the last instance (via a button click).

    Thanks in advance for your help.

    I belive I've thought about it.

  • Hide all instances of the subform with a single line of javascript

    Is it possible to hide all instances of a subform with a single line of javascript?  I'm looking for something like this:

    repeatingSubform [*] .its presence = "hidden";

    but which caused the designer...

    Or do I have to loop through all instances of the subform and disable individually each of them?

    Thank you

    Elaine

    You must disable them individually

    Paul

  • When I use the library function node call in real time, is loaded only once for all or load the DLL whenever it is called?

    When I use the library function node call in real time, is loaded only once for all or load the DLL every time when it is called?

    I have a critical application in real time, in which I use a piece of DLL function developed in C++.  It is ok?  Make sure any senior developer?

    Thank you in advance.

    The user interface thread is the thread that is used to update the user interface. It's slow. And it's supposed to be that way because humans are slow.

    The call library function node can be configured as this thread to use in the configuration for it dialog box. Please visit the LabVIEW documentation on how to do this.

  • I installed lightroom on a new computer (windows 10) cc. I copied all of my original photos on a hard drive and them imported by adding them on the new computer using the import function. I have a catalog update saved on thehard d

    I installed lightroom on a new computer (windows 10) cc. I copied all of my original photos on a hard drive and them imported by adding them on the new computer using the import function. I have a catalog to date backed on thehard drive and have tried to insert into the new folder to lightroom. Unfortunately none of my changes, collections etc. seem to be present on the new computer. I still work lightroom with any changes on the old computer where all the photos. Help

    He seemed to have solved this problem - the catalogue of the old computer has been saved as a zip file. Once extracted, it could be used as the primary catalog for lightroom on the new computer

  • How to hide all the empty fields on a page?

    Hello

    I want to hide all the empty fields but to exclude tables as it messes up the table. He hides this empty cell with borders and the table does not look right.

    My script below works currently it hides all the empty fields on this page.

    Is it possible to exclude on the tables?

    Thanks to all in advance.

    function hideFields (myParentObject) { }

    var allChildElements;

    var intNumElements;

    var currentElement;

    var j;

    var temp;

    //Get the parent all child element nodes

    allChildElements = myParentObject.nodes;

    //Total number of items in the object

    intNumElements = allChildElements.length;

    //Loop through all child elements

    for(j=0; j< intNumElements; j++){

    currentElement = allChildElements.item (j);

    //If the element is another subform which we will call the new function recusively

    If(allChildElements.item (j) .className = "subform") { }

    //if (currentElement.layout = "table") {}

    //else{

    //}

    other If(currentElement.className = 'subformSet') { }

    //If the objects are fields, then we'll want to hide their

    other If(currentElement.className = 'field') { }

    //Check to see if the field is a button - don't count buttons

    temp = currentElement.name;

    if (temp.substring(0,6) !== "Button"){

    If (currentElement.rawValue == "" | "") ( currentElement.rawValue == null) { }

    currentElement.presence = 'hidden';

    //Check Jugendherberge exclusion - boxes option

    other If(currentElement.className = 'exclGroup') { }

    / / hide the exclusion group and not the individual radio buttons

    If (currentElement.rawValue = "") { }

    currentElement.presence = 'hidden';

    { } / / end of loop for

    { } / / end function

    Hello

    A table has a class name of the subform, but will have a property of page layout with the value of "table."  If you find one of these, then you sweep that subform.

    But you code seems to have commented, that didn't work for you?

    Concerning

    Bruce

  • hide the buttons outside of the loop for

    Hello

    I'm trying to hide listbuttons on mode full-screen. But only the last cache.

    How to hide the total buttons on mode full-screen.

    function playlistLoaded(e:Event):void {
    
              xmlPlaylist = new XML(urlLoader.data);
              //trace(xmlPlaylist.vid[0].@src);
    
        for (var i:int=0;i<xmlPlaylist.vid.length();i++) {
                                  var listbutton:Button = new Button();
                                  listbutton.x = 482;
                                  listbutton.y = i * 19 + 1;
                                  listbutton.width = 197;
                                  listbutton.height = 20;
                                  listbutton.label = xmlPlaylist.vid[i].attribute("desc");
                                  listbutton.name = xmlPlaylist.vid[i].@src+"__"+i;
                                  listbutton.addEventListener(MouseEvent.CLICK, playVidlist);
                                  addChild(listbutton);
              }
    }
    
    //==================FullScreen SetUp ========================
    //===========================================================
    
    controlBar.fullscreen_btn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
    controlBar.normal_btn.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
    stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
    
    function fullscreenOnClicked(e:MouseEvent):void
    {
         stage.displayState = StageDisplayState.FULL_SCREEN;
    }
    
    function fullscreenOffClicked(e:MouseEvent):void
    {
         stage.displayState = StageDisplayState.NORMAL;
    }
    
    function onFullscreen(e:FullScreenEvent):void
    {
         if (e.fullScreen)
         {
             controlBar.fullscreen_btn.visible = false;
             controlBar.normal_btn.visible = true;
             //listbutton.visible = false;
             removeChild(listbutton);
    
             controlBar.x = (Capabilities.screenResolutionX - 480) / 2;
             controlBar.y = (Capabilities.screenResolutionY - 116);
             vidDisplay.height = (Capabilities.screenResolutionY);
             vidDisplay.width = vidDisplay.height * 4 / 3;
             vidDisplay.x= (Capabilities.screenResolutionX - vidDisplay.width) / 2;
         }
         else
         {
             controlBar.fullscreen_btn.visible = true;
             controlBar.normal_btn.visible = false;
             //listbutton.visible = true;
              addChild(listbutton);
    
             controlBar.x = 0;
             controlBar.y = 244;
             vidDisplay.width = 480;
             vidDisplay.height = 360;
         }
    
    

    One way to do it would be to place all the objects button inside an object (MovieClip or Sprite) container and then make the visible/invisible container with a single line of code.

    Otherwise, just as you have used a loop to create the buttons, you need a loop to hide each of them.  If you store each button in a table that you create, then you can use this array to loop through them all and make them visible/invisible individually.

  • Can someone help me with a Code that allows you to hide all but the first few fields when the form opens

    My form has a section (subform) on top that is always open and then underneath it is dynamic and I want some subforms and sections to open based on users to input. I use action Builder to open the screen and have all the fields that are hidden, but I have too much subforms and must hide individually all subforms. Is there a code that allows you to hide all fields for me when the form opens, and then I can use action Builder to open just what I need based on a drop-down list button or radio?

    Thank you!

    Hello

    Using LockAllFields of Paul's example, you could place the JavaScript code within the root node docReady event (normally 'form1').

    Please note that the last line is the presence of one of the subforms to visible return. Let's call it ShowThisSubform.

    // Declare some variables
    var allChildElements;
    var intNumElements;
    var currentElement;
    var j;
    
    // Get all the child nodes of the parent element (the root node/"form1")
    allChildElements = this.nodes; // "this" will use the element where the script is placed
    
    //Total number of element in the object
    intNumElements = allChildElements.length;
    
    // Loop through all the child elements
    for (j=0; j< intNumElements; j++) {
         currentElement = allChildElements.item(j);
         // If the element is a subform we'll hide it
         if (allChildElements.item(j).className == "subform") {
              allChildElements.item(j).presence = "hidden";
         }
    }
    
    // Show one of the subforms
    ShowThisSubform.presence = "visible";
    

    Niall

  • Problem with creation of table of references notifier by using a loop

    Hi all

    I am attaching two try_ChannelsOn2ndMonitor.vi screws out of the random values to four graphics and ChannelGraphsOnSecondMonitor2.vi receives these values through an array of references Notifier and refers to four corresponding graphics. Essentially, the graphics in the two screws are supposed to - and do - displays the same values.

    As a first step, using a loop to create the table of references of the notifier, I was unable to get the four graphs in the sub - VI to produce the desired values. They showed only the values in Figure 4 in the main VI. I tried to use the indexing, and then I tried using Shift Registers associated with the function of 'Building the table', but none of these methods worked. Finally, the only method that worked was that you see in try_ChannelsOn2ndMonitor.vi, which was to create four reporters simultaneously and combine them using 'building the table '. My question is: why is it not possible to create the array of references notifier by using a loop and always get the correct functionality? I spent a few hours I wondered about this.

    All of the comments related to my use of the notifiers, notifying bays or the reference of VI in the Structure of sequence are also appreciated. The structure of sequence is only there because the sub VI must be taken out of a second monitor; I essentially disabled it by setting the FP. State to 'Standard '.

    Thank you!

    Nemanja

    The table is still the order of the references notifier - so that you know the correct order.

    When you say "it will continue execution as soon as one of the notifications is received", do you know if it means he will send this notification for each registrant, or just for the appropriate warning system?

    I'm waiting on multiple notification - if you expected to return (and continue to run) once it receives all notifications I don't think it's what he does based on my understanding of the documentation.

    OK, now that I have had a good look, I probably slightly different framing the code - I propose the Subvi out of the while loop and then put a while loop around the code in the Sub - VI. Something like this:

    That's what I wanted to say to have individual loops for the Subvi - terminal error is connected to the judgment for loops (and thus the VI) stop running when you release the notifier. That should remove the need for static VI reference as the VI remains before the end of your first level VI - then you can move your code of positioning inside the Subvi.

    Using the sequence of structures here as you have done to make sure that the code block happens before your start of loop is very good, another common method is to wire the error out in (or at) the border of the loop - in a more complicated application, you would maybe put this code in a State 'init' of a state machine.

  • Failure of the assertion when using Labview ActiveX functions to communicate with the dll

    Hello

    I'm looking for suggestions and tips about the following error that I get when I use .NET Labview functions to communicate with the dll written in .NET environment. I just need a starting pointer on where can I search for the origin of this error. I am a newbie in. NET.

    I am also attaching the .vi I use, if this is of any help. All suggestions are welcome!  Thank you.

    The origin of the error found after studying the examples provided by the OR .NET. The callback function had to be moved out of the loop, which solved the problem.

  • hide all cursors

    Hi all

    I use about 16 sliders on my chart.

    At some point, I want to hide all the sliders.

    Is it possible to define the position of all the cursors in one go rather than the adjustment of each slider position individually?

    Thank you

    Ritesh

    We seem to be talking about several different issues here.

    The original question was about how to hide all the sliders if there was a way to do it en masse, or if you had to use a loop. This question has already been answered several times: you must use a loop.

    The second question was to determine if a user clicking on the chart indicates that the user select a cursor. Who answered also by the fact that you use the event cursor Grab.

    The third question is how to distinguish between a user clicking on a field, which indicates that they want to select a track, and the user was just trying to catch a slider. I have provided an answer to this in response to #7, but do not know if there is a more effective method. I'd like to hear if it is good.

  • Scripts to show/hide all all buttons

    First of all, thanks to William Van Weelden and Peter Grainge for existing scripts ' show all / hide all.  Peter, I accessed them from your web site (Scripts for Twisties, show all / hide all buttons print and).  I was able to get two buttons of William script to work.  I wasn't able to get the script "button toolbar unique show / hide" to work.  Peter, your website says that the script works with HR 8 and 9.  I'm hoping to use it with HR 10; I tried without success.  What's someone to update this script for HR 10?  I would really like to be able to use that one in the toolbar.  I also experimented in vain to try to call WIlliam ShowHide and ShowAll functions since the Action tab of the custom toolbar window, accessed from the WebHelp skin Editor.  Open to suggestions.  Thank you!

    You can try the toolbar scripts: http://www.wvanweelden.eu/product/webhelp-pro-toolbar-scripts

    Are you running the WebHelp locally on Chrome? These buttons only work on Chrome when aid is placed on a web server.

  • Check box to hide the subform does not

    I have what I think it's a pretty simple dilemma. I have a check box that will be used to show/hide a subform when checked/unchecked.

    However, any code that I have written seems to work. The box is an object in page1 and not wrapped in subforms. The subform has simply two inside text fields. the properties of the box have been defined for bind values are 1 for archiving, 0 for uncontrolled. The fields in the subform exploit the value "invisible" because I don't want to see these fields in the form (unless the box is checked).

    My code is:

    Form1. Page1.newspaper::click - (JavaScript, client)

    If (this.rawValue == 0) {}

    xfa.resolveNode ("form1..") Presence Page1.Newspaper_Subform") ="hidden ";

    }

    else {}

    xfa.resolveNode ("form1..") Presence Page1.Newspaper_Subform") ="visible ";

    }

    This code is located in the under JavaScript click event. The form is saved in a dynamic XML form to Adobe. I use Adobe Pro XI and LC ss4

    I can do this work in the generator of the action, but I want the subform back to hidden when unchecked.

    Obviously, a beginner in Java script, ideas/help you might have would be appreciated.

    What exactly is the problem?  Is this not not showing or hiding not when you change the box?  According to your description, you have two text boxes the invisible value but your script changes only the presence of the subform.  If you show the subform without changing the presence of text boxes, they will remain invisible.  If you want all show/hide together, set the presence visible text boxes and simply change the subform presence as you are now.

  • Using code loop hard

    Hey all, I could use some help with this.

    If my current auto code adjusts and resizes a group of text.

    I am looking to convert it into a loop so I can do generate more text fields without breaking.

    and I'm scratching my head on how to structure.

    addEventListener (Event.ENTER_FRAME, patchSpacingFun);

    function patchSpacingFun(event:Event)

    {

    patTexArr1 ['pp2'] .x = patTexArr1 ["pp1"] .width + patTexArr1 ["pp1"] .x;

    patTexArr1 ['pp3'] .x = patTexArr1 ['pp2'] .width + patTexArr1 ['pp2'] .x;

    patTexArr1 ["pp4"] .x = patTexArr1 ['pp3'] .width + patTexArr1 ['pp3'] .x;

    patTexArr1 ["pp5"] .x = patTexArr1 ["pp4"] .width + patTexArr1 ["pp4"] .x;

    patTexArr1 ["pp6"] .x = patTexArr1 ["pp5"] .width + patTexArr1 ["pp5"] .x;

    patTexArr1 ["pp7"] .x = patTexArr1 ["pp6"] .width + patTexArr1 ["pp6"] .x;

    patTexArr1 ["pp8'] .x = patTexArr1 ["pp7"] .width + patTexArr1 ["pp7"] .x;

    patTexArr1 ["pp9'] .x = patTexArr1 ["pp8'] .width + patTexArr1 ["pp8'] .x;

    patTexArr1 ["pp10"] .x = patTexArr1 ["pp9'] .width + patTexArr1 ["pp9'] .x;

    patTexArr1 ['pp11'] .x = patTexArr1 ["pp10"] .width + patTexArr1 ["pp10"] .x;

    patTexArr1 ["pp12'] .x = patTexArr1 ['pp11'] .width + patTexArr1 ['pp11'] .x;

    }

    Here's basically what I started for the loop

    its supposed to be those of the PatchLims


    var patTexArr1:Array = new Array();

    for (var i: int = 0; i < patchLims; ++ i)

    {

    }

    Thank you

    If patTexArr1 is a movieclip, use:

    var patchLims:int = 11;

    for (var i: int = 1; i

    {

    patTexArr1 ["pp" +(i+1)] = patTexArr1 ["pp" + i] .width + patTexArr1 ["pp" + i] .x;

    }

Maybe you are looking for

  • NOR-USI backward compatibility?

    Hello I have some computers deployed with the CVI and NOR-USI 1.9 2010SP1 runtime installed.  The development of PC has CVI and NOR-ICU installed 1.9 2010SP1, so the development of PC-based applications will work perfectly on desktop deployment.  Say

  • I have a Canon AE1 progra. What I use for this suit a new EOS Reber T3I?

    The goal of camer Canon AE1 Program fit the EOS or EOS Rebel T3I cameras?

  • upgrade hp2000 WiFi laptop

    I have a hp2000-412nr and im thinking of upgrading my wireless network card. What are the brand and the model compatible hardware that can be used?

  • Blue screen of death analysis guide

    This guide is intended to help an end user to analyse and understand what may have caused their computers to break and cause a blue screen of death. This guide is an information guide and help you to analyze and try to find what caused the crash and

  • No access to the system restored files even though I'm an administrator

    I recently had to restore my laptop to its factory settings. I have created a backup of my external hard drive and files on and crossed the System Restore Wizard to get it all back again. However, I now get an error message on all my files saying: '