×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    WRTKit problem with getNext() in 5800

    The following code crashes on my 5800 on the red line:

    Code:
    function fillListOfContacts(searchtext)
    	{
    	emptyContactArrays();
    	try 
    	    {
    	    var phonebook = device.getServiceObject("Service.Contact", "IDataSource");
                } 
    	catch(e) 
    	    {
    	    return (sFillListOfContactsError + " (001) : " + e);
    	    }
    		
    	// Set search criteria
    	var criteria = new Object();
    	criteria.Type = "Contact";
    	if(searchtext.length > 0)
    	    {
    	    criteria.Filter = new Object();
                criteria.Filter.SearchVal = searchtext;
    	    }
     	
    	// Get the contacts with the specified criteria
            try 
    	    {
                contacts = phonebook.IDataSource.GetList(criteria);
        	    } 
    	catch(err) 
    	    {
                return sFillListOfContactsError + " (002) : " + err;
        	    }
    	if(contacts.ErrorCode != 0) 
    	    {
                // If error code is not "no suitable items", show alert.
                // Otherwise leave the function.
                if(contacts.ErrorCode != NO_ITEMS_ERROR_CODE) 
    	       {
                   return sFillListOfContactsError + " (003) : " + contacts.ErrorMessage;
                   }
                return sFillListOfContactsError + " (004) : " + contacts.ErrorCode;
        	    }
    		
    	var contact;
    	items = contacts.ReturnValue;
    	while ( (contact = items.getNext()) != undefined )
    	    {
    	    name = "";
    	    //	Only contacts with a mobile phone number
    	    if(contact.MobilePhoneGen != undefined)
    	 	{
    		if(contact.FirstName != undefined) 
    			{
    			name += contact.FirstName.Value + " ";
    			}
    		if(contact.LastName != undefined)
    			{
    			name += contact.LastName.Value;
    			}
    		if(name.length > 0)
    			{
    			iContactButtonNames.push(name);
    			}
    		else
    			{
    			iContactButtonNames.push(contact.MobilePhoneGen.Value);
    			}
    		iContactMsisdn.push(contact.MobilePhoneGen.Value); 
    		}
    	    }
    	    return "";		//	Empty string
    	}
    The code looks 100% correct from spec point of view. It actually works OK on Aptana's Nokia WRT and on various devices in RDA (including 5800 handsets).

    My guess is that this is a bug in the firmware version of my 5800 (latest one available). This version has already giving me some problems with the radio as well. I wonder if someone can confirm this in order to send a bug report to Nokia.
    ----------------------------------------------
    Every journey starts with a small step.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: WRTKit problem with getNext() in 5800

    Hi,

    this is a bug, as also reported on this thread:

    http://www.forum.nokia.com/forum/sho...d.php?t=170839

    Pit

  3. #3
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    Re: WRTKit problem with getNext() in 5800

    thanks jappit. I'd better move the discussion to that thread.
    ----------------------------------------------
    Every journey starts with a small step.

Similar Threads

  1. PKG problem! CRE file install on 5800
    By leo_woo in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 13
    Last Post: 2010-04-26, 14:56
  2. NOKIA 5800 UPDATE PROBLEM
    By TurboAndy in forum General Development Questions
    Replies: 1
    Last Post: 2010-01-28, 04:08
  3. Nokia 5800 system problem :(
    By TuningTwentyfive in forum General Development Questions
    Replies: 5
    Last Post: 2009-10-14, 23:16
  4. XML loading problem with Nokia 5800
    By jeremija in forum [Archived] Flash Lite on Nokia Devices
    Replies: 9
    Last Post: 2009-09-11, 13:07

Posting Permissions

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