cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic Binding

Former Member
0 Likes
556

Hi,

Can we bind dynamically for "PDFSource" property in Interactive form UI Element?

If I bind directly to attribute of type XSTRING, I'm facing performace issue, as the request is going to ADS everytime I trigger submit. But, I want the binary only after the final approval. So, at the time of final approval, I want the PDFSource property should be binded to Xstring attribute dynamically, so that I can generate PDF .

Appreciate your response.

Regards,

Ravi

View Entire Topic
thomas_jung
Developer Advocate
Developer Advocate
0 Likes

Certainly seems technically possible. I would suggest taking a few minutes and adding the logic to WDDOMODIFYVIEW and see if it works. I would think the hard part would be knowing when to create the binding. You can't wait until the final event. The WDDOMODIFYVIEW would be too late to effect the input processing of that server event. Therefore you would need to set the binding on the server event before the the one that you actually want to process the entire PDF document on.

Former Member
0 Likes

Hi Thomas,

Thank you for the reply. what do you mean by server event. Can you please explain a bit more?

Actually I have found a class "cl_wd_interactive_form" which is having a method: "bind_pdf_source". I'm using in wdmodifyview method. Some how I'm getting short dumb.

Here I'm not creating the node and xstring attribute dynamically, I'm just trying to bind dynamically, for the exsisitng node and the attrbute.

Regards,

Ravi.D

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

>Thank you for the reply. what do you mean by server event. Can you please explain a bit more?

I guess I don't know what you don't understand. Server event is any event that goes back to the ABAP server for processing.

>Some how I'm getting short dumb.

Perhaps you should post your code here. We can't know what you are doing otherwise. I would guess that you trying to create a new InteractiveForm UI element. To create the binding dynamically, you need to access the instance of the UI element that already exists in the view.

Former Member
0 Likes

Hi Thomas,

I'm able to bind dynamically to pdfsource on Action submit. Here Im facing some problem.

I'm able to get pdfsource xstring only if there is any error on action submit, if there is no error, then I'm not able to get pdfsource.

That means if submit action executes successfully with out any error first time itself, I'm not able to get pdf source.

I'm getting the view reference on action wdmodify method:

wd_this->iview = view.

I have defined iview of type IF_WD_VIEW under view attriutes.

And on action submit I'm binding like following

lr_interactive_form ?= wd_this->iview->get_element( 'INTERACTIVE' ).
  lr_method_handler ?= lr_interactive_form->_method_handler.
  lr_interactive_form->bind_pdf_source( path = 'PDF.PDFSOURCE').

Can you please suggest.

As I have one more submit button to trigger a pop-up before they click actual submit button , at that time I'm binding. But if the user dont click that button for pop up, then it will be a problem.

Regards,

Ravi.D

thomas_jung
Developer Advocate
Developer Advocate
0 Likes

You are violating the rules of the phase model. You can't dynamically change UI rendering (that includes data bindings) anywhere except the WDDOMODIFYVIEW event handler. Do so can lead to inconsistent results (as you are finding). SAP only expects and supports such dynamic changes in this one event handler.