facebook

Another issue with custom list example

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #325067 Reply

    cmstephan
    Member

    Hi,
    the custom list works fine now with the update to 1.5 version.

    If I am using a simple action on the ListItem it works perfect:
    – using

    data-action-click-id = "actionx"

    within the list
    – catching inside the

    prePageTransition

    – using

    $(event.srcElement).attr('data-listitem-index');

    to get the index

    BUT if I add an Icon in the listItem, add an Event to it and try to use it the same way the Action will be called twice

    <img id="XXX" class="m1-clickable" src="res/images/001_status_stop.png" data-action-click-id="action5" data-listitem-index="' + i + '"/>';

    Any idea how to adress that issue?

    Thanks
    Christopher

    Attachments:
    You must be logged in to view attached files.
    #325079 Reply

    support-michael
    Keymaster

    @cmstephan

    I haven’t had time to sync w/ octavio re: you code example but there is one issue that we need to look into that seems to be caused by multiple calls to preprocessDOM(). It seems this could be causing redundant event handler registration. Give us some time to investigate this tomorrow.

    #325086 Reply

    cmstephan
    Member

    Hi,
    I tested some more things and figuered out that there is some more strange behaviour.
    I added an button on the screen with the list and even there the action gets triggered twice.
    If you jump back and forth between the dialogs and press the button the action gets triggered even more times.

    It looks like that there is something wrong with the event handler.
    It would be perfect if you could have a look and find a solution as soon as possible.

    Thanks
    Christopher

    Attachments:
    You must be logged in to view attached files.
    #337771 Reply

    renato.guiglia
    Participant

    Hi, i have the same problem, do you found any solution?

    #337781 Reply

    support-michael
    Keymaster

    @cmstephan
    This issue is probably the result of calling preprocessDOM() on existing nodes. A key function of preprocessDOM() is to bind actions to widgets. If you call preprocessDOM on the same node repeatedly redundant bindings are created. Thus, 1 event my have duplicate actions bound to it. The immediate solution is to call preprocessDOM only on newly created nodes.

    If you have a different situation please post code snippet or better a small example project that demonstrates the issue.

    Lastly: we are evaluating the preprocessDOM() approach and how to improve it.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Another issue with custom list example

You must be logged in to post in the forum log in