Skip to Content
author's profile photo Former Member
Former Member

sap.m.List -> again click selected item

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jul 20, 2014 at 04:13 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 15, 2015 at 03:18 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2014 at 01:44 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.