cancel
Showing results for 
Search instead for 
Did you mean: 

textfield which is made dynamic

Former Member
0 Kudos

hi everyone,

I have written the following code in wdModifyView()

/* ask factory to create anonymous text view */

IWDTextView tv = (IWDTextView) view.createElement(IWDTextView.class, null);

/* bind property for showing text */

tv.bindText("context-attribute-path");

/* add inside parent container */

parent.addChild(tv);

-


i am getting the error parent cannot be resolved

i want complete steps from starting onwards.

kyan................

Accepted Solutions (1)

Accepted Solutions (1)

brahmanandam_ausali
Participant
0 Kudos

hi mani,

check this code.

IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("RootUIElementContainer");

IWDTextView tv = (IWDTextView)view.createElement(IWDTextView.class,"TextView");

cell1.bindText(wdContext.node<URNode>().getNodeInfo().getAttribute("URvalueattribute");

container.addChild(tv);

thanks and regards

Brahmanandam ausali

Former Member
0 Kudos

What is "cell1"?

Yes, using method bindText(IWDAttributeInfo) instead of bindText(String) is better style because it avoids using a string literal for the context path. But it gets somewhat useless if you specify the attribute name by a string literal instead of the generated constant.

Armin

Answers (3)

Answers (3)

Former Member
0 Kudos

Don't take my sample code too literally.

The variable "parent" should contain a reference to the container where you want to insert the text view.

(I hope you replaced "context-attribute-path" by the path to the context attribute that should be displayed in the text view)

Armin

arun_srinivasan
Contributor
0 Kudos

hi,

Check this out

wdModifyView()

if (firstTime)

{

IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");

// CREATION OF TEXTVIEW

IWDTextView textview1=(IWDTextView)view.createElement(IWDTextView.class,"textview");

textview1.setEnabled(true);

textview1.setText("Dynamic created Textview");

con.addChild(textview1);

}

Regards,

Arun

Yashpal
Active Contributor
0 Kudos

Hi ,

u have to get the reference of container i.e parent....

*****

IWDTransparentCOntainer parent=(IWDTransparentContainer)view.getElement("containername ")

then u can add the child i.e UI control in it

parent.addchild(childname);

Regards,

Yash

Message was edited by: Yashpal Gupta