cancel
Showing results for 
Search instead for 
Did you mean: 

Get form values from an uploaded offline interactive form.

Former Member
0 Kudos

Hi,

I have created a simple offline interactive form with 2 text input elements Email and PhoneNumber.

I have created a button on the view. In the action, I have to get the values of the Email and PhoneNumber

How to capture input values from an offline interactive form.

Thanks

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Srinivas,

For your scenario, you need to create 2 iviews in your Web Dynpro application. One view will be used for uploading the form and the other one for showing the uploaded form.

In first View, place an Upload UI element and bind it with a resource context attribute. Place one button below the Upload element and fire the plug to next view from this button.

Map the resource context attribute between the two views.

In second view you need to embed the IF element and create the required context attributs mapping for fields. Set the pdfMode as usePDF.

Now you can deploy and run your application to see if this works!!

Hope it helps!!

Cheers,

Arafat

Former Member
0 Kudos

Hi Arafat,

I followed the how to do document https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec... , and it mentioned what you just said. But I couldn't understand your suggestion "In second view you need to embed the IF element and create the required context attributs mapping for fields. Set the pdfMode as usePDF."

In the second view, I have created another interactive form for previewing the offline form.

I am able to preview the offline form. On submit action (submit button is on the view), when I print the context values, I get nulls.

Thanks

Srinivas

Former Member
0 Kudos

Hi Srinivas,

You mean to say that you are able to upload the form and preview it. Let me know if you are able to see the values that you filled up in the form after uploading it?

Cheers

Arafat

Former Member
0 Kudos

I am able to see the values that I saved offline. Now my concern is how should I read these values into view context.

Thanks

Srinivas

Former Member
0 Kudos

Here is the solution.


byte[] filebytearray = wdContext.currentPDFFileUploadElement().getFileData();
WDInteractiveFormHelper.transferPDFDataIntoContext(filebytearray, wdContext.nodeCustomerUpload());

This wdContext.nodeCustomerUpload must be exactly the same data node when the PDF file was created.

Answers (0)