Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Warnings with KitchenSink Search Events?

Alright so here's the code:

    // SEARCH BAR EVENTS
    search.addEventListener('change', function(e)
    {
        e.value;
    }); 
    search.addEventListener('return', function(e)
    {
        e.value;
        search.blur();
    });
    search.addEventListener('cancel', function(e)
    {
        search.blur();
    });

And here are the warnings in the console:

[WARN] JavaScript compiler reported "Expected an assignment or function call and instead saw an expression." at main/search.js:473
[WARN] JavaScript compiler reported "Expected an assignment or function call and instead saw an expression." at main/search.js:477

Anybody know what the problem is? I know it's the two "e.value;"s, but I have no idea how to fix it and those two warnings are really getting annoying (I enjoy seeing all blue in the Titanium console!)

— asked September 21st 2010 by Colton Arabsky
  • search
  • searchbar
0 Comments

3 Answers

  • Accepted Answer

    Try this:

    // SEARCH BAR EVENTS
        search.addEventListener('change', function(e)
        {
            return e.value;
        }); 
        search.addEventListener('return', function(e)
        {
            search.blur();
        });
        search.addEventListener('cancel', function(e)
        {
            search.blur();
        });
    
    — answered September 23rd 2010 by James K
    permalink
    0 Comments
  • Bump

    — answered September 22nd 2010 by Colton Arabsky
    permalink
    0 Comments
  • assign e.value to some variable & make that variable use as u needed in ur code

    …varun

    — answered September 23rd 2010 by Varun Atluri
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.