cancel
Showing results for 
Search instead for 
Did you mean: 

about script on form

junwu
Active Contributor
0 Kudos

Hi guru,

I am building a interactive form, i got a problem about the script.

I want to use javascript to control the visibility of a field.

when I preview the form and set the form default preview property to dynamic form, I can see the right result.

but when I deploy my application and run in server, I didn't get the expected result. anyway the filed is visible. So is there any setting I have to make in the form?

Best regards,

Accepted Solutions (1)

Accepted Solutions (1)

i042339
Product and Topic Expert
Product and Topic Expert
0 Kudos

I understood your problem.

Yeah, you have to set the form as dynamic form.

If you are using WebDynpro Java.. you have to write

the following code in the WDDOModify function of the view.. then your java script will work fine

public static void wdDoModifyView(IPrivateBP_CreationFormView wdThis, IPrivateBP_CreationFormView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

* if(firstTime){*

* IWDInteractiveForm iForm = (IWDInteractiveForm)view.getElement("InteractiveForm");*

* iForm.setDynamicPDF(true);*

* }*

//@@end

}

Please contact me if you are facing any problem.

Cheers

Satya

i042339
Product and Topic Expert
Product and Topic Expert
0 Kudos

This will 100% work fine.

I will just expalin you what this code is doing ..

In the wdDoModifyView function of the view you have to get the Interactive Form element and set the dynamic properties to true.

IWDInteractiveForm iForm = (IWDInteractiveForm)view.getElement("InteractiveForm");

iForm.setDynamicPDF(true);

Here the getElement("InteractiveForm") .. I have specified the name of my AdobeInteractiveForm UI element.

So you have to give the name of your UI element

Cheers

Satya

junwu
Active Contributor
0 Kudos

Hi Satyabrata,

that works

thank you.

John.

Answers (1)

Answers (1)

i042339
Product and Topic Expert
Product and Topic Expert
0 Kudos

Please update me if you have solved your problem or not.

If it is solved you can reward some point.

If you still have some doubt regarding the implementation post this in this forum.

I will be able to solve this issue.

Cheers

Satya