Results 1 to 4 of 4
  1.    #1  
    I have a list setup in a scene with swipeToDelete set to true. I also have a Mojo.Event.listDelete listener that does several things, one of which is check to see if the user has rights to delete the item.

    If the user doesn't have rights, I can't seem to figure out how to undo the delete so that the list item appears again. I thought I could change the delete property that is added to the model to false, but that doesn't seem to work.

    Any suggestions???
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  2.    #2  
    bump
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  3. #3  
    Hey Lax,

    I think you should check if the user has rights BEFORE You set the swipetodelete to true. If you can do that, then they can't even begin to swipe.

    The only other thing I can think of is: Add an if statement encompassing the entire delete listener. Once they delete, check to see if they have the rights. If they don't, the app doesn't do anything. The UI, however, will ALWAYS delete the list item that has been swiped, however, a quick reload of the page will bring the item back.

    You could always do that (and popup a message telling the user they don't have the rights to delete the item, it will return next time they visit the app page) or something similar to that.

    Good Luck!
  4.    #4  
    Hello SirataXero,

    Let me clearify...
    This scene will be used for user management. In order to get to this scene the user has already been qualified as an admin. This means that the user can delete other users from the list. A restriction is that they can't delete his/her self. I thought about removing them from the list all together, but tapping on the list item activates a popup that allows editing of user information. If I remove the user from the list they won't be able to edit their own information.

    The solution I came up with so far is very similar to what you proposed. The initial list is populated in the activate function when the scene launches. If a user tries to delete his/her self, the listener callback function pops an error dialog explaining that they can't do that and a call is made to the the activate function again which reloads the list. It works quite nicely actually, but I was hoping to save an additional call to the server by managing it on the app side.
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Posting Permissions