cancel
Showing results for 
Search instead for 
Did you mean: 

How to build UI elements at runtime?

Former Member
0 Kudos

Hello,

I would like to build UI Elements dynamiclly at runtime using code and not at design time. Can someone please show me for example how Do I build a checkboc or an inputfield element at runtime?

I am trying to use the view.createElement at the wdModifyView method but I don't see that this element has been created....

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hello Roy,

Check appropriate tutorial: "How to use dynamic programming in Web Dynpro applications?"

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web dynpro tutorial and sample applications.faq#q-17

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

10X guys I was able to solve it on my own but in case points for your kind help!

Former Member
0 Kudos

Hi Roy,

You will have to write the code in doModify

IWDAttributeInfo attinfo =

wdContext.getNodeInfo().getAttribute("<attribute name>");

IWDInputField ip = (IWDInputField)view.createElement(IWDInputField.class,null);

ip.bindValue(attinfo);

Like wise if it is a checkbox

IWDCheckBox cb = (IWDCheckBox)view.createElement(IWDCheckBox.class,null);

cb.bindChecked(<attribute info>)

Regards

Rohit

Message was edited by: Rohit Radhakrishnan