Skip to Content
avatar image
Former Member

How can we hide a empty row from master pages of adobe forms


Hii All...

I have a requirment likei hav a table in adobe form there are 4 rows. I want that if in  2 and 3 row if there is not data it should be hide.

right now i am getting blank line here i want to remove it also and 4 row come at place of second row.

Could someone please help me ?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Dec 18, 2013 at 08:15 PM

    Hello Vipin,

    Please read carefully below.

    First of all there was no need to design each row of table separately in the layout.😈. Tables should be designed in the design view(body page).

    The master page -> object -> Pagination is not editable. It happens when you design the table in the master page. This is not the case in the design view.

    This problem appeared before in the thread below. 😎


    Anyways, if you still want to fix this using the current design, then follow the steps below.

    1) Wrap all the rows in another parent sub form of type flowed ( Top to bottom ).

    2) Write the below Javascript code on the each row sub form only in Initialize event. Do not write it in any other event,

    Suppose for example you have 5 fields in a row,

    if ( this.field1.rawvalue == " "  &&

         this.field2.rawvalue == " "  &&

         this.field3.rawvalue == " "  &&

         this.field4.rawvalue == " "  &&

         this.field5.rawvalue == " ")

    {

         this.presence = "hidden";

    }

    Note that if you have any currency field then the initial value might not be space. It may be something like "0.00". Do take care of that.

    Note: What if there is a change in the design in future? What if they want to add more rows in that table? Tables should be designed in the Body page (this page is meant especially for dynamic positioning of elements). I would still suggest you to design the table in the body page and it doesn't take much effort. Let the framework do the maximum help for you 😉.

    Add comment
    10|10000 characters needed characters exceeded

    • That is NOT a problem! You can put 15 tables on the content page if you so desire. Stop making this much harder than it is OR go back and put in some time to really learn all about Adobe form development before you jump into some water that is far over your head.

      The folks here have been more than helpful (and patient) with you. You are now pretty much asking for everyone to do your work for you. STOP IT!

  • Dec 17, 2013 at 11:24 AM

    Check if you have written the script for that particular rows depnding on the condition.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Florian Henninger

      Hi Florian,

      thanks for your reply,

      Here is main problem is that in master page -> object -> Pagination is not editable. There is blank row coming in middle of the table is there is no data.

      can anybody suggest me how i can remove this ?

      Regards ,

      Vipin Mundra

  • avatar image
    Former Member
    Dec 18, 2013 at 04:28 AM

    Hi Vipin,

    Try declaring one row and wrap all the fields as a subform.

    Check(box) the "repeat subform for each data item" in the binding tab of the subform object properties.

    Set the subform in Flowed. So that the content is next to next when there is a hidden/empty row.

    Write your script in the Form Ready event to hide the empty row.

    And from your reply above "this.rawvalue = null " these script key words are case sensitive. Value should have the upper V.

    Hope this works..

    -Raj

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 18, 2013 at 10:11 AM

    Please check whether you are checking the condition for only 1 field or the total row?

    ---

    Naveen

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 18, 2013 at 12:50 PM

    First off, you don't do this in your "master page". This would be in your content pages (like "Mainpage". I replied to almost this same question a few days ago (as noted by someone else above in the thread link). Anyways....here is what you do (copied from other thread)...

    Put this JavaScript code in the subform that contains your TABLE (ie. one node above your table) in the "form ready" event (of course change the names/DOM paths to match your form). That subform should be set as "flowed". Your code will be something like this (replace the DOM paths with yours and replace the value you are checking with your.....not "CHARGE" like in this example....but you should get the idea from this....

    var valEmpty;

    var numrows = xfa.resolveNodes("data.Mainpage.My_Table_Subform.Table1.Row1[*]").length;

    for (var x=0; x < numrows; x++) {

         valEmpty = xfa.resolveNode("data.Mainpage.My_Table_Subform.Table1.Row1[" + x + "].CHARGE").rawValue

        if (valEmpty == "" || valEmpty == null) {

            xfa.resolveNode("data.Mainpage.My_Table_Subform.Table1.Row1[" + x + "].CHARGE").presence = "hidden";

        }

    }

    You are just counting how many "rows" you have in your table, then looping through those, checking a specific value, and then hiding that row if the value is empty ( value is "" or null).

    Add comment
    10|10000 characters needed characters exceeded

    • hi Vipin,

      I think you just have to work again trough the stack here. The solution is in any case right in fornt of you. Perhaps you create an sampleform with just the example mentioned before and see how it works. After the thing is rolling you can check both against each other.

      Regards

      Florian