cancel
Showing results for 
Search instead for 
Did you mean: 

TextEdit in a Table

Former Member
0 Kudos

Hi,

I have a value node Objectives with a value attribute called Objective type string where user can enter multiple lines and some other attributes also. I want to get multiple values from the user.

Since TextEdit cannot be used in a table, I have put an add button in the view. When user clicks on Add button each time, I create the TextEdit Control dynamically in the view which is bound to the value attribute Objective of value node Objectives and create a blank record in the value node Objectives.

My problem is if user clicks on the Add button multiple times and enter some values in the TextEdit Control, How do I update the correct record of the node Objectives?

I would appreciate any help in this matter

Thanks.

Regards,

Suresh.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks Everybody. I will be using approach suggested by Valery and would like to close the thread.

Regards,

Suresh.

Former Member
0 Kudos

Hi Valery,

That would have been my last approach. Is this the only way to solve this problem?

Regards,

Suresh.

Armin,

Your suggestion does not solve the problem.

Former Member
0 Kudos

My suggestion is to create only one text edit element and use it to edit the attribute of the current (lead selected) node element.

Armin

Former Member
0 Kudos

Hi,

I am working on a requirment where i am using textEdit as a cell in tableView.

Every thing is working fine except i am unable to capture the data from textEdit.

I have to store the multiple lines entered by user into a z-table column of type

XSTRING. For that i am trying with

column_index = 8.

lv_lines = tv_event_data->get_cell_value( row_index = ws_selectedrows-index column_index = column_index ).

concatenate CL_ABAP_CHAR_UTILITIES=>cr_lf space into lv_translate.

translate lv_lines using lv_translate.

concatenate CL_ABAP_CHAR_UTILITIES=>newline space

into lv_translate.

translate lv_lines using lv_translate.

condense lv_lines.

But still after this i find some characters in the string, so i am able to store only partial string. not compelte string(which is multiple lines).

If anybody has expereinced the same and solved can help me.

I really appreciate and alot points for suitable answer.

thanks for the help.

Regards,

Pra

Former Member
0 Kudos

Please ask in the WD ABAP forum.

Armin

Former Member
0 Kudos

Suresh,

You are take wrong approach: in your case all TextEdit controls will display the very same lead selected element of value node Objectives.

You need to create separate node attribute dynamically for every TextEdit control(except first one, probably). Then you bind every new TextEdit to newly created attribute. Now, when user enters all data, you may get necessary "table" values from these attributes.

VS

Former Member
0 Kudos

You don't have to create the TextEdit dynamically. If you bind the TextEdit.text property to an attribute inside the table's data source, it will always reference the lead selected node element.

So you could

- create the TextEdit at designtime and place it beside/below the table

- Bind TextEdit.text property to the "Objective" attribute

- Bind TextEdit.readOnly to a calculated attribute of type boolean that returns "true" if the table has no lead selection

Armin

Former Member
0 Kudos

Hi Suresh,

If you want to access the selected element from the node you can do it by means of

wdContext.current<node name>Element().get<Attribute>()

Regards

Rohit