on 01-05-2016 2:37 PM
Hi!
I have a problem that I can't solve myself.
I have created a Web Dynpro application that uses the SAP delivered WD components for Search, ResultSet and ItemDetails. When I first load the application the ResultSet table contains all records and none is selected. The ItemDetails then displays "No records selected". When the user selects a record it is displayed in the ItemDetails as usual.
I have some custom search coding where I send the found record ids to the result set component for display which works as well but when a search returns 0 rows I want the result set to be empty and Item details to display "no records selected" again. The problem is that I can't send 0 records or null to the resultset component so old record (from previous search) remains displayed. It is possible to remove selection using ctrl-click on the selected records and then the item details is cleared again but I want to use the same function from Java API.
Any idea how to solve this?
1) I've tried sending null and an empty array to the component
using "wdThis.wdGetSearcResultInterface().setRecordIds(recordIds);"
but then it doesn't refresh at all.
2) Remove selection using context mapping to the recordsInput node and the following commands:
wdContext.nodeRecordsInput().clearSelection(); | |||||
wdContext.nodeRecordsInput().setLeadSelection(-1); | |||||
wdContext.nodeRecordsInput().invalidate() |
3) the current solution which works somewhat is to destroy the component usage each time a seach is performed and create the component instance again using
wdThis.wdGetLocationResultComponentUsage().deleteComponent();
wdThis.wdGetLocationResultComponentUsage().createComponent();
wdThis.wdGetLocationResultInterface().setRepositoryBean(_repositoryBean);
wdThis.wdGetLocationResultInterface().setConfiguration(project, locationResult);
but then i get a warning when I select a search returns zero records and I try to destroy the component that a previous record is checked out (despite only being read and not edited before).
Help me Obi-Wans, you're my only hope
Best regards,
Richard
i don't know how you use the wd component.
resultset is not updated automatically when you do the search?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I simplified my question a bit. What I have is two main tables, customer and location. The customer table uses the standard components for search, resultset and item details.
When the user selects one customer record that customer ID is used to search for locations for that customer. That search is hidden from the user and is done using the java API and the resulting record ids are set in the resultset component for location.
This far it works fine but the problem is that if the user first selects a customer with one or more locations, those are displayed correctly but if the user then selects a customer with no locations the resultset for location is not refreshed so the previous customers locations are shown.
[Customer] 1..N [Location]
Thanks, I use this now that looks alot better
wdThis.wdGetLocationResultInterface().setRecordIds(new Integer[] { RecordId.EMPTY_ID }); | |||||
wdThis.wdGetLocationResultInterface().refresh(); | |||||
wdThis.wdGetLocationDetailsInterface().setRecordId(Integer.toString(RecordId.EMPTY_ID)); | |||||
wdThis.wdGetLocationDetailsInterface().refreshComponent(); |
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.