Button to delete all empty rows

I am in the process of creating an interactive form that has a button that add rows for the user to input issues and another button to add follow-ups to those instances. There are 3 different sets of these. However, we do not want to add a delete button to all rows, to allow for accidental deletion of already inputted data.  I would like to create a button that will delete all empty rows, including all subforms.  Either that, or upon saving the document, all empty rows would be deleted - whichever would be easier. Please help!  This seems like it will be a complicated task and I am not that well versed in LiveCycle to be able to figure this out on my own.
Thank you!

There is no doubt that looping through nested repeating objects is more complex:
Here is the script for the first table with follow-up rows:
// Technical
var nCount3 = VitalsSubform.Technical._Instance1.count;
for (var k=0; k<nCount3; k++)
     // this is script to remove the follow-up rows in the first table only
     var nCount6 = xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
     // loop through the rows in the follow-up table
     for (var i=0; i<nCount6; i++)
          if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "].Table1.Row1[" + i + "]").Cell4.rawValue == null)
               // remove null row
               xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.removeInstance(i);
               // recount nCount in case a row has been deleted
               nCount6 =xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1._Row1.count;
               // account for the row that is now deleted
               i = i-1;
     // now remove null statements
     if (xfa.resolveNode("VitalsSubform.Technical.Instance1[" + k + "]").Table1.Statement.Statement.rawValue == null)
          VitalsSubform.Technical._Instance1.removeInstance(k);
          var nCount3 = VitalsSubform.Technical._Instance1.count;
          k = k-1;
It is by no means tested and could still be flaky.
Have you considered a manual 'x'/delete button for the follow-up rows?
Here is the form: https://acrobat.com/#d=JMGUKXNQ*qMD18S3W5VxSQ
Niall

Similar Messages

  • Delete first empty row in a table

    Hi,
    Can you please provide the script for the below requirement.
    Need to delete First empty row in all the tables. (Tables having more number of empty rows. i need to delete first empty row only)
    Regards,
    Velu

    @Velu – the following blog post by Jongware might get you started:
    Tackling Tables through Scripting
    by: Jongware | April 8, 2013
    http://indesignsecrets.com/tackling-tables-through-scripting.php
    Document Object (DOM) documentation:
    Indesign JavaScript Help
    InDesign ExtendScript API (10.0)
    Table Row specifics:
    Adobe InDesign CS6 (8.0) Object Model JS: Row
    InDesign ExtendScript API (10.0)
    Uwe

  • How to copy/paste anchor text box to its anchor point in text and delete all empty anchors?

    hi all
    i have a document of few pages but one story. The right column is the main text box and on many places anchored text boxes are placed which appeared on the left column as shown below.
    i want text of each anchor-text-box to be cut from its place and paste at its insertion/anchor point and delete all empty anchored boxes.
    I am trying since morning but i unable to reach anchor object reference. Any help on how to start with will be helpful.
    virender

    Ok, let's say you have one main text box (not anchored) and three text boxes that are anchored to text within it. The first one is anchored with text, the second one is unanchored, and the third one is empty (I'm not going to get into inline anchoring vs. custom anchoring since you didn't bring it up in your post).
    We cycle through the items on the page:
    function main(){
      var myDoc = app.activeDocument;
      var myPages = myDoc.pages.everyItem().getElements();
      for (var i = 0; i < myPages.length; i++){
        var myPage = myPages[i];
        //Checks that the page is valid, and that it is not a master page. If either is true, skips to the next page.
        if (myPage.isValid == false) continue;
        if (myPage.parent instanceof MasterSpread) continue;
        var myItems = myPage.allPageItems;
        for (var j = 0; j < myItems.length; j++){
          //Current item.
          var myItem = myItems[j];
          //If myItem doesn't have a Character parent, it is not anchored.
          //The first and third text frames would fail this test.
          if (!(myItem.parent instanceof Character)) continue;
          //We only care about text frames.
          if (!(myItem instanceof TextFrame)) continue;
          //I think the only way this would happen would be if you had an image or
          //something else unexpected within the frame. I check for it so no content
          //is inadvertently lost.
          else if (myItem.texts.length > 1) continue;
          //If we're still in this iteration of the loop, all qualifications are met.
          //Flatten the text frame.
          //I don't use layers that often so, to me, flatten makes sense. You may want
          //to use a different term if there's a chance for confusion.
          flattenItem(myItem);
    function flattenItem(funcItem)
         //Hold onto the anchor character.
        var myParent = funcItem.parent;
         //Duplicate the text from within the frame so that it appears right after the anchor.
         //There may be other methods, but this works for me. I try to avoid copy/paste
         //so as not to deal with any clipboard mishaps. I added a check in case of empties.
         if (funcItem.texts.length > 0){funcItem.texts[0].duplicate(LocationOptions.AFTER, myParent.insertionPoints[0]);}
         //Replace the anchor character itself with a space (or whatever) which also
         //deletes the text frame it was anchoring.
        myParent.contents = " ";
    I guess the takeaway might be that you're not looking at the main text frame and then checking to see if anything is anchored to it. You're looking at each text frame and figuring out if it is anchored. That's my approach, anyway.

  • Before updating my iPhone 4S, I could double click the home button, and delete all of the previously opened apps. I am not able to figure out to do that now, after installing the latest update. Does anyone know how to do this?

    BEfore updating my iPhone 4S, I could double click the home button and delete all of the previously opened apps. After updating, I am not able to figure out how to do this. Can someone tell me how to do this?  Thank you.

    After you double click the home button you swipe up on the app screenshot.

  • App or "button" to delete all currently open apps

    I was wandering if there was an app or button that we could press to delete all of the open apps in the background rather than having to press them one at a time. I am sure this is an Apple software development issue but wandered if anyone has any ideas. I have seen it on one of the other smartphones.

    There are no apps or buttons to do this & further, it's not really necessary to do so. Read here to understand the multitasking bar:
    http://whenwillapple.com/blog/2010/04/19/iphone-os-4-multitasking-explained-agai n/

  • How do I delete all empty graphics frames from a document?

    I have data merged a document and need to remove all the empty graphics frames as quick as possible.
    I have found solutions for deleting empty text frames but not graphics frames. Can somebody help with this as it will save soo much time and RSI!
    I found an applescript solution here:
    http://forums.adobe.com/thread/756281
    However, I am running Windows 7 and Id CC
    Cheers,
    Kris.

    Hi MToys
    I added a little to the script so that it will work on Ovals and Polygons also. [Not TextFrames]
    You just have to set the values for which of the frame types you want to delete.
    You can do this by setting the const values at the top of the script for DeleteRectangle, DeleteOvals, DeletePolygons
    There are a few uncertainties that I had:
    If an object is selected, should the script only delete that objects frame type.
    I.e., If you select an oval, should the script know to delete only ovals.
    At this point, I did not do that, rather it will just get the settings from the selected object, and delete all frame types with those settings
    I had to disable matching the transparency settings because they werent comparing correctly between different frame types
    Meaning, I made 3 frames, Oval, Rectangle and Polygon - no settings applied.
    I selected the oval and ran the script. It only deleted the oval even though set it to delete all.
    I found that the transparency settings werent matching... even though there werent any
    So, for now - its disabled.
    If someone can shed some light on this I would appreciate it.
    I tested the script on Mac Mountain Lion - ID CS6 and seems to work well
    Here is the script
    const Object_Style = false,
        Fill_Color = true,
        Fill_Tint = true,
        Fill_Transparency_Settings = true,
        Item_Layer = true,
        Stroke_Color = true,
        Stroke_Weight = true,
        Stroke_Type = true,
        Stroke_Transparency_Settings = true,
        Stroke_Tint = true,
        Stroke_Alignment = true;
    const DeleteRectangles = true,
        DeleteOvals = true,
        DeletePolygons = true;
    app.doScript(main, undefined , undefined, UndoModes.fastEntireScript, "INSERT_HERE_THE_SCRIPT_NAME")
    function main() {
        var myDoc = app.activeDocument;
        var mySel = app.selection;
        if (mySel.length > 0) {
            mySample = app.selection[0];
            if (mySample.constructor.name == "Rectangle" ||
                mySample.constructor.name == "Oval" ||
                mySample.constructor.name == "Polygon")
                var isSample = true;
                var objSty, fClr, fTint, fTrans, lay, sClr, sWeight, sType, sTrans, sTint, sAlign;
                GetProps(mySample);
        if (DeleteRectangles) {DeleteItems(myDoc.rectangles)}
        if (DeleteOvals) {DeleteItems(myDoc.ovals)}
        if (DeletePolygons) {DeleteItems(myDoc.polygons)}
        function DeleteItems(myGraphicFrames) {
            for (var i = myGraphicFrames.length-1; i >= 0; i--) {
                if (myGraphicFrames[i].graphics.length < 1) {
                    myGraphicFrames[i].select();
                    if (isSample) if (!checkProps(myGraphicFrames[i])) continue;
                    myGraphicFrames[i].remove();
        // ======================================
        function GetProps(mySample) {
            objSty = mySample.appliedObjectStyle;
            fClr = mySample.fillColor;
            fTint = mySample.fillTint;
            fTrans = mySample.fillTransparencySettings;
            lay = mySample.itemLayer.name;
            sClr = mySample.strokeColor;
            sWeight = mySample.strokeWeight;
            sType = mySample.strokeType;
            sTrans = mySample.strokeTransparencySettings;
            sTint = mySample.strokeTint;
            sAlign = mySample.strokeAlignment;   
        // ======================================
        function checkProps(myFrame) {
            var i=0;
            if (Object_Style) if (myFrame.appliedObjectStyle != objSty) return false;
            if (Fill_Color) if (myFrame.fillColor != fClr) return false;
            if (Fill_Tint) if (myFrame.fillTint != fTint) return false;
            if (Item_Layer) if (myFrame.itemLayer.name != lay) return false;
            if (Stroke_Color) if (myFrame.strokeColor != sClr) return false;
            if (Stroke_Weight) if (myFrame.strokeWeight != sWeight) return false;
            if (Stroke_Type) if (myFrame.strokeType != sType) return false;
            if (Stroke_Tint) if (myFrame.strokeTint != sTint) return false;
            if (Stroke_Alignment) if (myFrame.strokeAlignment != sAlign) return false;
            //if (Stroke_Transparency_Settings) if (myFrame.strokeTransparencySettings != sTrans) return false;
            //if (Fill_Transparency_Settings) if (myFrame.fillTransparencySettings != fTrans) return false;
            return true;

  • A script to delete all table rows containing a specific text

    Hello,
    I've tried some old scripts but can't get around to the right solution.
    I need a script that will delete all rows in a table that contain a specific single-word text, something like "xxx".
    Anyone's got an idea?
    Thanks

    Hi,
    To remove a row use row.remove() method.
    So iterate through table.rows and remove the one matched a condition.
    If we talk about condition you have to be more accurate - what do you mean "a row contain a text":
         ==> 1st cell contains,
         ==> any cell contains.
    Entire row contents is an array of its cells.contents, so your 1st row text is:
    rows[0].contents.join(" ")     ==> string
    Jarek

  • How to delete empty row without validation error in ADF Table(EMP)

    Hi Everyone,
    I am using EMP Table in ADF jspx page to insert the data into database.when i insert a row into table by createInsert operation,it inserting the row.But I need to delete that row immediately with out entering any value.
    But it showing some validation error at empno.Is there any ways to delete the empty row?if not,what are the reasons that we can't delete the row.
    could any one tell me the reasons!!
    Thanks in advance!!
    With Best Regards,
    Amar
    Edited by: 973755 on Dec 11, 2012 6:42 AM

    Amar,
    I am little confused with your logic here.....
    but if you are trying to remove the row by clicking Remove button, you can set the immediate property to true and that remove function will run without executing any entity validation.......
    -R

  • Advanced Table delete empty rows

    Hi
    I added logic to add 10 empty rows and to delete the empty rows when the form is submitted. But somehow it only deletes the rows in current screen of the Advanced Table. if there are 15 rows and I click next to go the last 5 and submit the form it deletes only the 5 empty rows but not the other 10 rows in the previous section.
    where am I doing wrong?
    Thanks
        Row [] row = null;
        ExpAttendeesVORowImpl rowi = null;
        if( expattendeesvoimpl1 != null )
            row = expattendeesvoimpl1.getAllRowsInRange();
            System.out.println("No of items "+row.length);
        for (int i=0;i<row.length;i++)
             pageContext.writeDiagnostics(this, "in loop ", 2);
             rowi = (ExpAttendeesVORowImpl)row;
    pageContext.writeDiagnostics(this, " in loop row "+ rowi.getName(), 2);
    if((rowi.getName() == null))
    pageContext.writeDiagnostics(this, "deleting row"+ rowi.getName(), 2) ;
    rowi.remove();
    Thanks

    you could instead try using:
    expattendeesvoimpl1.getFilteredRows("Name", null);

  • Delete Command Button to delete particular row from VO

    Hi,
    I have dragged & dropped an VO into jspx page as table, from data-control pallete dragged Delete operation as a button on to the table as last column.
    By pressing delete button, it is deleting top row from VO. I want to delete the particular row w.r.t delete button on the column list....?
    regards.

    Iam using JDev 11.1.1.5 version,
    Irespective of the row selected in VO and pressing delete button will delete only first row(starting row of VO).
    Note: Each row of VO having delete button(bcoz, i dragged & dropped delete operation has a button as a last column of table)
    regards.

  • Why won't the delete all photos button work

    I press this button to delete all my photos but it doesn't do anything. Is it a new feature in iOS6? Is it buggy? Is it just there but not functional? It doesnt do anything after I press it (it doesnt delete all photos). Delete all music does work though
    Does delete all photos work for you guys?

    If you have Warranty or AppleCare make Genius reservation and take to Apple for resolution. If you would like to try perfect Virtual Button, tap Settings App > General > Accessibility > Assistive Touch > ON > tap new white screen button > Device > Lock. You can even turn iPhone OFF with this button. To turn iPhone ON, connect iPhone to power ie charger or USB of computer.

  • Create Table with extra empty row

    Hi,
    I have two problems...
    I need to create a table from DB with one extra empty row.
    Is there an easy way to do this?
    And I need a button to delete all in that table.
    something like SQL:
    delete from tableX
    Anything that helps me on the way... what I should look for?

    835652 wrote:
    Hi,
    I have two problems...
    I need to create a table from DB with one extra empty row.
    Is there an easy way to do this?this is strange requirement can you clear what is your use case ?
    >
    And I need a button to delete all in that table.
    something like SQL:
    delete from tableX
    Anything that helps me on the way... what I should look for?Try this http://baigsorcl.blogspot.com/2010/11/how-to-execute-sql-dml-statements-in.html

  • Solved: Delete Using Automatic Row Processing

    See Scott's reply below for the answer.
    Hi there,
    I have an application built in APEX 3.0.1 that I would like to be able to use a button to delete a single row from an underlying database table (owned by the parsing schema).
    My APEX page has a 3 HTML regions on it:
    1. Only a Select List and Go button for User selection (of Debit Note)
    2. Ten display Items (Text Field, Disabled saves state) displaying further information about User selection
    3. Conditional Delete button (region with custom image) - only displays when P73_DEBITNOTEID is NOT NULL
    I'd like this button to be used to Delete the Selected Item and thought I'd be able to use a Data Manipulation Page Process - Automatic Row Processing (DML) page process to do this.
    However, when I go through the wizard the Select item containing primary key column value field has no values in the search list.
    My first question is why was there no values in the list?
    So I manually entered the Item I required (P73_DEBITNOTEID) but when I run the page and click the button I get a PL/SQL missing expression error.
    What is the best practice method to do DML actions on the underlying database tables. The tables are all owned by the parsing schema.
    Your help in resolving this matter would be greatly appreciated.
    Kind Regards,
    Gary.

    Gary,
    The DML processes (and the creation wizards for them) are for use with items having source type Database Column. If your page items don't use this source type, then neither the Automated Row Fetch nor the Automatic Row Processesing (DML) process types will work.
    Scott

  • Dynamic Action on tabular form: to auto set value for all changes rows

    Hi All:
    I am using APEX4.2.3 and I am not very familar with JQUERY or Javascript.
    I am having a tabular form to support Update and Delete action. The tabular form has 4 columns:
    Column A: ID                      (Number)     : Read-only column
    column B: Name                 (Varchar2)   : Editable
    Column C: Age                    (Number)     : Editable
    Column D: ChangeFlag      (Varchar2)   : Read-only column                             ==> however, I want this column been automatically upldated by my APEX application
    Here is the requirement: First user update Column B, or C or both for # of rows; then user click "Save Change" button. For ALL updated rows, I need to automatically update Column D with below logic:
    For a given row,
                   IF Column D IS NULL  THEN
                         set value = 'M'                           -- M means modified
                   ELSE --- column D has a value already
                        IF last character of Column D is 'M', THEN
                               don't do anything;
                        ELSE
                              set value of D = existing value + 'M'                       (here + means concatenate
                       END IF;
                END IF;
    I thought this can be done by creating dynamic action on tabular form ... I have researched this on this forum and can't find a good match example ..
    I know I can implement this using a DB trigger; however, I want to learn if this can be achived via Dynamic Action.
    Thanks!
    Kevin

    Hi Expert:
    Anyone can offer any direction or help on this?
    Thanks!
    Kevin

  • How do i delete all my contacts in facetime?

    hi i would like to know how do i delete all my contacts in facetime or contacts? do i have to do it 1 by 1 or there is a button to delete all contacts?

    Facetime uses the contacts in the from the Contacts app. Delete all your contacts there and they won't show up in Factime/Phone/Mail. If you want to delete Contacts en-masse, it's probably easier to revert to sync with an empty Contact list / AddressBook from your computer.

Maybe you are looking for