on 07-30-2008 10:50 AM
Hi,
I have a Webdynpro java application, where i need to make the interactive form dynamic.
So, in the DoModifyView() of my view, i used the code:
IWDInteractiveForm iForm2 = (IWDInteractiveForm) view.getElement("ainf_actulfr");
iForm2.setDynamicPDF(true);
However, it shows a warning saying the code is deprecated.
So, i tried using the new code:
IWDPDFDocumentInteractiveFormContext IForm3 = (IWDPDFDocumentInteractiveFormContext) view.getElement("ainf_actulfr");
However, at runtime, this throws the exception:
java.lang.ClassCastException
at com.lti.pmp1.views.form.FormView.wdDoModifyView(FormView.java:150)
How do i solve this?
Regards,
Hanoz
Hi,
Have you tried this
IWDPDFDocumentCreationContext context = WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();
context.setDynamic(true);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I believe the code you provided, is to be used if you want to create a pdf at runtime.
In my case, the interactive form Element is already present in the view at design time.
All i want to do, is set the dynamicity of that Interactive form.
I want to use IWDPDFDocumentInteractiveFormContext because it will also allow me to add attachemnts to an existing form.
Thanks & Regards,
Hanoz
I have no idea about interactive forms but from reading the Javadoc I would guess you have to do something like this:
IWDInteractiveForm form = (IWDInteractiveForm) view.getElement("formID");
IWDPDFDocumentInteractiveFormHandler handler = WDPDFDocumentFactory.getDocumentHandler(wdThis, "formID");
handler.getDocumentContext().setDynamic(true);
But note that the Javadoc for setDynamic() says:
"A PDF document can either be static or dynamic in nature. Dynamic PDFs are capable of changing their layout/behaviour at runtime based on the action/event triggered on the document. One example could be to hide or display certain portion of the document based on a button click or any other UI event on the document. Should you need to deal with a dynamic PDF, you need to set this flag to true while creating the PDF document. setDynamic is not effective on an existing PDF document."
Armin
Hi Armin,
Thanks for the code, but it does not work because
getDocumentHandler(wdThis, "formID");
does not work in the DoModifyView() of a view
This is because getDcoumentHandleer(arg1, arg2) expects IWDController as arg1.
Besides, i have used :
IWDInteractiveForm iForm2 = (IWDInteractiveForm) view.getElement("ainf_actulfr");
iForm2.setDynamicPDF(true);
on an Interactive form UI element, created at design time, with mode: updateDataInPdf.
Regards,
Hanoz
Edited by: Hanoz Tarapore on Jul 30, 2008 7:30 PM
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.