facebook

Duplicate entry for single List.append

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

    donij
    Member

    Hi Octavio,

    using mobione ul list has been very challenging to me. I still have not been able to solve the problem of the scroll panel height not changing.

    Now my latest issue is that when I try to append an item to a ul list I end up with double entries into the list.

    I have two list items… one called store and the other cart.

    When I click item in store it gets added to cart.

    I am sending the complete project to you via mail. Kindly help me out to see where the issue is. It is too simple to be frustrating.

    Thanks

    #334631 Reply

    donij
    Member

    While I wait for response from support, I just want to show code of what am dealing with if someone could spot the error in my code.

    Again I have two list controls…. one is store and the other cart. When I click an item in the storeList control I want it to be added in the cartList control.

    This is the code that runs when the document is ready just to fill the storeList with one item……

    phoneui.documentReadyHandler = function() {
    $(“#m1-testcenter2-cartList”).children().remove();//clear cartList
    var storeList = $(“#m1-testcenter2-storeList”);
    storeList.children().remove();//clear storeList
    var html = ‘<li id = “me” class=”shop”> One List Item </li>’;
    storeList.append(html);
    phoneui.preprocessDOM(“#m1-testcenter2”);
    }

    This is the jquery document code. The storeList item has a class shop, so the $(“.shop’).click event gets called when clicked as below………

    $(document).ready(function() {

    $(“.shop”).click(function() {
    var cartList = $(“#m1-testcenter2-cartList”);
    var html = ‘<li class=”incart”>Cart Item</li>’;
    cartList.append(html);
    phoneui.preprocessDOM(“#m1-testcenter2”);
    return false;
    });

    $(“.incart”).live(“click”, function () {
    $(this).remove();
    phoneui.preprocessDOM(“#m1-testcenter2”);
    return false;
    });

    });

    Using the debugger to step through I discovered the click event calls the $(“.shop”).click event twice. I guess there is something am doing wrong. Please help.

    Thanks

    #334642 Reply

    donij
    Member

    Hi,

    anyone to help with this. Thank you…

    #334646 Reply

    donij
    Member

    I moved the files to internet host site and the click runs just fine…..only one entry per click. Am thinking there is something wrong with the test center…. or probably my installation. Hope some can try this in their test center.

    Thanks.

    #334824 Reply

    donij
    Member

    Ok… I have changed my <a> tag to <input type=”button”> and I now get a single click. Though what I needed is the <a> tag. Just like I mentioned earlier it is the click event that runs twice and causes the list append function to run twice too and made it look as if it is a double entry on the list. Wayne-Octavio pls do the magic……help resolve the double click event for a single button click or <a> tag click. Clicking a list item does the double click too.

    Thanks guys.

    #334866 Reply

    @donij,

    Seems that you found out what is the problem: the double actions calls. Let’s continue that discussion in the already opened thread where you and Yann have provided us useful info 🙂

    #334868 Reply

    donij
    Member

    Ok .. Thanks.

    #337727 Reply

    renato.guiglia
    Participant

    Hi, I have the same problem with duplicate events, do you have some workaround about it?
    Where is the main discussion about it?
    Thank you.

    #337860 Reply

    Hi renato,

    The issue is being worked on now. Please see Wayne’s responses about same error reports here:
    http://www.genuitec.com/support-genuitec/viewtopic.php?p=16749#p16749
    http://www.genuitec.com/support-genuitec/viewtopic.php?p=15168#p15168

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Duplicate entry for single List.append

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