cancel
Showing results for 
Search instead for 
Did you mean: 

How to set values to the dynamically created UI elements

Former Member
0 Kudos

Hi,

I have created 3 input fields dynamically, now on calling of a method, i want to display values in those dynamically created input fields.

Can any one please guide me on this.

Regards,

Lakshmi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The InputField UI element has a property named "value" that must be bound to some context attribute (it does not matter whether this attribute is created using the IDE or by code).

Example: To create an input field and bind it to an attribute "abc" created in the IDE, use code like


IWDInputField fld = (IWDInputField) view.createElement(IWDInputField.class, "InputFieldForABC";
IWDAttributeInfo attribute = wdContext.getNodeInfo().getAttribute("abc");
fld.bindValue(attribute);

To set the value of the input field just set the attribute value:


wdContext.currentContextElement().setAbc("some string");

Of course if the attribute "abc" is not located inside the context root, the code has to be adapted accordingly.

Armin

chander_kararia4
Contributor
0 Kudos

Hi

That s correct as said by Galinski. Just keep in mind that you do create the context before usign that or else results in exception.

Best Regards

Chander Kararia

Former Member
0 Kudos

The values displayed in the fields are the values that are strored in the context.

So you can just use the normal wdContext.currentXXX.setYYY(....) API.