cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.List -> again click selected item

Former Member
0 Kudos

Hello,

i have a split app.

Master sap.m.List --> Sub-Master sap.m.List

The Master navigates to the Sub-Master, the Sub-Master opens the detail view.

On the Sub-Master shows a Nav-Button back and navigates back to the Master-List.

I am using src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js

My problem is when navigating back from the Sub-Master, that I can not select the "selected" item on the Master again (and navigate forward).

Here is part of the master - i put all the methods I tried... When testing I just let one method in the code...


<List

  id="list"

  mode="{device>/listMode}"

  items="{/tabWorkPlace}"

  press="handleListSelect"

  itempress="handleListSelect"

  select="handleListSelect"

  >

  <ObjectListItem

  press="handleListItemPress"

  tab="handleListItemPress"

  title="{Description}"

However, the only thing which listens is from List the select method, the others don't work...

And with this select method I can not "re-select" the active item and navigate to the subpage.

List Mode is listMode : (jQuery.device.is.phone) ? "None" : "SingleSelectMaster".

What am I doing wrong...?

BR and thanks a lot!

Denise

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Denise,

"My problem is when navigating back from the Sub-Master, that I can not select the "selected" item on the Master again (and navigate forward)."

When navigating back from Sub-Master you should see that the listitem you selected before is still selected.

Solution for your problem (which is working for me):
Deselect listitem before navigating to Sub-Master

  1. handleListSelect: function (evt) {
  2.     var context = ...
  3.     ----
  4.     // Deselect "listItem" to enable reselecting after pressing back button in Sub-Master
  5.     evt.getParameter("listItem").setSelected(false);
  6.     this.nav.to("SubMaster", context);
  7. }

Regards,

Edwin

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Denise,

I had the same problem, however I could fix it adding in the select method the following lines:


var oList = sap.ui.getCore().byId(listId);

var oSelectedItem = oList.getSelectedItem();

oList.setSelectedItem(oSelectedItem,false); // This action deselects item and allow you select the item again


Regards
Pablo

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Denise,

we experienced the same problem some weeks ago and did not find a solution for it. A selected item will not fire the select event again. But it also does not fire press, tap or other events.

I would think that this is an error or a missing feature. Although an item is selected I expect that the events press, itempress, tap etc. are still fired.

Cheers,

Mark

Former Member
0 Kudos

I have the same problem. Still can't solution for this one.