cancel
Showing results for 
Search instead for 
Did you mean: 

How do i get all ui elements of a view? (Web Dynpro Java)

Former Member
0 Kudos

Is there a way to recursively get all elements inside the root element of a web dynpro (java) view? 

For each child element found, i would like to read/modify properties at runtime.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Roberto,

there is a method which contains a reference to the view itself.

public static void wdDoModifyView(IPrivateDynamicView wdThis, IPrivateDynamicView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

Typically in WDP code if you want to create or modify elements dynamically you should access the com.sap.tc.webdynpro.progmodel.api.IWDView view wich has methods such as .getElement([ID]) removeElements(...) or similar methods. As far as I remember there should be also a method called getChildren(...) or something similar which returns a list with all elements which belongs to the current view.

Hope this info helps.

Best regards

Denitsa

former_member197472
Active Participant
0 Kudos

Use MDM WD configurator and set property raise event =true for required fields.

Once you use debugger (*level=3 possibly) you can handle values of fields.

Check this link and let know

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/600333e0-9bf7-2c10-1f99-bf5dcf661...

Regards,

Amey

roberto_reinert
Discoverer
0 Kudos

Thank you Amey,

I'm already raising events for required fields.

Actually the problem is not related to the value of these fields, but other properties, like enabled, visible, and values of matchcode, for lookup fields.

MDM API provide methods to handle these properties, but for some situations it doesn't work. (for multi value tuple fields for example).

So in this case, i would like to change the behaviour of fields at runtime, without using MDM API.

Best regards,

Roberto.

former_member197472
Active Participant
0 Kudos

Roberto Reinert

You will have to use MDM API.. The link which I sent to you has this kinda runtime property handling.

junwu
Active Contributor
0 Kudos

why? can't u just bind those attributes to the context?

Former Member
0 Kudos

Thanks for your answer Wu.

I can't bind attributes to the context beacuse these elements of the view are not visible at design time.

My screen is designed in SAP MDM Components. I just have a ViewContainerElement, wich is used by MDM to insert dynamically fields, labels and buttons at runtime.

former_member191044
Active Contributor
0 Kudos

Take a look at the MDM Component User Exits:

User Exits for Item Details Web Dynpro Components - SAP NetWeaver Master Data Management (MDM) 7.1 -...

There you can use the "setFieldProperty" method to set visibility / read only etc.

Regards,

Tobias

junwu
Active Contributor
0 Kudos

not much you can do.

Former Member
0 Kudos

Hello Roberto

Did you find any solution for the requirement you specified?? i am looking something similar where I have enabled Tray for search view from MDM std component..this tray by default is expanded where as I want to make it collapsed onload..

let me know if you  found any solution to modify ui elements of view container.

Regards,

Priya