How to remove all pages from layout? (except Master Page)

Geetings Experts:
I'm implementing additional security measures into my 'initialze' event, where I'll check some global variables and render the file unreadable if needed.
Which object and properties do I access to remove all my pages from the form?
I would like to createa a function that removes all the sub pages, leavning only the Matster Page, enable a label in the MasterPage and save itself.
I searched for xfa.layout and Page[n].remove() methods but cannot find any reference to these.
.presence = "hidden", fulfills my purpose but the pages remian visible and I need for a clean solution no pages are visible.
I'm advanced in C# but a novice in LC JavaScript, so any comment, reference or code snipet will be greatly appreciated
Thank you for your time,
Ivan A. Loreto – Computer Education Technician
LOMA LINDA UNIVERSITY | School of Allied Health Professions - Department of Physical Therapy
[PDF Development Platform]
Windows XP SP3
Acrobat Pro 9
LifeCycle Designer ES 8.2

Hi Ivan,
The particular syntax of Javascript in LC Designer is different from that used in Acrobat and different (as I understand it) from core javascript and other applications. There are several free guides on the Adobe web site which cover Acrobat and LC:
http://www.adobe.com/go/learn_lc_scriptingBasics
http://www.adobe.com/go/learn_lc_scriptingReference
http://www.adobe.com/go/learn_lc_formCalc
http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Refer ence.pdf
http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform.pdf
And a very handy resource (it goes back to version 6, but is still applicable):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
JP Terry's book on LC Forms is very good and we use www.pdfscripting (which is a subscription service). If you are going to be doing a lot of LC Designer work, these may be of help.
I am not a coder, so I going to try and work through your script. Bear with me if you already have this sorted...
The script looks ok and you are using the resolveNode method correctly. Seeing topmostSubform in the resolveNode indicates that you imported an existing document into LC. This is fine, but sometimes it restricts some of the functionality.
For starters I think that mPg is returning null. You can use the following in your script to see what is happening (debugging) and then comment it out:
console.println("mpg: " + mPg);
Then when previewing hit control+J to bring up the javascript console, then will show the value of mPg when that script executes.
Try deleting the SOM up to #pageSet:
var mPg = xfa.resolveNode("#pageSet.MasterPage1");
The javascript console will show you when the script is working.
In relation to the loop, I would advise a few changes:
for (var i=1; i <= xfa.layout.pageCount(); i++)
     var vPage = ("xfa.form.topmostSubform.Page" + i).toString();
     //console.println("vPage: " + vPage);
     var curPage = xfa.resolveNode(vPage);
     curPage.presence = "hidden"; 
}//next page
There are a few things here:
I would declare i as a variable, not an integer (not sure if it makes a difference);
I would use pageCount rather than numPages and then <=;
There was an extra ; at the end of the loop declaration;
I would break the script into steps and get the full SOM of the page as a variable first and then resolveNode that variable;
You don't need to go to the current page;
I tend to name master pages with a capital "P" and pages with a small "p". Personal preference, but it can make tracking script easier.
Have a crack off that and hopefully you can get it to work,
Niall
ps another tip, if you want to reference an object in script. First click on the object you want to script for and then scroll (or click on the master page) for the object you want to reference. Click inside the script editor and then when you move the mouse back into the form, press and hold Control, this will turn the mouse into a "V". When you click on the object you want to reference it will insert the SOM into the script. If it needs the resolveNode it will automatically put that in for you. Holding Shift and Control will insert a fully resolved node.

Similar Messages

  • How to make button to format a HardDrive or USB, How to remove all files from folder, and How to delete a process in listbox with a textbox?

    Hello!
    Here's the question with explaniation: How can i format the USB or Drive by clicking a button what's meant for it?
    and the second question what's also in vb.net: How can i remove all files from folder ? 
     Here's the Look of program: *
    Using the PC button, it will delete the free space of the PC, do you guys/girls know where it's location?

    Example Code:
    Imports System.Runtime.InteropServices
    Imports System.IO
    Public Class Form1
    Dim CBoxDrives As New ComboBox
    WithEvents FButton As New Button
    <DllImport("shell32.dll")> _
    Private Shared Function SHFormatDrive(ByVal hwnd As IntPtr, ByVal drive As UInteger, _
    ByVal fmtID As UInteger, ByVal options As UInteger) As ULong
    End Function
    Private Enum SHFormatFlags As Integer
    SHFMT_ID_DEFAULT = &HFFFF
    SHFMT_OPT_FULL = &H1
    SHFMT_OPT_SYSONLY = &H2
    SHFMT_ERROR = &HFFFFFFFF
    SHFMT_CANCEL = &HFFFFFFFE
    SHFMT_NOFORMAT = &HFFFFFFD
    SHFD_FORMAT_FULL = 0 ' full format
    SHFD_FORMAT_QUICK = 1 ' quick format
    End Enum
    Private Sub FButton_Click_1(sender As System.Object, e As System.EventArgs) Handles FButton.Click
    If CBoxDrives.Text = "" Then
    MsgBox("No Drive Selected")
    Exit Sub
    End If
    Dim Iresult As ULong = SHFormatDrive(CType(Me.Handle.ToInt32, IntPtr), CUInt(Asc(CBoxDrives.Text.Substring(0, 1)) - Asc("A")), CUInt(SHFormatFlags.SHFMT_ID_DEFAULT), 1)
    End Sub
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.Size = New Size(200, 100)
    With FButton
    .Size = New Size(50, 25)
    .Location = New Point(5, 5)
    .Text = "Format"
    End With
    Me.Controls.Add(FButton)
    With CBoxDrives
    .Size = New Size(50, 25)
    .Location = New Point(75, 5)
    .DropDownStyle = ComboBoxStyle.DropDown
    End With
    Me.Controls.Add(CBoxDrives)
    Dim DrivesFound As Integer = 0
    Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
    Dim d As DriveInfo
    For Each d In allDrives
    If ((d.DriveType = DriveType.Fixed) Or (d.DriveType = DriveType.Removable)) AndAlso Environment.GetEnvironmentVariable("SYSTEMROOT").StartsWith(d.Name) = False Then
    CBoxDrives.Items.Add(d.Name)
    DrivesFound += 1
    End If
    Next
    CBoxDrives.SelectedIndex = DrivesFound - 1
    End Sub
    End Class

  • How to remove all calendars from OSX

    I have a MBP with OSX Lion. iCloud all set up.
    I want to delete all local calendars from MBP so I can run a sych with iCloud so I don't duplicate events.
    How to I delete all local calendars so my iCloud sync stays clean.
    I'm surprised that in addition to options to merge events, they did not have an option to delete current local events and overwrite with iCloud.
    Thanks..
    PS. I think this can be done by deleting some library files, but I would prefer to hear from someone before attempting this solution.
    Thanks,

    If you sync your calendars in iCloud, it will remove them from the computer. You don't have the option to keep them local.
    To verify this, quit iCloud. This will be done by signing out. It should tell you that your calendars won't be available locally and you can verify that by opening iCal.
    The local calendars are stored in you user folder>Library under the Calendars folder.
    Personally, I wish there were an option to keep them local when signing out of iCloud like there is with Contacts.

  • How to remove all values from column

    Hi all
    I have one table and in that i have one column which contain some null value.now i want add a not null constraint on that column but it already contain null values.
    how shuld i delete that column value only or how should i proceed now please help me

    What do you mean by REMOVE?
    All values for that column are null or not? if not, then can those value removable?
    NULL means no value, how can you remove non-existing value?
    Update the null column to default value is one way.
    the other is to drop the column and add it again together with your not -null constraint.
    But I definitely wouldn`t recommend this approach in your case since some of your records have values for that column.

  • How to remove some videos from my YouTube Favourites page?

    I want to remove some videos I have added to my YouTube Favorite.
    I was able to do that in IOS 5 but not in IOS 6.
    I cannot find the EDIT button on the FAVORITE videos screen.   I need that to delete the videos.

    Sorry, Diavonex - just clicked on the wrong reply - back to myself.
    The reply was for you -
    Thanks.
    It used to work and I would see the thumbnails wiggle with an X on each,
    which, when touched, would make that thumbnail disappear and the video
    removed.  I just can't make it work any more.

  • How to remove all superscripts?

    How to remove all superscripts from large document?
    I tried to use find/replace and then find format, but i could not find superscript checkbox.

    In Find/Change , under Find Format, go to the Basic Character Formats section and it's in the Position dropdown on the lower right.

  • How to remove all nodes (except root node)from a Jtree?

    How to remove all nodes (except the root node)from a Jtree?

    Either:
    - remove all children of root.
    - save the root node, throws away the tree model, build a new TreeModel with the saved root, set the new TreeModel in the JTree.
    - implement your own TreeModel, which would support an emptyExceptRoot() method.
    IMHO, using the DefautlTreeModel and DefaultMutableTreeNode does lead to all sorts of small problems when the app evolves, and implementing your own TreeNode and TreeModel is not that hard and much more efficient.

  • How to open "All Tabs" from previously shown pages history?

    Hi,
    How to open "All Tabs" from previously shown pages history. I am not asking about "Reopen from last session". I am asking about how to open all tabs from previous webpage links from a past date from history, currently its allowing me to select each page link manually by clicking it.
    Thank you!

    Select the first item you wish to open, scroll down to the last, Shift-click that one & all those between should be selected too. Double-click on them & they should all start to open... or you can copy & then drag/paste into a new or existing bookmarks folder.

  • Ipod 5 wasn't updating new playlists.  Removed all music from iPod and ended up with 34 GB of OTHER.  How do I remove this without doing a full restore?

    iPod 5 was not adding new playlists when synching (plenty of space remained in memory for it).  This happened around the time of the new update.  I removed all music from the iPod and when I went to resync the selected playlists, my OTHER portion of memory jumped up to 34GB and now there is not enough space on the iPod to put all my music back on.
    I've checked the usage of all the apps and photos, etc, it is pretty clear this is because of the music portion only.
    Is there anyway of removing this information?  Without doing a restore?  It is not jailbroken either.

    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • How can I remove all photos from my iphone?

    How can I remove all photos from my iphone?

    Hi pjdemeo,
    I understand you want to delete all of the photos from your iPhone.  As a precaution, I would suggest importing the photos and videos from your iPhone into your computer.  This will give you a backup for the images, and after import you will be asked if you want to delete the photos.
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    https://support.apple.com/en-us/HT201302
    The iPhone User Guide has instructions for deleting photos directly from the device:
    Organize photos and videos - iPhone
    http://help.apple.com/iphone/8/#/iphf14943e
    Delete a photo or video from Photos. Tap the Photos tab, tap the photo or video, tap , then tap Delete Photo or Delete Video. Deleted photos and videos are kept in the Recently Deleted album on iPhone, with a badge showing the remaining days until the item is permanently removed from iPhone. To delete the photo or video permanently before the days expire, tap the item, tap Delete, then tap Delete Photo or Delete Video. If you use iCloud Photo Library beta, deleted photos and videos are permanently removed from all iOS 8.1 devices that use iCloud Photo Library beta with the same Apple ID.
    Cheers,
    - Judy

  • How do I remove all apps from my iPhone?

    How do I bulk remove all apps from my iPhone? There has to be a better way than removing each one manually. Thanks.

    It's easiest to plug it into the computer if you have a lot, and click on the Music tab of the iPhone. Then, either Control-A (Windows) or Command-A (Mac) to select all of the songs then press delete on your keyboard. If you have a few, it is easiest to swipe over the individual songs and press delete.

  • How to remove a list from a page ?

    I added a list to a page and then later decided it would be easier to add the list to page 0. Now I can't find how to remove the list from the page.
    Edited by: Rene W. on Oct 6, 2008 1:52 AM

    Ok sorry I understood you wrong then.
    I tried to recontruct your problem and did the following things.
    1. Created a new list in: Home>Application Builder>Application 305>Shared Components>Lists>Create / Edit List
    2. Created a new region on page 2: Home>Application Builder>Application 305>Page 2>Create Region Type: List, Name:"test1"
    3. Created a new region on page 1: Home>Application Builder>Application 305>Page 1>Create Region Type: List, Name: "test2"
    4. Deleted region "test1" on page 2
    5. List and region still survived on page 1. :D
    Tobias

  • How to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS

    Dear gurus,
    how to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS
    Arun

    Hi,
    Take a look:
    http://www.morganslibrary.org/reference/pkgs/dbms_audit_mgmt.html
    Regards,

  • How do I remove a url from "Always view this page in IE"

    How do I remove a URL from "Always view this page in IE"?

    After the new server is added to the cluster and the AG, remove the old one by first
    ALTER AVAILABILITY GROUP [YourAG]
    REMOVE REPLICA ON N'OldServer';
    Remove a Secondary Replica from an Availability Group
    Then evict the old server from the cluster with the cluster administrator or
    Remove-ClusterNode OldServer
    Remember to verify the quorum configuration after adding the new server and removing the old server.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • TS4147 How to remove all the duplicated contacts from ICloud?

    How to remove all the duplicated contacts from ICloud?

    If your Mac is syncing contacts with your iCloud account, open Contact on your Mac and go to Card>Look for Duplicates, then Merge the found duplicates.  These changes will be synced to iCloud.

  • How do I remove all photos from my ipad

    How do I remove all photos from my iPad. I'm going to Europe and have them backed up on my computer, and I need the space for new European photos.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

Maybe you are looking for

  • GPU driver update from AMD website? (G570)

    Got a G570 with HD 6370M & Intel HD Graphics 3000 (switchable graphics). I'm having some bad graphics performance since the driver offered by Lenovo is outdated, and I want to update my AMD drivers. Can I download the latest one from this website wit

  • Subcontracting to outside  for same process for different materials

    Dear all, We want to send 20 different materials having 20 diff matl .codes for same process like grinding to outside party. We also do grinding operation inhouse. In PP routing we have mentioned this GRINDING open. stage. Sometimes we get this opera

  • OBIEE Area Chart with Line Graph

    Can you create an Area and Line Graph together in one chart with OBIEE (rather than with the bar graph and line chart combo)??

  • CS5.5 Error:6 Help

    So I was trying to install CS5.5 Design Premium and got this message: Exit Code: 6 -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 9 error(s), 30 warning(s) WARNING: DW065: Display requirement

  • Flashing folder

    Hi all   i have an early 2011 macbook pro 2.7  i7       i have a folder with question mark flashing, i have replaced hard drive and also hard drive cable but can't see the hard drive, if iuse the old hard drive from usb the mac boots up, re fitting t