cancel
Showing results for 
Search instead for 
Did you mean: 

List: Different behaviour in 1.14 and 1.18

0 Kudos

Hi guys,

Recently i upgraded the library from 1.14 to 1.18 and i realised a strange behavior for sap.m.List.

Code:

<List mode="SingleSelectMaster" select="handleSelect"...>


The handleSelect will be fired when the user selects on any item in the list. It will bring user to a detail page.


In the past, the function handleSelect will always be fired when the user does the following:

1. Selects a list item,

2. HandleSelect is fired and brings user to detail page.

3. User navigates back to the detail page.

4. Select the same list item (in Step 1)

5. HandleSelect is fired again (same as Step 2).


Now in 1.18,

1. Selects a list item,

2. HandleSelect is fired and brings user to detail page.

3. User navigates back to the detail page.

4. Select the same list item (in Step 1)

5. HandleSelect is never fired. It is only fired if I select a different list item.


Could someone explain me why?

How could I persistent whenever user selects a list item?




Accepted Solutions (0)

Answers (2)

Answers (2)

former_member195440
Participant
0 Kudos

Hi,

Not sure what the default was in 1.14 but that selection mode in 1.18 should do exactly what you describe. Have a look here for the selection modes - OpenUI5 SDK - Demo Kit.

In my experience, "SingleSelectMaster" is used for master detail layouts where you see both at the same time and wouldn't necessarily want to do selection of the same detail page multiple times.

For phone however, or scenarios where you want the selection to lead onto the detail, the mode "None" is used to prevent the selection "sticking" and the user not being able to select the same row again after navigating back.

This is usually done with a "device" model bound to the List's mode property. Have a look at the source code behind the sap.m.Explored app demo (Component.js file) to see this in action.

Additionally, use the "selectionChange" event rather than "select" or "press" and "select" is deprecated and "press" (on the List) won't work as you want it to!

I am not sure on your use case for persisting selections, as standard these should be "MultiSelect" or "SingleSelect" modes

Hope this helps,

Oli

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Can you also see this discussion

also rememberSelections property got added with 1.18 SAPUI5 SDK - Demo Kit

Check by setting it to false.

Regards,

Chandra

0 Kudos

Hi,

I have tried setting both attributes:

<List press="handleTest" includeItemInSelection="true"rememberSelections="false" …>

But it does not work...

handleTest only gets fired on different selection but not on the same selection...

0 Kudos

Actually I tried all combinations of value for both includeItemInSelection and rememberSelections. But they just don't work.