×

Discussion Board

Results 1 to 9 of 9
  1. #1
    ortiv
    Guest

    How can I get the current value index in popup-field?

    Hi! I've got a problem. A made a Popup-Field dialog and I would like to get the current value index after I exit. How can I get it? If anybody can solve my problem, please write this question, it's important for me. Thanx very much!

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143
    if you are using CAknPopupList with CEikTextListBox, you could get the selected item by checking the CurrentItemIndex() function of your CEikTextListBox.

    yucca

  3. #3
    ortiv
    Guest
    Symbianyucca, thank you for your advice it works great, but if possible, I'd like to get the current value with popup-filed too not only popup-list. Can you help me again? Thanks... :-)

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143
    ok, I could take a look if I could find that quicjly, basically very busy currently, but if the answer can be found in few minutes I could try helping you.

    could you speed my work on it a bit and tell me which actual classes you are working with ? makes it easier to check examples & docs.

    yucca
    Last edited by symbianyucca; 2003-12-12 at 03:08.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    I'm assuming you're using CAknPopupFieldText. Then CurrentValueIndex() is the function to call.

    Lauri

  6. #6
    ortiv
    Guest

    Thank You very much!

    Hi Yucca, Laa-Laa! Thank you very much your answers, I used CAknPopUpFieldText and it works with CurrentValueIndex(). Thank you very much again both of you.

    ortiv

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    35
    And how to do it if i am using CAknPopupField instead of CAknPopupFieldText?

  8. #8
    Regular Contributor
    Join Date
    Mar 2006
    Location
    India
    Posts
    138

    Unhappy Re: How can I get the current value index in popup-field?

    Hi

    I have written a simple form in which one of the fields is a popup field.
    But the the pop up test list is not showing up.

    RSS code:
    /*********Form*******/
    RESOURCE DIALOG r_myform_multipage_dialog
    {
    flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
    EEikDialogFlagNoTitleBar | EEikDialogFlagButtonsRight |
    EEikDialogFlagCbaButtons | EEikDialogFlagNoBorder;
    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    form = r_myform_first_form;
    //pages = r_myform_pages;
    }

    RESOURCE ARRAY r_myform_pages
    {
    items =
    {
    PAGE
    {
    //id = EMyFormPageCtrlIdPage01;
    text = "Page1";
    form = r_myform_first_form;
    },
    PAGE
    {
    //id = EMyFormPageCtrlIdPage02;
    text = "Page2";
    lines = r_myform_second_form;
    }
    };
    }

    RESOURCE FORM r_myform_first_form
    {
    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EAknCtPopupFieldText;
    prompt = "select";//"select";//qtn_options_form_label_accessPoint;
    id = EOptionsFieldAccessPoint;
    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    control = POPUP_FIELD_TEXT
    {
    popupfield = POPUP_FIELD
    {
    width = 25;
    };
    textarray = r_setting_list_item_array;
    active = 0;
    };
    }


    CPP code:
    **********
    void CMyForm::PreLayoutDynInitL()
    {
    CAknPopupField* popup = NULL;
    CCoeControl* control = ControlOrNull( EOptionsFieldAccessPoint );

    if ( control )
    {
    popup = STATIC_CAST( CAknPopupFieldText*, control );
    CDesCArray *itemList = new (ELeave) CDesCArrayFlat(3);
    _LIT(KText1,"TRUE");
    _LIT(KText2,"FALSE");
    _LIT(KText3,"NotDecided");

    TBuf<30> lmFormattedName;

    itemList->AppendL(KText1);
    itemList->AppendL(KText2);
    itemList->AppendL(KText3);



    CAknQueryValueTextArray* subjectsTextArray = CAknQueryValueTextArray::NewL();

    subjectsTextArray->SetArray( *itemList );

    CAknQueryValueText* textValues = CAknQueryValueText::NewL();
    textValues->SetArrayL( subjectsTextArray );
    // textValues->SetQueryCaption( RS_R_CLASSSUBJECT );
    textValues->SetCurrentValueIndex( 2 );
    textValues->SetQueryMode(CAknQueryValue::EQueryMode);

    popup->SetQueryValueL( textValues );
    popup->SetShowIndicatorsL(ETrue);
    popup->SetMaxNumberOfLinesPermitted(2);
    //popup->SetAutoAppend(ETrue);
    }


    }


    And I m executing th form as follows:
    CMyForm* myForm = CMyForm::NewLC();

    myForm->ExecuteLD(R_MYFORM_MULTIPAGE_DIALOG);//r_myform_multipage_dialog


    Please help

    thanks
    Regards

  9. #9
    Regular Contributor
    Join Date
    Mar 2006
    Location
    India
    Posts
    138

    Unhappy pop up text list is not showing up

    Hi

    I have written a simple form in which one of the fields is a popup field.
    But the the pop up text list is not showing up.

    RSS code:
    /*********Form*******/
    RESOURCE DIALOG r_myform_multipage_dialog
    {
    flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
    EEikDialogFlagNoTitleBar | EEikDialogFlagButtonsRight |
    EEikDialogFlagCbaButtons | EEikDialogFlagNoBorder;
    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    form = r_myform_first_form;
    //pages = r_myform_pages;
    }

    RESOURCE ARRAY r_myform_pages
    {
    items =
    {
    PAGE
    {
    //id = EMyFormPageCtrlIdPage01;
    text = "Page1";
    form = r_myform_first_form;
    },
    PAGE
    {
    //id = EMyFormPageCtrlIdPage02;
    text = "Page2";
    lines = r_myform_second_form;
    }
    };
    }

    RESOURCE FORM r_myform_first_form
    {
    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EAknCtPopupFieldText;
    prompt = "select";//"select";//qtn_options_form_label_accessPoint;
    id = EOptionsFieldAccessPoint;
    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    control = POPUP_FIELD_TEXT
    {
    popupfield = POPUP_FIELD
    {
    width = 25;
    };
    textarray = r_setting_list_item_array;
    active = 0;
    };
    }


    CPP code:
    **********
    void CMyForm::PreLayoutDynInitL()
    {
    CAknPopupField* popup = NULL;
    CCoeControl* control = ControlOrNull( EOptionsFieldAccessPoint );

    if ( control )
    {
    popup = STATIC_CAST( CAknPopupFieldText*, control );
    CDesCArray *itemList = new (ELeave) CDesCArrayFlat(3);
    _LIT(KText1,"TRUE");
    _LIT(KText2,"FALSE");
    _LIT(KText3,"NotDecided");

    TBuf<30> lmFormattedName;

    itemList->AppendL(KText1);
    itemList->AppendL(KText2);
    itemList->AppendL(KText3);



    CAknQueryValueTextArray* subjectsTextArray = CAknQueryValueTextArray::NewL();

    subjectsTextArray->SetArray( *itemList );

    CAknQueryValueText* textValues = CAknQueryValueText::NewL();
    textValues->SetArrayL( subjectsTextArray );
    // textValues->SetQueryCaption( RS_R_CLASSSUBJECT );
    textValues->SetCurrentValueIndex( 2 );
    textValues->SetQueryMode(CAknQueryValue::EQueryMode);

    popup->SetQueryValueL( textValues );
    popup->SetShowIndicatorsL(ETrue);
    popup->SetMaxNumberOfLinesPermitted(2);
    //popup->SetAutoAppend(ETrue);
    }


    }


    And I m executing th form as follows:
    CMyForm* myForm = CMyForm::NewLC();

    myForm->ExecuteLD(R_MYFORM_MULTIPAGE_DIALOG);//r_myform_multipage_dialog


    Please help

    thanks
    Regards

Posting Permissions

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