cancel
Showing results for 
Search instead for 
Did you mean: 

set textbox /label value during runtime

Former Member
0 Kudos

set textbox/label value during runtime

Accepted Solutions (1)

Accepted Solutions (1)

former_member189631
Active Contributor
0 Kudos

Hi,

Please follow these steps to set Text/Label Value:

1)Create a context attribute say "textVal".

2)Let the type of this attribute is string. (Default type is string).

3)Create a Label/TextView UI element.

4)Label has the property called "text".

5)Bind ur context attribute (TextVal) with this text property in the label.

6)Write the code to set value fot these text.

Regards,

Ramganesan K.

Answers (4)

Answers (4)

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

I guess you seek information about creating text/label UI element randomly.

follow this code,

IWDTransparentContainer tCont = (IWDTransparentContainer)view.getRootElement();

IWDLabel lab = (IWDLabel)view.createElement(IWDLabel.class,<name>);

lab.setText(<nameto be displayed>);

tCont.addChild(lab);

for textbox i.e inputfield replace Label with InputField.

hope it helps.

regards,

Abhijeet

Abhinav_Sharma
Contributor
0 Kudos

Hi,

you can set the label/textbox dynamically: write following code in wdDoModify method of ur webdynpro application.

IWDTextView tx = (IWDTextView) view.getElement("textviewid");

tx.setText("My Text View");

IWDLabel lab = (IWDLabel) view.getElement("labelid");

lab.setText("My Label");

Plz rewards point.

Abhinav Sharma

Former Member
0 Kudos

this can only be done in do modify right....

IWDTextView tx = (IWDTextView) view.getElement("textviewid");

tx.setText("My Text View");

IWDLabel lab = (IWDLabel) view.getElement("labelid");

lab.setText("My Label");

abhijeet_mukkawar
Active Contributor
0 Kudos

yeah this can only be done in Modify().

Abhinav_Sharma
Contributor
0 Kudos

Hi yzme,

wdDoModify is the plcae where you can play with the UIElements. here you can create new elemnts, get a refernce to already created elemnts and also set their properties.

So, whenever u want to handle uielements dynamically you can handle it in wdDoModify.

Hope it helps

Abhinav Sharma

Former Member
0 Kudos

You want to change the label dynamically ??

Bind the Text property of the label to a valueAttribute .

Regards,Anilkumar

Former Member
0 Kudos

Your question is not clear..pl explain in detail

-Anilkumar