×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    76

    unable to get text from username and password editor

    Hi
    i have created a login dialog box using resource file as follow:
    RESOURCE DIALOG r_dialog_username_password_query
    {
    flags = EGeneralQueryFlags ;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = ESetUsername;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "User Name";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 25;
    lines = 1;
    maxlength = 50;
    };
    };
    },
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = ESetPassword;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataSecondSecEd;
    label = "Password";
    control = SECRETED
    {
    num_letters = 50;
    };
    };
    }
    };
    }

    but i am unable to get the text from username and password .

    CEikSecretEditor* editorpassword = static_cast <CEikSecretEditor*> (Control(ESetPassword));
    CEikEdwin * edwinUsername = static_cast<CEikEdwin*>(Control(ESetUsername));
    HBufC* username = NULL;
    username = edwinUsername->GetTextInHBufL();
    if (editor)
    {
    TBuf<50> password;
    editorpassword->GetText(password);
    User::InfoPrint(password);
    }

    please help me.
    thanx in advance.

  2. #2
    Super Contributor
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: unable to get text from username and password editor

    use this instead of get...
    edwinUsername->Text() ;
    Regards
    $-Nitesh-$

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: unable to get text from username and password editor

    HI s_mehdi,

    This works for me..
    Code:
    TBuf<50> iDuration;
    CEikEdwin* nEditor = static_cast <CEikEdwin*> (ControlOrNull(EDuration));
    		 	if ( nEditor )
    		 		{
    		 	
    		 			nEditor->GetText(iDuration);
    		 		}

  4. #4
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    76

    Re: unable to get text from username and password editor

    unfortunately this is not working on my side.
    one thing i would like to tell that i am doing this in OkToExitL() function.
    plz some one help me regarding this issue.

  5. #5
    Super Contributor
    Join Date
    May 2005
    Location
    Hyderabad,India
    Posts
    704

    Re: unable to get text from username and password editor

    Hi,

    Can you paste OkToExitL() code here.

    Regards,
    Eswar

  6. #6
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    155

    Re: unable to get text from username and password editor

    Hi u go through this link may be helpfull for u..

    http://wiki.forum.nokia.com/index.ph...Symbian_Phones

    Regards
    Md.kashif

  7. #7
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: unable to get text from username and password editor

    Hi mehdi,

    I am also doing this in OkToExitL().

    Look at here.
    Code:
    TBool CLoginForm::OkToExitL(TInt aCommandId)
    {
    	if(aCommandId == EAknSoftkeyOk)
    	 {
    		CEikEdwin* nEditor = static_cast <CEikEdwin*> (ControlOrNull(ELoginName));
    	 	if(nEditor)
    	 	{
    	 	   nEditor->GetText(iUserName);
    	 	}
    	 	CEikSecretEditor * nEditorr = static_cast <CEikSecretEditor *> (ControlOrNull(ELoginPassword));
    	 	if(nEditorr)
    	 	{
    	 		nEditorr->GetText(iPassword);
    	 	}
    		if(iUserName == _L("") || iPassword == _L(""))
    		{
    		        CAknInformationNote* info = new (ELeave) CAknInformationNote;
    	        	info->ExecuteLD(_L("Enter both Username and Password."));
            		return EFalse;
    		}
    		else 
    		{
    		        return ETrue;
    		}
            }
    	else return EFalse;
    }
    Regards,
    Kavit.

  8. #8
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    76

    Re: unable to get text from username and password editor

    unfortuanly its not working on my side why?
    where as iUsername TBuf<50> and my resource file is
    RESOURCE DIALOG r_dialog_username_password_query
    {
    flags = EGeneralQueryFlags ;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = ESetUsername;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "User Name";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 25;
    lines = 1;
    maxlength = 50;
    };
    };
    },
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = ESetPassword;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataSecondSecEd;
    label = "Password";
    control = SECRETED
    {
    num_letters = 50;
    };
    };
    }
    };
    }

Similar Threads

  1. how to connection VPN with username and password
    By habusaimeh in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-04-19, 18:23
  2. how to implement username and password
    By venkatareddy in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-03-23, 03:33
  3. Username and password
    By koenjo in forum Multimodecards
    Replies: 0
    Last Post: 2003-08-01, 14:09
  4. Replies: 1
    Last Post: 2002-08-14, 12:29
  5. Replies: 0
    Last Post: 2002-08-14, 06: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
  •  
×