cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically changing UI element 's binding

former_member196517
Contributor
0 Kudos

Hi Frnds,

how can we change a binding of a UI element at runtime. I guess method is REPLACE_PROPERTY_BINDING of CL_WD_UIELEMENT. Does anyone have any example for this..

Thanks

Anuj

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Interesting Topic, Thanks for sharing

Former Member
0 Kudos

Hi Anuj,

Check out these standard examples,

WDR_TEST_DYNAMIC ,WDR_TEST_DYNAMIC1 upto 4.

This will definitely help you.

Hope this will work!!!

Cheers,

Darshna.

S-H
Active Participant
0 Kudos

Hi Anuj,

You can find the example of dynamically changing the text of the label in the below link:

<a href="/people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements:///people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements

Best regards,

Suresh

former_member196517
Contributor
0 Kudos

Hi Suresh,

i need to change binding of UI element's property 'VALUE'

Regards

Anuj

Former Member
0 Kudos

Hi Anuj,

the method REPLACE_PROPERTY_BINDING has 4 parameters ie 3 Importing and 1 Returning.

OLD_BINDING : Pass the current binding information. This information you will get from the wizard ie Elem_****

PATH : Just pass the attrubute path for which element you want to get it. this also can get through wizard. Here access the new context element.

BINDING_TYPE: CO_ATTRIBUTE_BINDING( Attribute Binding),

CO_NODE_BINDING(Node Binding)

CO_MULTI_ATTRIBUTE_BINDING(Multiple Attribute Binding)

CO_MULTI_NODERANGE_BINDING(Multiple Node Range Binding)

Warm Regards,

Vijay

former_member196517
Contributor
0 Kudos

Thanks Vijaya, can you elaborate little more about parameters. How will i get a old binding element and also path to pass to this methos.

Regards

Anuj

former_member196517
Contributor
0 Kudos

Any suggestions ?

Former Member
0 Kudos

Hi Anuj.

Though I would reconsider the design, cause I do not think it is the best way to change bindings of UI elements to context nodes dynamically at runtime, you should take a look at these methods:

REMOVE__DDIC_BINDING

GET__DDIC_BINDING

SET__DDIC_BINDING

as the above mentioned method REPLACE_PROPERTY_BINDING is protected.

Hope this helps a bit.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

thomas_szcs
Active Contributor
0 Kudos

Hello Anuj,

Please have a look at this weblog. In the lower area you find a description about how to bind attributes of view elements to the context dynamically.

<a href="/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements:///people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements

Best regards,

Thomas

former_member196517
Contributor
0 Kudos

Hi Sascha,

I dont think so that these method will help because UI element is not binded to any DDIC rather it is to a attribute which gives me a freely search help , but in a case if application is called from some other app i dont want to show that F4 help , thats why at runtime i want to change binding of a UI element's property. Also i think REPLACE PROPERTY BINDING will help but i am not sure how to pass old binding and new binding elements to it.

Any help...

Regards

Anuj