×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList type li

    I have following lines to create a multi-selection listbox

    Code:
    
    void CTestList::MakeListBoxL()
    	{
    	iListBox = new ( ELeave ) CAknSingleGraphicStyleListBox(); 
    	iListBox->ConstructL( this, EAknListBoxMultiselectionList| EAknListBoxLoopScrolling ); 
    	
    	iListBox->SetContainerWindowL( *this );
    	
    	iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
    	iListBox->CreateScrollBarFrameL( ETrue );
    	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
    
    	iListBox->SetListBoxObserver( this );
    	
    	SetupListBoxIconsL();
    	
    	iListBox->SetFocus( ETrue );
    	}

    But when I select an item in the listbox, HandleListBoxEventL() is not get called. What might be the reason for that? Thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Is this class TestList derived from CCoentrol?, if yes then is it added on stack? Also you can check if OfferKeyEventL() gets called by making any key event on the list.

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Thanks vineet for your reply.

    Quote Originally Posted by vineet.jain View Post
    Is this class TestList derived from CCoentrol?, if yes then is it added on stack? Also you can check if OfferKeyEventL() gets called by making any key event on the list.
    yes, it is derived from CCoeControl..
    Code:
    class CTestList : public CCoeControl, public MEikListBoxObserver
    {
    };
    It has been added to stack by calling AddToStackL() and it's OfferKeyEventL() gets called. I really don't understand why HandleListBoxEventL() is not get called. Is there something special to do with EAknListBoxMultiselectionList type? thanks

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    there should be no magic there really. Anyway, how is the selection handled ? the listbox event should be claled when you click the listbox, and not if you just select the item some other way.

    Also Newer have had this problem, and would not think the fix suggested is required, but can you try what is suggested at: http://stackoverflow.com/questions/6...ist-5th-ed-sdk

  5. #5
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Thanks symbianyucca for reply. If I just replace EAknListBoxMultiselectionList with EAknListBoxSelectionList everything works perfectly. So I just get confused what's the matter with EAknListBoxMultiselectionList ?

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Quote Originally Posted by slinx View Post
    Thanks symbianyucca for reply. If I just replace EAknListBoxMultiselectionList with EAknListBoxSelectionList everything works perfectly. So I just get confused what's the matter with EAknListBoxMultiselectionList ?
    that behavior beats me as well.. I propably did not really use the EAknListBoxMultiselectionList too much ever, so haven't seen such a behaviour..

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Specifying the platform may be a good idea. It may happen that in cursor-less (touch-based) platform variants marking items in a multi-selection list can be done via tapping on them, and if this is the case there might be no accompanying event (at least the slightly older documentation on http://www.developer.nokia.com/docum...31c8545d8fbeeb does not list one).
    So this is exactly the case where old devices with a mark/pencil/shift key probably behave differently than touch based ones.

  8. #8
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Thanks wizard_hu_ for replying. I was trying on S60 3rd FP2(E5-00). Interestingly same code works on touch device ( N8 ), i.e. HandleListBoxEventL() get called. Any ideas? thanks

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    What is teh excat use case there ? I would assume that you could get the even for selection in keyevents handler with the non-touch devices.

  10. #10
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Quote Originally Posted by symbianyucca View Post
    What is teh excat use case there ? I would assume that you could get the even for selection in keyevents handler with the non-touch devices.
    create a list with option to select more than one items (for multi-selection listbox I use EAknListBoxMultiselectionList) by pressing enter key/double click. In touch device HandleListBoxEventL() is called with event type EEventItemClicked and EEventPenDownOnItem. But in non touch device the method is not get called. Thanks

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    And did you check the offerkeyvent function already in the non-touch ?

  12. #12
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    This documentation explains quite well as how to create a markable listbox: http://www.developer.nokia.com/docum....html#topic3.8

    I took reference from the same & called SelectItemL(currentindex) or DeselectItem(currentindex) to select or deselect an item, & called these from offerkeyEvent's OK event.

  13. #13
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: why HandleListBoxEventL() is not get called for EAknListBoxMultiselectionList typ

    Quote Originally Posted by symbianyucca View Post
    And did you check the offerkeyvent function already in the non-touch ?
    yes

    Quote Originally Posted by vineet.jain View Post
    This documentation explains quite well as how to create a markable listbox: http://www.developer.nokia.com/docum....html#topic3.8

    I took reference from the same & called SelectItemL(currentindex) or DeselectItem(currentindex) to select or deselect an item, & called these from offerkeyEvent's OK event.
    Ok... as I see this one uses EAknListBoxMarkableList and I am using EAknListBoxMultiselectionList.

Similar Threads

  1. HandleListBoxEventL not being called when enter key pressed
    By TorrinLynn in forum Symbian User Interface
    Replies: 17
    Last Post: 2010-08-06, 03:34
  2. Replies: 3
    Last Post: 2009-06-01, 09:43
  3. Replies: 9
    Last Post: 2009-01-27, 13:55
  4. HandleListBoxEventL/HandleControlEventL not being called
    By nimco in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-11-11, 12:58
  5. EAknListBoxMultiselectionList
    By hanymt in forum Symbian
    Replies: 0
    Last Post: 2006-11-15, 10:14

Posting Permissions

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