cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle two Buttons in a PDF from WDC

Former Member
0 Kudos

Dear Experts,

I have a requirement in my Assignment.

Here it is:

1) I need to create a PDF, layout and it should contain two buttons in it.

2) One of the buttons, Gets the data from the DB, and the other creates a record in the DB.

3) I have to hook up this Form in a WDC, and from WDA i need to display this Interactive PDF.

Here is the problem i am facing.

In WDC, MAIN view, I have created a Interactive Form UI element.

In the properties tab of the UI element, I have assigned the Template soruce as the Form name.

This creates my node from the Form context.

In the properties of the UI element, under SUBMIT event, I have created an Event handler.

This event handler will be called for both the button clicks.

I want to execute the respective piece of code in the SUBMIT Event handler based on the Button Click.

For Ex: If i click GET DATA button, then i should execute the code which does this action, an vice versa.

How to capture the Button ID in the WDC from an interactive PDF..

Thanks in Advance,

Good day!

Regards,

Shashikanth. D

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi...

U can use the second action "check" available for Interactive form and write a seperate event handler for this u have use "Check" button instead of submit or else u can have a context attribute which identifies which button is clicked.

Thanks

Gopal

Former Member
0 Kudos

Hi Gopal,

There is no other event apart from ONSUBMIT for the UI element Interactive Form.

If there is a way to find out the ID of the button clicked, then do let me know the process for it.

Thank you,

Regards,

Shashikanth. D

Former Member
0 Kudos

I think ur in WD ABAP then u can go for a attribute which will hold the some values abt which button is clicked like if u click "Submit" then u write submit to that attribute and if u click "Get Data" then u write getdata to that attribute and in event handler u read the value of that attribute and do the actions accordingly.

Thanks

Gopal

Former Member
0 Kudos

Hi Gopal,

Thanks for the reply.

Could be more specific, please about what is that attribute which holds the Button ID of the PDF?

Regards,

Shashikanth. D

Former Member
0 Kudos

Hello...

Have a string attribtue "BtnStatus" which is binded to a input field. Have two buttons "Submit Data" and "Get Data" . If u click "Submit Data" write to input field as "Submit" and if u click "Get Data" write as "Get". Both the buttons will have same event handler. In the event handler read the attribute

eventhandler()

{

if(Btnstatus == "Submit")

{

do submit code...

}

elseif(Btnstatus =="Get")

{

do get code...

}

}

Hope u ll handle two button actions in a single event handler

Thanks

Gopal.