Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2003

    custom data query dialog problem


    I am using a custom data query dialog to prompt for text and read the entered text.

    TBuf<KMaxGameNameLength> gameName;
    _LIT(KTempDesc1, "Naveen");
    //CAknTextQueryDialog* gameNameQuery = CAknTextQueryDialog::NewL(gameName);
    //the above line works and displays "Naveen" while showing the dialog
    CMyDlg* gameNameQuery = CMyDlg::NewL(this, gameName);
    //the above line doesnt work and doesnt display "Naveen" while showing the dialog
    if (gameNameQuery->ExecuteLD(R_DATAQUERY_DATA_QUERY))
    with my custom dialog i am not gettig the data entered in the dialog.

    Other code is

    class CMyDlg: public CAknTextQueryDialog

    CMyDlg::CMyDlg(TDes& pStr):CAknTextQueryDialog(pStr)

    what could be the problem?
    why i am facing issues when i am using my own dialog?

    My dialog resource is:
    RESOURCE DIALOG r_dataquery_data_query
    items =
    type = EAknCtQuery;
    id = EDataQueryDlgCIdDataQuery;
    control = AVKON_DATA_QUERY
    layout = EDataLayout;
    control =
    width = KMaxGameNameLength;
    lines = 1;
    maxlength = KMaxGameNameLength;

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003

    Re: custom data query dialog problem

    I think it is impossible to answer if you don't provide the more implementations details on your own dialog. Anyway, would it be a lot easier to use the S60 dialogs in there ?

  3. #3
    Regular Contributor
    Join Date
    Mar 2003

    Re: custom data query dialog problem

    sorry for not providing complete details.

    after debugging i could figure out the problem and solution.
    details are as:

    1) If CAknTextQueryDialog instance is directly used for displaying and querying text, everything works fine. i.e,
    CAknTextQueryDialog* gameNameQuery = CAknTextQueryDialog::NewL(gameName);
    - gameName will show the text what is set before calling ExecuteLD() and
    - gameName will contain the text user entered after coming out of ExecuteLD()

    2) If a derived class (from CAknTextQueryDialog) is used for displaying and querying text, it behaves in a different way - i.e,
    CMyDlg* gameNameQuery = CMyDlg::NewL(this, gameName);
    Neither text contained in gameName will be displayed nor the text entered by user is copied to gameName after ExecuteLD.

    there is a slight different tweak to get the entered text
    In OkToExitL() we have to use
    TBool CMyDialog::OkToExitL(TInt aButtonId)
    CAknQueryControl* control = static_cast<CAknQueryControl*>(ControlOrNull(EDataQueryDlgCIdDataQuery));
    CEikEdwin* editor = static_cast<CEikEdwin*> ( control->ControlByLayoutOrNull( EDataLayout ) );
    if (editor)

    If we have to set pre-text for the dialog, we have to do similar changes in PreLayoutDynInitL() method.

    The dialog definition in rss file remains the same as i have given earlier.


Similar Threads

  1. Replies: 9
    Last Post: 2010-06-10, 12:39
  2. Query dialog cancel problem
    By s4028469 in forum Symbian
    Replies: 2
    Last Post: 2007-09-25, 00:34
  3. Data query dialog problem
    By microdot in forum Symbian
    Replies: 0
    Last Post: 2007-03-01, 14:56
  4. Replies: 2
    Last Post: 2004-09-15, 22:47
  5. Problem with number query dialog (BAFL 4)
    By Fek in forum Symbian User Interface
    Replies: 3
    Last Post: 2003-07-02, 10:11

Posting Permissions

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