Skip to Content
avatar image
Former Member

set textbox /label value during runtime

set textbox/label value during runtime

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Mar 21, 2007 at 08:13 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 21, 2007 at 07:57 AM

    You want to change the label dynamically ??

    Bind the Text property of the label to a valueAttribute .

    Regards,Anilkumar

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 21, 2007 at 08:21 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Mar 21, 2007 at 07:55 AM

    Your question is not clear..pl explain in detail

    -Anilkumar

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 21, 2007 at 08:31 AM

    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

    Add comment
    10|10000 characters needed characters exceeded