on 01-18-2008 11:03 AM
Hello all,
I am trying to do the following:
I have a table on a page, which has 3 columns. When a user selects a row, and clicks on the button find, a popup window will appear, and the user can click through some fields. At the end, the user selects a value, and clicks on a button.
When that button is pressed, the selected value has to be inserted into the 2nd column of the row the user selected.
How can I do that? One big problem is, that I don't have the context available. The columns for the table are not defined in the context statically, I guess dynamically. (I am modifying an existing web dynpro)
Thanks in advance!
Hi,
Do you atleast know the name of the attribute that is bound to the second column? If yes then you can simply get the element at lead selection for the datasource node of the table and set that attribute with the selected value from the user
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The coordinates of a table cell in the selected row are given by
- lead selection of data source node
- Attribute(s) to which the cell editor properties for that column are bound
Example:
Data source node "Rows"
Attribute "text"
Column 2 editor: InputField with "value" bound to "Rows.text"
Then you can access the value using
wdContext.nodeRows().currentRowsElement().getText();
or the corresponding generic context API, if the context is created programmatically or typed access was switched off.
Armin
I know how to do it when I have the context available, unfortunately, that's not the case. It's done dynamically, and I can't seem to be able to get access to the dynamic context. At least, I am not succeeding as of yet...
So suppose you have value node in the context.
That value node is all you have, but to that value node, dynamically, new thigns have been added, which leads to a table in the UI.
How can I change values of elements in that table?
The source code is a little too complex for me right now, since it's a standard SAP scenario (CATS). The table is filled through an rfc connection.
Anyhow, i have found some more info, that maybe lets you help me more:
When i go to the NodeInfo, and from there do:
IWDAttributeInfo attInfo = timesheetInfo.getAttribute("RAUFNR_Value");
It exists, so I guess I have found the attribute i need to change (RAUFNR_Value).
If i have that, and the node is in timesheetData, and the nodeInfo is in timesheetInfo, how do I change the attribute RAUFNR_Value ?
Unfortunately, that's not possible.
However, I seem to have come closer to a solution:
Like I said in my first post, a user selects a row, then clicks on a button, then selects a value, and then clicks on a button again to put the value from the popup window into the corresponding cell in the table.
Now, when I add the following code to the function that shows the popup window, the corresponding cell gets filled:
IWDNode timesheetData = wdThis.wdGetFcCatRecordInterface().wdGetAPI().getContext().getRootNode().getChildNode("TimesheetData", IWDNode.LEAD_SELECTION);
timesheetData.getCurrentElement().setAttributeValue("RAUFNR_Value", "12345");
However, when I add the exact same code to the method that gets fired when a user selects a value and clicks on the button in the popupwindow , i get a java.lang.NullPointerException on the setAttributeValue bit.
If you can solve that last bit, I think I'm good to go!
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.