cancel
Showing results for 
Search instead for 
Did you mean: 

inserting table column data in input field

Former Member
0 Kudos

Hi All,

I have a requirement i have an input field beside that input field i am having select button, if i click on that button a window will open in that there is one table it has two columns column 1 contains check boxes and second column contains some code for ex: S like this i am having some 10 records in that table. Here my requirement is when i select those check boxes and click on OK button i have to concatenate those code column and display that code in input field.Can anyone help me on this issue.

Thanks,

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

amolgupta
Active Contributor
0 Kudos

Hi Rahul,

On click of the OK button you need to traverse the elements of  the Context node that is bound to the table and add the String values to a String.

Having achieved the String you just need to set your input field with the String that you achieved.

Traverse the node using a loop (for, while, do...while), use a blank string e.g. String str = ""; and set your input field context attribute to the String str.

Assuming above context Structure, the following code will need to be written -

//creating a blank string that will hold the selcted codes

String str = "";

for (int i=0; i<wdContext.nodeTableNode().size(); i++)

{

     if (wdContext.nodeTableNode().getTableNodeElementAt(i).getCheckbox())

     {

          //if checkbox is checked, adding code to String str

          str = str + wdContext.nodeTableNode().getTableNodeElementAt(i).getCode();

     }

}

//Finally set input field attribute to String Str

wdContext.currentContextElement().setInputField(str);

For your InputField to reflect in your Main view, the context attribute should be mapped via Component Controller.

I will strongly recommend SAP Training JA-310 for your query here is very basic and among the fundamental knowledge of WebDynpro Java.

You may like to read up or discuss with experts in your organisation on the following concepts-

1). Context Mapping (between views and component controller)

2). Context Binding (between context and ui elements)

3). Creating Pop up, sending data to and receiving data from pop up.

4). Actions

Thanks and Regards,

-Amol Gupta

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

don't see where the problem is.....

Former Member
0 Kudos

Hi,

Thanks for your reply this not an issue i need to achieve the above requirement.Can anyone give me some idea

Thanks,

Rahul.

junwu
Active Contributor
0 Kudos

don't know what idea you want.

just concatenate the text from different row and set it to the field......

where you are stuck? or you have no idea of web dynpro.....