cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding Windows, fields in adobe forms

Former Member
0 Kudos

Hello,

I am new to adobe forms and presently working on one requirement.

My form got 3 pages, on first page i have one table. i) If the table contains only one row i have to hide the entire page.

ii) On the second page i have Po details and on third page I have SO and FI details. If the tables for PO, SO or FI are empty i need to hide the windows.

iii) Current Page/ total Page no : This field needs to be displayed from second page and once the form repeats for another input value these two needs to be initialized and start counting based on the data extension to multiple pages. Presently printing starting from 1st page.

I have all the flags First_page_flag, Second_page_flag, third_page_so and third_page_Fi flags controlled from print program and are available in the context menu but not on the LAYOUT.

I also tried the following code to hide the page but it didn't work out: (Initialize)

var pdisplay = xfa.resolveNode("Table_PO[*]");

if(pdisplay.value == NULL)

{

pdisplay.presence = "hidden";

}

I could able to hide the windows, subforms and fields with out the flag check via java scripting.

this.presence = "hidden"; but don't know how to use these flags in script editor to hide all these.

Can any one help me to achieve these functionalities for which i will be so thankful to you.

Best Regards,

Naresh.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Closed and Answered

vaibhav_tiwari
Contributor
0 Kudos

Hi Naresh,

Is your form Dynamic interactive form?

If not write the below code in wdmodifyview() method of view containing your form:

IWDInteractiveForm form = (IWDInteractiveForm)view.getElement("<Interactive form name>");

form.setDynamicPDF(true);

for type should be "native" in form properties.

In case you are using WD ABAP insert web dynpro script in the form using the menu->utilities->insert web dynpro script option in SFP t-code.

After that run report "FP_ZCI_UPDATE". Choose radiobutton "update" and execute giving your form name.

Regards,

Vaibhav

former_member619441
Discoverer
0 Kudos

Hi Vibhav,

Thank You very much for the prompt replay.

This is not an interactive form. I have modified the layout type from "Standard" to "ZCI" layout in order to include the Webdynpro script. I hope this doesn't make any changes to my layout as after executing my report i can see all the data remained as it is.

Secondly, when i execute the report "FP_ZCI_UPDATE" after selecting the update option, I am getting an error message saying "No Authorization for update Function". I think we are refreshing the layout by following these steps.

Am i doing any wrong in the java script mentioned above?(spaces or so). I observed that after writing this code people could able to archive the requested functionality.

Could you please suggest any alternative and replay back with your comments.

Thank You,

Regards,

Naresh.

vaibhav_tiwari
Contributor
0 Kudos

Hi Naresh,

Inserting a web dynpro script won't make any changes to the layout.

Error in report:

You might have opened the form in change mode while running the report FP_ZCI_UPDATE thats why the error was coming.

Please close the form and then try with the report.

Regards,

Vaibhav.

Former Member
0 Kudos

I have used the following code to check how many rows are there in the table.

var nodata = xfa.resolveNodes("xfa.record.FIELD_NAME.DATA[*]");

var tab = nodata.length;

But if there is a row with blank value, it will return value as 1. So this is not a good way to check

if there are any entries in the table. You can do this check in the backend, and pass the result in a flag.

Or by script after getting the number of rows as shown above, loop through the table and check

whether value is present in the row or not.

Thanks,

Aravind

Former Member
0 Kudos

Hi Vibhav, Hi Aravind,

I closed my layout and run the program. But still getting the same error.

For Tables in PAGE 2 and PAGE 3

Anyways I could able to hide the TABLES (Sub forms - Page 2 & 3) now by including and hiding the flags(WV_SDISPLAY, WV_FDISPLAY) in the respective subforms. I have used the following JAVA scripting to achieve this in initialization event:

if(this.WV_SDISPLAY.rawValue = "X")

{

this.presence = "hidden".

}

For PAGE hide:

But, in my requirement i have to hide the FIRST PAGE and not the TABLE, if the table(subform) containes one row. I set a flag wv_idisplay in the program. Now if i include this flag under this table and follow the same JAVA scripting mentioned above it is not working.

if(this.WV_IDISPLAY.rawValue = "X")

{

this.presence = "hidden".

}

Also, from some of the threads and by the comments of Gold Otto, I could understand that, to hide a Master page, i need to put the condition on it's associated subform and i am proceeding with this logic.

Could you please help me if this is not the correct approach. Also, request you to send me some sample Java Script to hide a PAGE.

Thank You,

Regards,

Naresh.

Former Member
0 Kudos

To hide pages, the approach I have followed is have only one page with Flowed layout.

Arrange all the different sections in different subforms. In your case, then if the flag is set

do the following code to hide the respective subforms.

subformname.presence = "hidden"

In this case, the sections in the second page will occupy the first page when it is hidden. But I

see that you have 3 different pages itself. I have not worked in that scenario.

Thanks,

Aravind

Former Member
0 Kudos

Hi All,

Thank You very much for the replies.

I could able to solve all issued by using form calc coding.

I haven't specified full path starting from body page till the body row of the table while writing the formcalc scripting.

For hiding the first master page, I transferred all the elements into the Body Page and put a condition on the flag check and it worked fine.

For page counting, at object level there is a check box 'Include page number for counting' option. By un-checking it for the first page, I could successfully count the start counting from second page.

Hence closing this thread.

Thank You,

Regards,

Naresh

Former Member
0 Kudos

Hi Naresh,

In ADOBE form we are using amount field , but in displaying form  we do not want to display zero values , it should be blank.

kindly give me some information