on 07-01-2015 3:34 PM
Hi guys,
I was faced with a problem I almost don't know how to explain. This is the gist:
I have a View with two row repeaters. The first RowRepeater shows a list of available users that you can add to a Project Team (using a button). The second RowRepeater shows the current team.
So, each row in the first rowRepeater has a Button to create a new element in the second row repeater, and that's it - it doesn't do anything else.
Both row repeaters are limited to 5 rows.
The list of available users in the first row repeater is big, so you automatically get a page down and page up button you can navigate through the results (default behavior for the row repeater).
Here is the problem:
When the 2nd RowRepeater is empty, everything works fine.
When I add one user to the team (that is, one row appears in the 2nd row repeater), when I push the "Page Down" button in the first row-repeater, it duplicates 4 users from the previous page everytime.
If I add another user to the team (2 rows in the 2nd row repeater), the first row repeater duplicates 3 results when I navigate to the next page everytime.
If I add another user to the team (3 rows in the 2nd row repeater), the first row repeater only duplicates 2 results when paged down, and so on....
If both row repeaters have 5 rows, everything works fine (no duplications).
I even changed the 2nd row repeater to allow more than 5 rows, just to make sure and... guess what happens when the 2nd row repeater shows 6 rows.
That's right, the first Row Repeater, when paged down, missed one result (so literary a user that should be available disappeared)
If the second RowRepeater has 7 rows, the first one misses two results when paged down... and so on and so on and so on.
There is no code for this in my view. I honestly don't even know if you can control the behavior of the Page Down and Page Up Button, but this behavior is not normal, I believe.
My question for you: Have you ever come across something like this? I believe this may be a bug that I would like to report to SAP, but first I'd like to get your feedback on this matter.
Best Regards
Hi guys.
The lack of answers means that either I wrote too much ( ) or that this never happened to anyone else. I hope SAP follows up on this issue so this situation can be corrected.
In the meantime, for anyone that has the issue, I though about it and here are two possible workarounds so this doesn't happen.
1st workaround: Replace the second row-repeater with a table (if possible)
I tested it and it doesn't cause any duplication problems in the first row-repeater.
The problem is that the graphic proprierties of a table are a bit more limited than what a row-repeater is capable of.
2nd workaround: Create invisible elements in the second row-repeater
As I said previously, depending on the number of rows in the second row-repeater, the number of duplicated results changes.
I found that, when the number of row in the 2nd row-repeater matches the number of maximum visibile rows in the first row-repeater, it doesn't duplicate any results. (Remember, if max visible rows are 5, it duplicates 5-X rows, being X the number of rows in the 2nd row repeater). If you just make X go to 5, it duplicates 0 rows. So... you can populate your node with multiples of 5, even if some of them are not visible.
So, 1st step: Both row-repeaters must have the same max number of visible rows (lets say Y)
2nd step: Create a visiblity attribute in your node.
3rd step: fill the node with your data.
4th step: if node.size() > 0, calculate the number of missing elements until it becomes a multiple of Y.
5th step: create the elements until it reaches a multiple of Y with WDVisibility.NONE.
Aditional step: everytime your node changes, you're gonna have to delete the invisible rows and perforrm steps 4 and 5 again.
Code example (with visibile rows == 5)
Integer remain = 5 - wdContext.nodeVnMyNode().size() % 5;
remain = remain == 5 ? 0 : remain; // in this case size() is a multiple of 5;
for(int i = 0; i < remain; i++){
IVnMyNodeElement new = wdContext.nodeVnMyNode().createAndAddVnMyNodeElement();
new.setVaVisibility(WDVisibility.NONE);
}
To delete these rows:
for(int i = 0; i<wdContext.nodeVnMyNode).size();i++){
elemento = (IVnMyNodeElement) wdContext.nodeVnMyNode().getElementAt(i);
if(elemento.getVaVisibility()!= null && elemento.getVaVisibility() == WDVisibility.NONE){
wdContext.nodeVnMyNode().removeElementAt(i);
i--;
}
}
I hope this is usefull.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here are the requested screenshots.
Example 1:
Example 2:
Depending on the ammount of people I have in the 2nd row repeater, it duplicates a different ammount of users in the first row repeater.
I noticed that, being X the number of users in the 2nd row repeater, the first rowRepeater duplicates 5-X users from the previous page (except when X = 0, than it doesn't duplicate any).
I'm gonna try replacing the second row-repeater with a table just to see what happens.
[EDIT] So yeah, I replaced the second row repeater with a table. Now everything works fine. The first row-repeater doesn't duplicate results anymore - the problem I have now is that a table is not so "pretty" as the row-repeater.
So, am I doing something wrong or it this really a bug in the SAP Portal?
Best Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
could you please add couple of screenshots for better understanding ?
Thank you and Regards,
Ervin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.