How can I get value on a control in a multiline data Query dialog

Login to reply to this topic.
Tue, 2005-05-31 13:13
Joined: 2005-02-22
Forum posts: 39
Hi

How can I get value on a control in a multiline  data Query dialog 

I mean to say .. i  want to read  the  data  entered by the user in a Multiline Data Query Dialog  .. any  code samples  will  be of  great help

please also tell me how to make pointer to the  control

Regards
Veeraj

Tue, 2005-05-31 13:37
Joined: 2005-05-11
Forum posts: 83
Re: How can I get value on a control in a multiline data Query
try this code

CEikEdwin *pCtrlUrlEditor=static_cast <CEikEdwin*> (ControlOrNull(ESettingsFormUploadUrl));

ESettingsFormUploadUrl - is ID of control
Wed, 2005-06-01 07:12
Joined: 2005-02-22
Forum posts: 39
Re: How can I get value on a control in a multiline data Query
Hi   grey

CEikEdwin *pCtrlUrlEditor=static_cast <CEikEdwin*> (ControlOrNull(ESettingsFormUploadUrl));

It doesnot work for me

what does this mean ESettingsFormUploadUrl   

gives error ' ControlOrNull'  is undeclared identifier

I  am using following code for making dialog ...
................................................................
appui .cpp
................................................................

  TBuf<20> aQueryTxt;   
   aQueryTxt=_L("Test Query");
   CAknMultiLineDataQueryDialog *dlg = CAknMultiLineDataQueryDialog::NewL(aQueryTxt,aQueryTxt,CAknQueryDialog::ENoTone);
   dlg->ExecuteLD(R_USERNAME_PASSWD_DIALOG);
...
....  here I want to  read the data enterd by user
...........................................................................
from  .rss file
..........................................................................

RESOURCE DIALOG r_username_passwd_dialog
  {
  flags = EGeneralQueryFlags;
  buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
  items =
    {
    DLG_LINE
      {
      type = EAknCtMultilineQuery;
      id = EMultilineFirstLine;
      control = AVKON_DATA_QUERY
        {
        layout = EMultiDataFirstEdwin;
        label = "User Name";
        control = EDWIN
          {
       
          width = 5;
          lines = 5;
          maxlength = 128;
     };
        };
      },
    DLG_LINE
      {
      type = EAknCtMultilineQuery;
      id = EMultilineSecondLine;
      control = AVKON_DATA_QUERY
        {
        layout = EMultiDataSecondEdwin;
        label = "Password" ;
        control = EDWIN 
          {
          width = 5;
          lines =5; 
          maxlength = 128;
          };
        };
      }
    };
  }
.........................................................................

I want to read the data in the following controll fields ..... EDWIN  both

1) EMultilineFirstLine

2) EMultilineSecondLine

please suggest the way ....

Any code sample will be of great help   

Regards
Veeraj thaploo l


Wed, 2005-06-01 08:01
Joined: 2005-05-11
Forum posts: 83
Re: How can I get value on a control in a multiline data Query
You must use control ID.
Like EMultilineFirstLine or  EMultilineSecondLine
I write you what ESettingsFormUploadUrl is my control ID from my dialog.
Then you must specificate rigth tipe of you control in my exemple it CEikEdwin for you it CEikEdwin too.
So you must write:

CEikEdwin *pCtrlUrlEditor=static_cast <CEikEdwin*> (ControlOrNull(EMultilineFirstLine));
Wed, 2005-06-01 08:33
Joined: 2005-01-31
Forum posts: 122
Re: How can I get value on a control in a multiline data Query
Code:
CAknMultiLineDataQueryDialog *dlg = CAknMultiLineDataQueryDialog::NewL(aQueryTxt,aQueryTxt,CAknQueryDialog::ENoTone);

U shud use aQueryTxt and aQueryPwd here.......not just aQueryTxt..........afterall u have 2 fields not 1.

Code:
dlg->ExecuteLD(R_USERNAME_PASSWD_DIALOG);
shud be TInt ret = dlg->ExecuteLD(R_USERNAME_PASSWD_DIALOG);
then

if (ret == EEikBidOk)
{
     //aQueryTxt and aQueryPwd will now hold the values you need
}
Wed, 2005-06-01 14:56
Joined: 2005-02-22
Forum posts: 39
Re: How can I get value on a control in a multiline data Query
Hi   grey

I  am  using this code

CEikEdwin *edwin = STATIC_CAST(CEikEdwin*,dlg->ControlOrNull(EMultilineFirstLine));
                  edwin->GetText(readtext);

This is not giving any syntex error but linking error ie unresolved " public: class CCoeControl * __thiscall CEikDialog::ControlOrNull(int)const "

if I use directly what u suggested   ie this code

CEikEdwin *pCtrlUrlEditor=static_cast <CEikEdwin*> (ControlOrNull(ESettingsFormUploadUrl));

it gives  some  syntex error  like undefined  ControlOrNull

i am not getting unpatient  now ... not able to do this simple thing

Please guys do help

Thanks & Regards
veeraj thaploo



Wed, 2005-06-01 15:12
Joined: 2005-05-11
Forum posts: 83
Re: How can I get value on a control in a multiline data Query
I use this
CEikEdwin *pCtrlUrlEditor=static_cast <CEikEdwin*> (ControlOrNull(ESettingsFormUploadUrl));
inside my class what was delived from dialog.
You use this function outside. It is about compil error.

About linker:
You must add library (what contain implemetion of CEikDialog::ControlOrNull(int)const function) in your project. It is eikdlg.lib library
Wed, 2005-06-01 16:38
Joined: 2005-01-31
Forum posts: 122
Re: How can I get value on a control in a multiline data Query
Go to Cipher example in Series60Ex and check out the EncryptL function in AppUi to see how it's done.
Also, you've got a mistake in your resource.
Code:
layout = EMultiDataSecondEdwin;
        label = "Password" ;
        control = EDWIN 
control shouldnt be EDWIN......should be password I guess Roll Eyes
Thu, 2005-06-02 11:50
Joined: 2005-02-22
Forum posts: 39
Re: How can I get value on a control in a multiline data Query
Thanks kurtrips / grey

  did it .... both ways ...

once again thanks a lot .... it  is a great forum ....  Smiley

Regards
Veeraj Thaploo
  • Login to reply to this topic.