Welcome to the CrackBerry Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 3 of 3
  1. TheStoof's Avatar
    CrackBerry Addict

    Posts
    696 Posts
    Global Posts
    701 Global Posts
    Thread AuthorThread Author   #1  

    Default What to do if you delete the last item in a list?

    I'm 90% finished my app, but if you delete the last item in the list, the best that I can do now is that I disable the button that directed you to the list page. Once the user hits back, they have to use a different button to add data then they can see the list again.

    You can't pop() off the page using the signal because my updatePage has a signal and when you save, it pops off, so the signal can't pop off prematurely.

    Unfortunately, the ListView is under a Page, which itself is under a NavPane. Only NavePans have "onPopTransitionEnded".
  2. big bb's Avatar
    CrackBerry Abuser

    Posts
    394 Posts
    Global Posts
    396 Global Posts
    #2  

    Default

    Quote Originally Posted by TheStoof View Post
    I'm 90% finished my app, but if you delete the last item in the list, the best that I can do now is that I disable the button that directed you to the list page. Once the user hits back, they have to use a different button to add data then they can see the list again.

    You can't pop() off the page using the signal because my updatePage has a signal and when you save, it pops off, so the signal can't pop off prematurely.

    Unfortunately, the ListView is under a Page, which itself is under a NavPane. Only NavePans have "onPopTransitionEnded".
    I guess I am extremely tired, I seem to miss what it is that you need to finish
    Sorry, Could you clarify a little more?
    Quote Originally Posted by G-bone View Post
    BlackBerry : We invented the Smartphone Business.
    We're takin' it Back!
  3. TheStoof's Avatar
    CrackBerry Addict

    Posts
    696 Posts
    Global Posts
    701 Global Posts
    Thread AuthorThread Author   #3  

    Default

    Quote Originally Posted by big bb View Post
    I guess I am extremely tired, I seem to miss what it is that you need to finish
    Sorry, Could you clarify a little more?
    I suppose I should be more clear. I was too lazy to type it all.

    Here's my design:

    main.qml (NavPane) -> addData.qml (Page) then pop back to NavPane

    or

    main.qml (NavPane) -> viewData.qml (Page with ListView) -> [addData.qml (Page or updateData.qml (Page, delete or remove data)]

    If the ListView's GroupDataModel is empty, the main.qml will disable the viewData button. That's fine. However, if I am viewing viewData.qml, and there's one entry that I wish to delete, and I delete it, then it pops me back to an empty list. If you close the list, then you're back to main.qml that prevents you from going back to the list.

    Question 1: Is it acceptable to leave the user looking at an empty list where he/she can add back some data?

    Question 2: If no above, then how can I automatically pop ALL open panes/pages to go back to main.qml (NavPane) IFF the GroupDataModel is empty after deleting.

    onCreationCompleted: {} doesn't seem to work for pretty much anything I use it for.

    Code:
    if (myListView.dataModel.size() == 0) {
                if (btViewDataProperty) {
                    btViewDataProperty.enabled = false
                    btViewDataProperty.text = "No Data"
                }
            }
    This code is used in a JavaScript signal called by the updateData.qml page whenever an item is deleted. It works because the button on the main.qml page is disabled if the count is 0. Moving this code to onCreationCompleted: {} does nothing simply because onCreationCompleted: {} is used only when the ListView page is created, not updated. Also, within updateData.qml, after an update and/or delete, the page is popped off and destroyed.

    Question 3: Is there a signal that can be used within a Page {} similar to onPopTransitionEnded: {}? The NavigationPane has it.

    Question 4: Would it be wise to use a NavigationPane to push another NavigationPane that houses a ListView that opens the addData.qml/updateData.qml that then when popped off, the second NavigationPane is its parent?

Similar Threads

  1. What to do if BB Travel doesnt run on the 9780
    By saymen in forum BlackBerry OS Apps
    Replies: 3
    Last Post: 05-16-2011, 02:05 PM
  2. What to do if your BlackBerry Got Wet ? The Solution
    By Ahmed G. in forum BlackBerry Curve 8900
    Replies: 0
    Last Post: 05-20-2010, 01:48 PM
  3. Replies: 11
    Last Post: 06-30-2009, 04:40 PM
  4. Replies: 11
    Last Post: 06-30-2009, 04:40 PM
  5. What to do if handset reconcile doesnt work
    By gosling in forum General BlackBerry Discussion
    Replies: 1
    Last Post: 08-05-2008, 06:43 AM

Posting Permissions