×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328

    Listbox observer not called!?

    I am trying to implement a listbox observer as follows:

    iListbox = new(ELeave) CAknDoubleLargeStyleListBox;
    iListbox->SetListBoxObserver(this);

    I have also implemented HandleListBoxEventL as follows:

    void CBaseListbox::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
    {
    if (aEventType == EEventItemClicked)
    {
    // TBD
    }
    }

    The problem is, it is never called... I must be missing something obvious? All I want to do is detect when a user selects different items in the list and when this happens I need to change the list of available menu items (depending on the selected item).

    Any ideas?

  2. #2
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36

    Re: Listbox observer not called!?

    1. Your container must inherit from MEikListBoxObserver.
    2. You must call iListBox->OfferKeyEventL(aKeyEvent, aType) in the OfferKeyEventL(aKeyEvent, aType) function of your container class.

  3. #3
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328

    Re: Listbox observer not called!?

    Yeah, sorry, I didn't post my header source. So...

    1. Yes I do this
    2. Yes I also do this

    I am able to navigate up or down in the listbox. The problem is that my HandleListBoxEventL is just not called, at all!

  4. #4
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36

    Re: Listbox observer not called!?

    Just a hunch.

    Did you return EKeyWasConsumed in the OfferKeyEventL function.

    Try

    return (iListBox->OfferKeyEventL(aKeyEvent, aDataType));

  5. #5
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Listbox observer not called!?

    hi,

    well u haven't implemented HandleListBoxEventL properly..

    paste ur header and entire .cpp file so that we can get to ur solution...

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

Similar Threads

  1. Query ~ Listbox | functional but no text
    By series60nubee in forum Symbian
    Replies: 5
    Last Post: 2006-03-24, 06:09
  2. problem in Agenda Observer
    By symnew in forum Symbian
    Replies: 0
    Last Post: 2005-05-26, 06:28
  3. Using a "custom" listbox in mobile s60
    By ctpthanh in forum Symbian User Interface
    Replies: 4
    Last Post: 2005-04-17, 14:46
  4. Hide Listbox not working with MakeVisible(EFalse)
    By Salvesh in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-02-04, 05:04
  5. listbox and model
    By stenlik in forum Symbian
    Replies: 1
    Last Post: 2004-05-27, 07:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×