Results 1 to 9 of 9
  1.    #1  
    I asked this question on Palm's developer forum and haven't received any responses, so I thought I'd ask here in case someone had any ideas about this.

    I'm pushing a scene passing in the disableSceneScroller argument. In this scene, I have a filterlist wrapped in a scroller widget. So when I scroll the list, it scrolls. And when I scroll the scene, it doesn't scroll. This is perfect.

    The problem is that when I start typing into the filterlist to narrow down the search results, in my callback routine that populates the filterlist, an exception is raised when I make the following call:

    Code:
    // this.listElement is my filterlist
    this.listElement.mojo.noticeUpdatedItems(offset, ret.list);
    The exception indicates that you can't reference the "mojo" property of "undefined". So for some reason "this.listElement" is undefined. When the scene loads and pulls all the data, no exceptions are generated in the callback function.

    If I remove the "disableSceneScroller" argument, no exception is generated in the callback function when typing in the filterlist. So something about the "disableSceneScroller" argument is messing up the widget object reference. Does anyone have any idea as to why this is happening?
  2. #2  
    Ok, I'm assuming you bound the filterFunction on the filterlist to the callback function. Your callback function gets passed a reference to the filter list as the second argument (arguments for filter list is: filterString, listWidget, offset, count). Therefore you can just use listWidget.mojo.noticeUpdatedItems() without bothering with the "this" object. It might solve the problem.
  3.    #3  
    Quote Originally Posted by linwiz311 View Post
    Ok, I'm assuming you bound the filterFunction on the filterlist to the callback function. Your callback function gets passed a reference to the filter list as the second argument (arguments for filter list is: filterString, listWidget, offset, count). Therefore you can just use listWidget.mojo.noticeUpdatedItems() without bothering with the "this" object. It might solve the problem.
    This is what my code originally did and it also generated the same exception. The widget itself doesn't appear to be able to be referenced regardless of how you do it.
  4. #4  
    How about giving the widget an id and trying to reference it through this.controller.get("list_id")?
  5.    #5  
    Quote Originally Posted by linwiz311 View Post
    How about giving the widget an id and trying to reference it through this.controller.get("list_id")?
    I tried that too. It comes up as "undefined". That's what strange. Like I said, the widget itself is undefined. I really think it's a bug with the filterlist widget. It only happens when page scrolling is disabled via the "disableSceneScroller" scene argument.
  6. #6  
    Quote Originally Posted by DanPLC View Post
    I tried that too. It comes up as "undefined". That's what strange. Like I said, the widget itself is undefined. I really think it's a bug with the filterlist widget. It only happens when page scrolling is disabled via the "disableSceneScroller" scene argument.
    Hmm...really weird. I'm out of ideas. Maybe somehow disabling the scroller is not allowing the list to be set up properly? Have you tried inspecting it through the inspector to ensure that the list is in the DOM?
  7.    #7  
    Quote Originally Posted by linwiz311 View Post
    Hmm...really weird. I'm out of ideas. Maybe somehow disabling the scroller is not allowing the list to be set up properly? Have you tried inspecting it through the inspector to ensure that the list is in the DOM?
    Initially it should be in the DOM or else other code referencing the widget would be generating exceptions in the scene.

    But after typing in the filterlist, I'll check the inspector to see if it's still in the DOM. Perhaps it's getting removed for some reason. But I'm not sure how this information will help me solve the problem.
  8. #8  
    Quote Originally Posted by DanPLC View Post
    Initially it should be in the DOM or else other code referencing the widget would be generating exceptions in the scene.

    But after typing in the filterlist, I'll check the inspector to see if it's still in the DOM. Perhaps it's getting removed for some reason. But I'm not sure how this information will help me solve the problem.
    Could I take a look at the full code? I can try to help debug...
  9.    #9  
    I found a way to fix the issue. In the callback function, I replaced this code:

    Code:
    widget.mojo.noticeUpdatedItems(offset, ret.list);
    with this:

    Code:
    widget.mojo.getList().mojo.noticeUpdatedItems(offset, ret.list);
    The getList() method returns the List widget component of a FilterList widget. So for some reason the noticeUpdatedItems method couldn't be called directly on the FilterList widget, but it worked when calling it on its List widget component.

    Thanks for trying to help...this one was pretty tricky.

Posting Permissions