Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Nested lists with same parent text resolve to the same sub-page. #1617

Closed
@dharrod

Description

@dharrod

Not sure if this has already been posted, but I couldn't find it.

I have a page with two list views. Each list view has an item with a nested list. The text of the parent item of the nested list is the same in each list view. The 'safe name' generated for the sub-page hash for both parent items resolves to the same name. So when viewing one of the sub-lists causes the wrong sub-list to be displayed. It looks like the sub-page hash is adding an index to help provide uniqueness for the sub-page hash, but the index is only for a given listview. When the next listview is encountered, the index resets and since the parent text is the same, the resulting sub-page hash conflicts with the sub-page list for the item in the previous list view.

Here is my example: (Not sure how to quote HTML source, but this looks the best...)

  <div data-role="page">
    <div data-role="header">
        <h1>Title</h1>
    </div><!-- /header -->

    <div data-role="content">   
        <ul data-role="listview" data-inset="true">
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Parent Item<ul data-role="listview">
                    <li>Sub Item 10</li>
                    <li>Sub Item 11</li>
                    <li>Sub Item 12</li>
                </ul>
            </li>
        </ul>
        <ul data-role="listview" data-inset="true">
            <li>Item 3</li>
            <li>Item 4</li>
            <li>Parent Item<ul data-role="listview">
                    <li>Sub Item 20</li>
                    <li>Sub Item 21</li>
                    <li>Sub Item 22</li>
                </ul>
            </li>
        </ul>
    </div><!-- /content -->
</div><!-- /page -->

Note that when viewing the 'Parent Item' in the first list-view, the sub-list from the second 'Parent Item' is displayed. In looking at the link url, the hash values are the same: '#&ui-page=Parent-Item-0'.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions