cancel
Showing results for 
Search instead for 
Did you mean: 

Objects(text fields/text/etc) dynamically visible/hide

viralkumar_patel
Explorer
0 Kudos

Hello Experts,

I have developed a web dynpro abap application where in I am using interactive forms and generating pdf. I have created design in adobe livecycle designer.

It displays data in pdf form fetching from db view, now I want some rows to be make unvisible at truntime.

i.e I have 5 raws in db view but only 3 raws are filled with data, I dont want the remaining 2 raws to get displayed at all in the pdf form output.

In the adobe livecycle designer, I have created data to be displayed for 5 raws, now the question is how can I dynamically unvisible/hide some of the raws which does not contain any data?

Any valuable input?? (Using Script Editor) how?

Thanks & Regards,

Viral

Edited by: Viralkumar Patel on Apr 8, 2011 11:12 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I had a req to make certain rows invisible based on data. It was achieved by adding the below mentioned

code at the form ready event of the column.

if (this.rawValue == "A")

{

this.parent.presence = "hidden";

}

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

Thanks for the quick reply.

I dont know about scripting so where should I write that code? I also dont understand by rawValue == A as given in your last reply.

Cpuld you please eloborate on this as I am new to this..

Thanks & Regards,

Viral

Edited by: Viralkumar Patel on Apr 8, 2011 12:05 PM

Edited by: Viralkumar Patel on Apr 8, 2011 12:06 PM

Former Member
0 Kudos

Check whether value is present. If value is not there, make the row invisible. You can try the following code at the form ready

event of any one column.

if (this.rawValue == null)

{

this.parent.presence = "hidden";

}

In addition to null, you might have to check space also.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi,

Where do I need to write that script? I have developed it using interactive forms in web dynpro abap.

How I can check whether raw is empty in db in livecycle designer?

Thanks & Regards,

Viral

Former Member
0 Kudos

In the Lifecycle designer goto Palettes->Script editor to do scripting.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi,

Thanks for the help.

How would I know that the rawValue is null? since I need to check in the db view, how this is possible in the script?

Thanks & Regards,

Viral

Former Member
0 Kudos

What is this db view?

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

IT MEANS DATABASE VIEW.

I AM FETCHING RECORDS FROM DATABASE VIEW SO HOW CAN I GET THE VALUE OF DB IN SCRIPT?

I WANT TO HIDE THE WHOLE PAGE CREATED IN LIVECYSLE DESIGER DEPENDING ON THE NO OF RE RECORDS AVAILABLE IN DB.

THANKS & REHARDS,

VIRAL

Former Member
0 Kudos

Have another parameter which indicates no of records fetched from database view. You can use that

in scripting.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

Thanks for the support.

As I am very new to scripting, could you please assist me in detail about this that how can I have parameter for that?

My scenario: I have a web dynpro abap application, in that I have developed adobe livecycle interactive forms so that I can display output in pdf. Here I am fetching records from database view and it gets populated in pdf. I have created 5 pages of form in design view, there can be maximum of 5 records in database view, but if that database view has only 3 records then it is displaying the other 2 records(2 pages) as empty as I have 5 different pages for data to be displayed and the remaining 2 pages displays as empty as there is no entry in database view. I want to hide the remaining 2 blank pages to be hide at run time, ie. depending on the records available in database view.

I hope you would be clear with my requirement.

Thanks & Regards,c

Viral

Former Member
0 Kudos

Hi Viral,

One way to achieve this is instead of having 5 pages, have only 1 page in flowed layout. Have 5 subforms

for each record. If record is present make it visible, otherwise make it hidden. Hiding page I have not done.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

Seems that would work for my requirement as you said.

Could you please tell me in detail about adding subforms and its contents in my form layout so that I can achieve the functionality. I also want to know about hidding the subform depending on the database records.

It would be really helpful for me if you could give further input.

I guess that code I have to write in the script, I dont have idea about scripting for this.

Thanks & Regard,

Viral

Former Member
0 Kudos

Hi Viral,

You will be only having one page with Flowed type. You can set it by going to Object->Subform->Content.

In this way size of the page can increase or decrease. Now you need to have 5 subforms 1 for each record.

Each subform will replace the existing page for each record. So all the UI elements for each record will move into

the sub form.

For hiding the subform, you can check the presence of record. This scripting was discussed earlier in the thread.

It is a very simple script.

Thanks

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

I am trying to follow as you said, but I am not able to get through it in the designer.

Will you please give any alteration way or detailed steps?

Thanks & Regards,

Viral

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

Could you please tel me the script code for the hiding the page?

if (this.rawValue == null)

{

this.presence = "hidden";

}

I am using following code but it hides all the pages. I want to check if its context has entries and display page if it has values.

Former Member
0 Kudos

Hi Viral,

if (this.rawValue == null)

{

Subformname.presence = "hidden";

}

The this refers to any UI element which contains data from the db view. If there is none, have a hidden UI element.

Bind it to data from table. In the form ready event of the element you can write the above script. It means if there is

no data make the respective subform hidden. So you need to use subform name second time.

Hope it helps.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

if (this.rawValue == null)

{

obj1.presence = "hidden";

}

I have above code in the respective subform's form:ready event, and it is not displaying any data in pdf.

Edited by: Viralkumar Patel on Apr 12, 2011 3:01 PM

Former Member
0 Kudos

Since the code is in subform's form ready event, this means subform. I believe you want to check

whether data is there. So this should be some form element which holds data.

this refers to the form element in which scripting is done. Let me know what is obj1.

Thanks,

Aravind

viralkumar_patel
Explorer
0 Kudos

Hi Arvind,

In my case obj1 is subform name, I want to hide subform1 if it doesnot contain any data. Likewise I have kept the same code in form ready event of obj2, obj3, obj4, obj5 subforms that I want to hide at runtime if doesnot have any data.

Hope these would clarify.

I have made required correction in my code and it is working fine now by doing this.<element> == null in my code.

I found it is displaying correct data but also displaying blank page before seconr page. Any suggestions how can I overcolme this?

Thanks & Regards,

Viral

Edited by: Viralkumar Patel on Apr 14, 2011 6:02 AM

Edited by: Viralkumar Patel on Apr 14, 2011 6:19 AM

Answers (1)

Answers (1)

viralkumar_patel
Explorer
0 Kudos

Hello,

As you said, I tried to implement that code in scrip but it is still not making hide my subform.

Any valuable suggestions?

Thanks & Regards,

Viral