Delete empty rows while having empty xml tag

I've seen something like same but it doesn't work for me. I have a table which is created using xml rules, some time it contains empty xml tag also converted into row but I don't want these empty rows. After table creation empty rows need to be deleted.
I've got this script from this forum which delete empty rows
for(var i=myDocument.textFrames.length-1; i>=0; i--){
  for(var j=myDocument.textFrames[i].tables.length-1; j>=0; j--){
   for(var k=myDocument.textFrames[i].tables[j].rows.length-1; k>=0; k--){
    myContents = 0;
    for(var l=myDocument.textFrames[i].tables[j].rows[k].cells.length-1; l>=0; l--){
     if (myDocument.textFrames[i].tables[j].rows[k].cells[l].contents != "") myContents++;
     if (myContents == 0) myDocument.textFrames[i].tables[j].rows[k].remove();
but incase of any cell contains empty xml element it goes blank. Could any one help on this.
Thanks
Mac

Gyan,
Thanks for your help. I have modified the code as below:
public void removeblankline()
OAViewObject rvo = (OAViewObject)findViewObject("NCRPaymentExtLineVO1");
Row row[] = rvo.getAllRowsInRange();
System.out.println("Remove all blank rows");
System.out.println("Total Rows"+rvo.getRowCount());
int jcount = rvo.getRowCount();
for (int j=0;j< jcount;j++)
NCRPaymentExtLineVORowImpl rowj = (NCRPaymentExtLineVORowImpl)row[j];
System.out.println("Check Line Number: "+j);
System.out.println("Line Type Lookup Code: "+rowj.getLineTypeLookupCode());
if((rowj.getLineTypeLookupCode()==null)||("".equals(rowj.getLineTypeLookupCode().trim())))
System.out.println("Removed Line Number: "+j);
rowj.remove();
System.out.println("Processed with Line Number: "+j);
} // end removeblankline
This is the change I have done:
int jcount = rvo.getRowCount();

Similar Messages

  • How to Add and delete a row while using Abstract Table Model

    Hi,
    I need to do the following functionalities in JTable.I've done tht but a small problem.
    1. Adding a row (Using addRow() method from DefaultTableModel).
    2. Deleting a row(Using setRowCount() method from Default Table Model).
    3. Sorting the table based on the selection of column(Using TableSorter which is using AbstracTableModel).
    As the sorting is mandatory i've to change my model to Abtract Table Model
    The problem is this Abstract Table Model doesn't have any methods to Add a row or deleting a row (setRowCount()).If anybody has written any utility method for this using Abstract Table Model help me.

    Using TableSorter which is using AbstracTableModel).If your talking about the TableSorter class from the Swing tutorial, then you create the TableSorter class by passing it a TableModel. There is no reason you can't use the DefaltTableModel.
    I changed the code in TableSorterDemo as follows:
            String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new BigDecimal(1), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new BigDecimal(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new BigDecimal(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new BigDecimal(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new BigDecimal(10), new Boolean(false)}
              DefaultTableModel model = new DefaultTableModel(data, columnNames)
                   public Class getColumnClass(int c)
                        return getValueAt(0, c).getClass();
            TableSorter sorter = new TableSorter(model);
    //        TableSorter sorter = new TableSorter(new MyTableModel()); //ADDED THIS

  • Securely emptying trash after having emptied trash (unsecurely)

    Hello. I've emptied my trash as I'm parting with my MacBook, but following this I realised that I should have securely emptied the trash. Now I want to restore the emptied trash for the purpose of securely emptying the trash, but it seems quite impossible. Is there an easy way to do this?
    I would wipe the mac but I don't have the OS CDs as they weren't sold with the Mac as everything was pre-installed.

    Grant Bennet-Alder wrote:
    Confidential to Julian Assange and Ed Snowden: YOU guys need to do the 35 passes with random data.
    Faster and safer to replace the drive, that 35x takes weeks to complete and isn't available anymore only on Snow Leopard and for a time hard drives were small.
    Brian Manning started out with 35x, but it was taking so long he canceled and went with 0x and that's not strong enough as the government used magnetic techniques to read the deleted data.
    7x is DOD approved method, that's what Secure Empty Trash does by default.
    However the problem with that is it only does what's in the Trash, not hidden files, caches etc., for a better method the entire drive or account should be scrubbed with free space 0x-7x.

  • How can I leave an empty row?

    Hi,
    If I want to use GridBagLayout, how can I leave an empty row? Or empty column? When I create the buttons on a frame, are they created sequentially? so Is that mean I can't put something back to the first row later in the program? Thx.
    Adrian

    I'm just guessing, since I havent done Java for a long time... but if you want an empty row... what pops up in my mind first is like putting in an empty JLabel/Label... for that row... but then if you wanna fill it in... i dunno...

  • NullPointerException while sending signed XML via SOAP to Axis webservice

    Hello,
    I was wondering if it was possible to change the behavior of Apache XML Security libraries and delete "ds:" namespaces while digitally signing XML files.
    We are trying to send signed XML to a local chilean IRS, as a part of an automatic autentication process. The steps to authenticate are quite straightforward and involve:
    1. Obtain from webservice 1 a "seed", which is a random number representing temporal session opened
    2. Sign this seed (in XML format) using our certificate
    3. Send signed XML to another webservice 2, which should validate it and open a permanent session, returning a "token", which is an alphanumeric string
    What happens is that steps 1 and 2 are completed without problems, while we cannot pass step 3. The webservice (as far I know mounted on Apache Axis) fails with ugly error "NullPointerException".
    The IRS says that our signed XML, although valid, seems strange to them, as it contains those "ds:" added by Apache Xml Security libraries while signing the file.
    So here comes the question: is it possible to obtain valid signed XML without those "ds:"? What other reasons may result in that NullPointerException error?
    We use simple Java class and VeriSign certificate stored in Java keystore to sign XML files, and Apache Xml Security 1.2.0 jars.
    For any clues that could help us thank you in advance.
    Jack

    Hi,
    Few months ago we had also problems with "locked user" in XI, in our case XIAPPLUSER was sometimes (b)locked.
    Perhaps note:
    721548 Changing the passwords of the XI 3.0 service users
    will help you.
    We removed and entered the service users again, with the password in CAPITALS and language blank.
    After that our problem was solved, I hope yours too.
    Regards
    Jack

  • Deleting a row based on a field in the table

    Hi,
    How do I programatically in Java delete a row in a table based on a specific field in a table? For example, I want to delete a specific row by a zip code.
    thank you

    try this
    public void deleteSpecificRow(){
                              // 1. Access the binding container
                   DCBindingContainer bc = (DCBindingContainer)getBindings();
                  // 2. Find a named iterator binding
                   DCIteratorBinding iter =
                     (DCIteratorBinding)bc.findIteratorBinding("YourIteratorName");
                   //4. create RowSetIterator Object
                   RowSetIterator rsi = iter.getViewObject().createRowSetIterator(null);
                    rsi.reset();
                   //delete all rows
                    while (rsi.hasNext())
                        Row current=rsi.next();
                 //check your condition here, if yes remove the record
                current.remove();
                        rsi.next();
       rsi.closeRowSetIterator();
    }Edited by: M.Jabr on Nov 24, 2011 5:59 PM

  • Delete all rows

    Hi All
    I'm using jd 11.1.2.0
    I have a table which displays some rows in a table. I want to delete all rows in the table when user presses the Delete button
    Please tel me how to do this
    Thaks

    try with this method
        public void deleteAll(){
                              // 1. Access the binding container
                   DCBindingContainer bc = (DCBindingContainer)getBindings();
                  // 2. Find a named iterator binding
                   DCIteratorBinding iter =
                     (DCIteratorBinding)bc.findIteratorBinding("YourIteratorName");
                   //4. Get the RowSetIterator Object
                   RowSetIterator rsi = iter.getRowSetIterator();
                    rsi.reset();
                   //delete all rows
                    while (rsi.hasNext())
                        rsi.removeCurrentRow();
                        rsi.next();
    }

  • 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 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

  • Remove Empty XML Tags using module parameters

    Hi All,
    In my lanscape I have two PI Systems.
    My scenario is an IDOC reaches 1st PI system gets converted into an EDIFACT and then goes to the 2nd PI and from there it gets routed to the respective AS2 Party.
    I am using SOAP to pass message between the PI systems and B2B Toolkit's AS2 Adapter for the communication with AS2 party.
    The issue is when the message is getting converted from IDOC to EDIFACT there are a few feilds with occurence 1..1 and due to these fields i get an empty XML tag at the output. These empty XML tags give me an error in the B2B Toolkit's AS2 Adapter Receiver Channel
    I cannot change the occurence in the structure of the EDIFACT nor can I use an XSLT mapping to remove empty tags before the message reaches the Communication Channel.
    I want to know if there are any module parameters which i can use either in SOAP Channel or the AS2 Channel to remove the XML Tags.

    Hi Muni,
    "1..1 means, you must send some values for that fields. try to find out why these are not getting any values."
    This empty tag is expected. Before using B2B Toolkit's AS2 Adapter we used to use Seeburger's AS2 Adpater and the message used to get executed successfully with these empty tags.The issue is coming only when we are using B2B Toolkit's AS2 Adapter.
    "if you want to stop sending(the fields which are not needed in target) you can you can disable the fields in the message mapping."
    I cannot disable the feild in the mapping as some other message may use this field.
    Thanks,
    Farhaan

  • 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

  • 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);

  • Deleting last, next 'create' creates non-empty row

    I have been struggling with this for some hours now.
    I have a table component binded to a VO, based on a EO.
    I have two buttons added to the page. A "CreateInsert" button and a "Delete" button. The delete-button has immediate = true, bc some of the values are required.
    The inputfield on each row are editable and have autosubmit = true
    If I:
    1. Create a row
    2. Edit the row's attributes
    3. Delete the row
    4. Create a row
    then the row that I deleted in step 3 shows up in step 4.
    I have also tried to commiting the data (between 2 and 3, and between 3 and 4).
    This only happens if the deleted row is the last row left in the set (iter.getEstimatedRowCount() = 1 before the delete action)
    BUT! If I set immediate = false on the delete-button, the create / delete works as expected.
    I'm running JDeveloper 11.1.1.5
    The iterator has the ChangeEventPolicy attribute set to 'ppr'
    The delete action has the RequiresUpdateModel set to 'false' - Action is set to 'removeCurrentRow'
    The create action has the RequiresUpdateModel set to 'true' - Action is set to 'createInsert'

    it never happens as you said in jdev11.1.1.5.0.
    by default, both of the buttons having immdieate is should be false. so no need to disturb that.
    if you are going to disturb the oracle standard means what it would be reason?
    hen the row that I deleted in step 3 shows up in step 4.from here i understood what i understood means you get deleted row when you click create insert button if am getting you right?
    this will be my answer:
    you make that createinsert immidieate is true. if so means you could get this behavoiur as you said.

  • Invoking a process to return a SQL query as XML results in empty XML tag (but testing the SQL works)

    I have a process that runs a SQL query and returns the results as XML.  When I test the query in the Process Properties tab in Workbench it appears to execute just fine.  I can also test the XML information and see that the results are coming back correctly.  But when I invoke the process I get an emtpy XML tag with no results.  Recording the invocation and playing back the recording doesn't tell me anything useful.  Has anyone ever seen this issue before?  I don't understand why everything within the process seems to bring back results just fine but invoking it returns nothing.

    Unfortunately I am not the admin for our LiveCycle instance and do not have access to the server logs (long story).  I also am not authorized to share any LCA files for this project.  Thanks though.

  • Matrix Empty row Binding Problem

    Hi ,
    i created one matrix using screen painter.. all my columns are binded
    with user defined fields.(Doc Rows Table). if my total row count is 5.
    and i deleted 2 rows using rightclick deleterow event. after adding if i see the same document  it display the 2 empty rows and 3 rows with my details.. actually its showing that deleted row also.my UDT also having empty row details..
    how to resolve this?
    Regards,
    Ganesh K

    Hi Geetha,
    i think you misunderstood my scenario. while adding no empty rows
    are displayed, even if  i deleted some added row details.After adding,
    while retriving the same document  the problem occurs.if am not clear let me know..
    As you told, beforeAction = false of Add will be new form with Add mode.so not possible to check that old matrix. otherwise we can delete the empty details from database using query..in beforeaction false pval.actionsucess true part...
    regards,
    Ganesh k.

Maybe you are looking for

  • Filter to fill in area with NOT ALIGNED dots?

    Excuse the caps. It's to prevent this topic to be filled out by forum racers mentioning the halftone filter and allow real answers stand out. Hi, I'm a graphic designer, illustrator user since '89, and I need a filter that would work as the 8-ball fr

  • X-Axis Scales and Dates Issue

    Hello, really hoping that someone can help me. I have a crystal reports report with a chart. The chart uses dates as the x-axis and numeric values on the y-axis. All I want to do is change the x-axis sacle to be 14 day intervals. Seems simple enough.

  • Export shrinks entire html page, including images!

    I've just completed my first page in fireworks. When I export the png to html (with the associated sliced images) the entire site has been scaled down by about two thirds. The page width in fireworks is 940 pixels and yet the exported html file has a

  • Create text with default values

    Hi, I need to copy values(ID, description , dates , status text)  from current document to follow up document ' text ' . I have defined text determination procedure->text type-> access sequence->function ( copy of COM_TEXT_DETERMINE_TEXT) , but this

  • Mac OS 10.3.9 wont share my internet connection with my XBOX

    First Of all I have been able to connect with 10.2.8, internet connection to the mac is working. My connection is like this. 2Wire modem connection through phone line, phone line to USB adapter, mac with internet sharing to XBOX through Ethernet. Dir