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.