cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos


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

Accepted Solutions (0)

Answers (5)

Answers (5)

ChrisSolomon
Active Contributor

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).

Former Member
0 Kudos


HI Vipin,

If I undersatnd correctly , In table 'Min count' option in Properties would be set to 1. If you just check Repeat data and uncheck Min count ,  empty row or row based on a condition will not appear.

Florian
Active Contributor
0 Kudos

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

pavan_prabhu
Active Participant
0 Kudos

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 .

Former Member
0 Kudos

thanks Pawan,

Its also not working can you suggest me somthing else .

Florian
Active Contributor
0 Kudos

Hi vipin,

do not understand me in the wrong way, but as some of us mentioned before, the solution is right in this discussion included.

You do something wrong, nobody can help you with, just because you just saying, everything is not working.

Create an sampleform just with the table inside and check your form against the sample which will work for sure, if you do steps right in that way

pavan_prabhu
Active Participant
0 Kudos

Hello Vipin,

     As I said earlier, I would suggest you to design the table directly in the body page(design view) instead of master page. Do not create separate rows. Just create a row template. It would be enough.

The design would be as below.


  • Table sub form ----> parent sub form
    • Data Sub form---->child sub form

    

Please follow the steps below.

For the table sub form-----> let the name of sub form be table_sub

Step 1) Drag the Internal table from the import into the context node in the Adobe form.

Step 2) In layout editor you will be able to see this internal table in data view tab.

Step 3) Don't drag the whole table. Instead, drag only the data part of this table in the content area sub form in the design view(body page)tab. If you don't have the sub form, it is will be created automatically for you after dragging the data part.

Step 4) Select this sub form and in the object palette give content as flowed. In Flow direction, give Top to bottom. And check the "Allow Page breaks within content". In place give Following previous and in After give Continue filling Parent.

Step 5) And in Binding section, select the internal table. Uncheck the "Repeat sub form for each data item".

Finally,

For the data sub form----> let the name of sub form be data itself

Step 1) Select this sub form and in the object palette give content as flowed and Uncheck the "Allow Page breaks within content".

Step 2) In Flow direction, give Western text.

Step 3) In Binding tab, Check the "Repeat sub form for each data item".

Former Member
0 Kudos

hii pawan,

Thanks a lot for your help it was really helpfull.

here is problem is that i have to display 2 tables in 1 page so i created 1 table in body and 1 in master page.

ChrisSolomon
Active Contributor
0 Kudos

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!

navip
Active Participant
0 Kudos

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

---

Naveen

Former Member
0 Kudos

Hiii Naveen,

I am checking the condition for all the fields of the row but its giving blank row there

Former Member
0 Kudos

Hiii All,

I have to hide table row in Subform only.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Raj,

Thanks for your response its also not working ..

Former Member
0 Kudos

Hi Vipin,

Why cant you delete in the temporary internal table in the context itslef based on condiditon?

Wont that be simple rather than tyring in scripting?

Regards,
Ramya

Florian
Active Contributor
0 Kudos

Hi Vipin,

just check the link below. I think you can work trough that content. It's right delivered from adobe itself...

http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000178.html

regards

Florian

Former Member
0 Kudos

Hii Ramya,

I have to hide the row space also data is not coming right now blank space is coming.. I want to hide this..

Former Member
0 Kudos


Hii Florian,

Its also not working

varun_vadnala3
Active Participant
0 Kudos

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

Former Member
0 Kudos

Thanks Varun for your rply..

I had written script depending on those conidtion only if this.rawvalue = null then hidden it.

I wrote this condition for every row in the table but its showing me empty space there no hiding the space.

Florian
Active Contributor
0 Kudos

Hi Vipin,

it's not that easy, because you have to see behind the value, what is really in. Null means, you do not have anything in there. But, I think, you got values like Spaces in.

The easiest way is to process this with messagebox and show what is really in. If you do not see a thing, then put first convert it to an xstring with javascript and display this value.

Here's another discussion just matching your question:

The coding in there is good and can be enhanced to match all cases.

Regards

Florian

Former Member
0 Kudos

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