on 07-01-2012 7:39 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
don't see where the problem is.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.