cancel
Showing results for 
Search instead for 
Did you mean: 

to get the data from database and display in textedit

Former Member
0 Kudos

hai all,

In database there is a table with data which is split and available in 5 rows.I need to get all these 5 rows displayed in the textedit UI.

When i run a loop only the last row or first row is set in the text edit.

I think array should be used for this but plz help me in creating context attribute for this and getting all the 5 rows displayed in my text edit.

Thanks n Regards

Sharanya.R

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

1)Create a value Attribute and bind it to textedit.

2)Loop through the table and concatenate all the values to a String variable

String str = " ";

for(int i =0 ; i< <table size> ;i++)

{

str = str + " " +wdcontext.node<table>.get<value>();

}

3) set the str value to tha value attribute.

wdcontext.currentcontextelement.set<valueattribute>(str);

Thanks,

Sunitha Hari

Former Member
0 Kudos

hai sunitha,

Thanks for the response.

I want the data in the 2nd row to be displayed in the next line.how this can be done.?

Thanks n Regards

Sharanya.R

Edited by: Sharanya.R on Mar 13, 2008 11:44 AM

Former Member
0 Kudos

hai sunitha,

Thanks for the response.

I want the data in the 2nd row to be displayed in the next line.how this can be done.?

Thanks n Regards

Sharanya.R

Former Member
0 Kudos

Hi,

You are using textEdit and want to wrap the next column data to next line. If so, then use the following link:

Hope this helps.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi ,

Repalce " " with '\n'

str = str + '\n' +wdcontext.node<table>.get<value>();

Thanks,

Sunitha Hari

Former Member
0 Kudos

hai manoj,

just take a look at the coding given by sunitha.In that i need each row of table to be displayed in a new line.

Thanks n Regards

Sharanya.R

Former Member
0 Kudos

Hi,

Its correct. You loop through the node size and append "\n" after every row. Finally set it to the attribute of text edit.

What is the problem now?

thanks & regards,

Manoj

Answers (0)