on 04-04-2006 4:11 PM
Hello everyone:
I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?"
/people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro
I've called an RFC and created a table with data coming from it (which is also a table). My question is, if in this table there's a field named "UserType" there are two possible values for this field:
"userA"
"userB"
How can I get the table only show me the "userA" registers? The RFC does return all of the users, but when filling the table, can I put an if-else somewhere on my code?
Thanks a lot
Alejandro
Hi,
Table UI Element provides Filter action which can be used on any column. In your case we need to have usertype as a column and then have Filter data to display the values based on the usertype.
refer: http://help.sap.com/saphelp_nw04/helpdata/en/0e/23b3c8b0a238439f664f73a04e6332/frameset.htm
Hope that helps.
Regards,
S.Divakar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Divakar:
Thanks for your answer. As I see, I should use the onFilter Action on my Table right? Will this also help me in case that I need an slightly more complex filtering, for example, if a column has values and I only want to display the registers which those values start with a substring?
Thanks a lot
Alejandro
Hi,
The Filter value is of type String so you should have any issues.
refer:
http://help.sap.com/saphelp_nw04/helpdata/en/0e/23b3c8b0a238439f664f73a04e6332/frameset.htm
Hope that helps.
Regards,
S.Divakar
Hi Alejandro,
Referring to the link provided "The logic of the filter process is not implemented in Web Dynpro. The application developer must implement the action to be executed."
We would have to implement the action onFilter in the controller implementation. Ideally, we fill the data retrieved from backend into a List (java.util.List) (this could be done on init of view) and then subset the list after meeting the criteria in the action handler(say
onActionFilterData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent).
Having done this, you may bind the output list back to the node (shown in table)
Regards,
Chaitanya
Hello:
When I apply the "Table" template as a result of the RFC, the table is filled. I suppose a for loop is somewhere hidden where I can override the normal fill and set an if-else clause, is that right?
I don't mean the user can choose which filter to apply, but that only the correct registers are shown, no choose for the user
Thanks!
Alejandro,
You are right, if you intend to see only the filtered results, you may have to add the code which iterates over the node and checks the substring condition for each element.
This could be written in the init method of view controller. If you are unsure about how to do this, please let me know your email address so that I could email you the project which does it.
Regards,
Chaitanya
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.