cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide table header for empty table

Former Member

Hi,

I wanna to hide table header for all tables which doesn't contain any data in my Adobe form. How can I do this? Helpful answers will be rewarded .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

HI Aliaksandr,

You can use javascript to do this dynamically.

For example, i used Adobe Designer 7.1 to add a table to a subform.

Now, i have the object hierchy as:

Level 1 - form1

Level 2 - form2

Level 3 - Table1

-->HeaderRow

--> Cell1

--> Cell2

-->Row1

--> Cell1

--> Cell2

Now, i sleect the Table1 element, and write the javascript which is executed on Initialization, as


if(this.Row1.Cell1.rawValue == "")
{
this.HeaderRow.presence = "hidden" ;

}
 

This will check that if the first row is empty, it will hide the header from the layout.

You can use something similar for your requirement.

Hope this helps,

Siddhartha Jain

Former Member
0 Kudos

Hi Siddhartha,

Your reply sounds like the truth , but unfortunately it doesn't help. I hang almost the same code on my table for execution both on Client and Server

if (this.Row1.skill.rawValue == "") {

this.HeaderRow.presence = "hidden";

}

but header still exist :(. Maybe there are some conflicts with table or header object properties, like 'Include Header Row in Initial Page'? I'm confused

Former Member
0 Kudos

HI Aliaksandr,

I tested this on a standalone form and it was working fine.

Are you using the form in WebDynpro java application?

How are you fetching the data?

Do you want to hide the table or just the row?

Have you selected the Language as Javascript?

In the If condition, try to see the value of the visibility, to confirm whether it is going inside the loop or not.

if(this.Row1.Cell1.rawValue == "" )

{

xfa.host.messageBox(this.HeaderRow.presence);

this.presence = "hidden" ;

}

Regards,

Siddhartha

Message was edited by:

Siddhartha Jain

Former Member
0 Kudos

Yes I use it in WebDynpro java application and form is in the browser.

Data is filled in model dynamically and sometime its possible that some nodes can be empty. There are some nodes and all them used to build tables, one node with cardinality 0..n for one table.

I want to hide all table which in this case equal to hide header row.

Yes language is javascript.

When code is

<b>if (this.Row1.skill.rawValue == "") {

xfa.host.messageBox(this.HeaderRow.presence);

this.HeaderRow.presence = "hidden";

}</b>

message box doesn't appear

When I change condition to

<b>if (!this.Row1){

xfa.host.messageBox(this.HeaderRow.presence);

this.HeaderRow.presence = "hidden";

}</b>

message box appear but table still visible

Former Member
0 Kudos

HI Aliksandr,

In the context of webdynpro application, under the datasource noce for the PDF, add a value attribute of type striong for presence.

In the WebDynpro application, you can check if content is available for the table or not.If not, set the value for this context attribute as "hidden" else set it to "visible".

So, in your webdynpro application, befor rendering the form, i set the value as

wdContext.currentDataSourceElement().setPresence("hidden");

Then in the Interactive form designer, select the Table -Table1 in the hiearchy, and set its presence in javascript on Initialize of Table1 as

this.presence = dataSource.presence.rawValue ;

This would hide the entire table, and not just the header.

This should work.

Regards,

Siddhartha

Former Member
0 Kudos

thx

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ali,

If you are using ABAP workbench to develop the forms, you can try the following option.

If you are using Designer 6.0

Create an Alternative node in the context.

Give the alternative node condition as table <> initial.

Create separate subforms in the layour for header and body.

Bind the header subform to the TRUE condition of Alternative node.

If you are using Designer 7.1

You wont be facing this problem if you have used Designer 7.1 to design the form.

Please reward me points if this helped u..

Former Member
0 Kudos

I use Designer 7.1 and problem unfortunately exists

Former Member
0 Kudos

Hi,

There is a Check Box in Object --> Binding Tab

repeat subform for each data item

In this we have Max and Min.

Uncheck Min checkbox.

I think it will work.

Thanks and Regards,

Amit

Former Member
0 Kudos

No, if you uncheck min checkbox then another checkbox on Pagination page Include Header Row in Initial Page will be uncheked too, so header will not be included even if there are data in table. So this is not a solution