×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Displaying Information In a form from Listbox Item

    I am creating listbox, after selecting an item from the list box (Click On it) i am going to form after finishing the form I want to be able to return back to the list box with the same position Item , how I can achive this ? The current application now have only (APPui) and (AppView) without forms ,shall I create the form in a separate class? Please provide your answer by code example.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Displaying Information In a form from Listbox Item

    Can you create a form? (Note that there is a 'form' example in pre-3rd edition S60 SDK-s)
    If yes, you are ready: forms do not need to interact with your view architecture, just ExecuteLD them, and that is all. And yes, you need implement a class derived from CAknForm.

  3. #3
    Regular Contributor
    Join Date
    Nov 2005
    Location
    Amman/Jordan
    Posts
    322

    Re: Displaying Information In a form from Listbox Item

    Quote Originally Posted by wizard_hu_
    Can you create a form? (Note that there is a 'form' example in pre-3rd edition S60 SDK-s)
    If yes, you are ready: forms do not need to interact with your view architecture, just ExecuteLD them, and that is all. And yes, you need implement a class derived from CAknForm.

    can u explain more ..?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Displaying Information In a form from Listbox Item

    Which part? The name of the example is 'form'. If you are working with a 3rd edition SDK, you may find forms in IsvTelInfoApp and LocationLandmarksRefAppForS60 examples.

  5. #5
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Quote Originally Posted by wizard_hu_
    Can you create a form? (Note that there is a 'form' example in pre-3rd edition S60 SDK-s)
    If yes, you are ready: forms do not need to interact with your view architecture, just ExecuteLD them, and that is all. And yes, you need implement a class derived from CAknForm.
    some times it gives access violation run-time error on the following line:

    TBuf<100> FromText;
    FromText.Copy(_L("mub@xx.com.sa"));
    HBufC* BufFrom;
    BufFrom=FromText.AllocL();
    TPtrC ptrFrom(FromText);
    STATIC_CAST( CEikEdwin*, ( iEmailForm->Control(ESocketsEmailFromEdwin) ) )
    ->SetTextL( &ptrFrom );//---->Line wher it stops the application say access violation reading location error

    In the rss file here is the syntax:

    RESOURCE DIALOG r_email_form_dialog
    {
    flags = EEikDialogFlagNoDrag |
    EEikDialogFlagNoTitleBar |
    EEikDialogFlagFillAppClientRect |
    EEikDialogFlagCbaButtons |
    EEikDialogFlagModeless;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    //buttons = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    form = r_email_form_detail;
    }


    RESOURCE FORM r_email_form_detail
    {
    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EEikCtEdwin;
    id = ESocketsEmailFromEdwin;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "From:";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 200;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    };
    },
    //--->CC
    DLG_LINE
    {
    type = EEikCtEdwin;
    id = ESocketsEmailCCEdwin;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "CC:";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 300;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    id = ESocketsEmailDateEdwin;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "Date:";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 127;
    lines = 1;
    maxlength = 100;
    default_input_mode = EAknEditorTextInputMode;
    };
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    id = ESocketsEmailSubjectEdwin;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "Subject:";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    };
    },
    DLG_LINE
    {
    //
    //
    type = EAknCtMultilineQuery;
    id = ESocketsEmailBodyEdwin;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstEdwin;
    label = "Message Body:";
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 20;
    maxlength = 10000;
    default_input_mode = EAknEditorTextInputMode;
    };
    };
    }
    };
    }

    About the return back from the form to the listbox in the same (Item clicked Index) how I write code to manage it? , Do You Have an Idea about some event called (IdoFocusControl()) ? If you have please give me code illustration about it.

  6. #6
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Displaying Information In a form from Listbox Item

    Hi!
    What exactly u wanna do with form.
    Can u plz tell precisely 1s again.

    If u wanna set the parameter values when the form is being displayed u can do it some other simpler ways.
    Let me know what exactly u wannn do first so that I can tell u to the point.
    Ok
    Regards,
    Shilpa Kulkarni

  7. #7
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Quote Originally Posted by Shilpa13
    Hi!
    What exactly u wanna do with form.
    Can u plz tell precisely 1s again.

    If u wanna set the parameter values when the form is being displayed u can do it some other simpler ways.
    Let me know what exactly u wannn do first so that I can tell u to the point.
    Ok
    OK , I have some Information Lets say : Name,Number,Address,email,Phone Number , When I retrieve the Information the list box display only the name and the number on its raws (There is no problem on this Issue) , when the user click on the listbox I want the application to display all the other information (Name,Number,Address,email,Phone Number ) in a form and when the user return back to the listbox I want to focus on the same position (Index) where the user click on to get the information details that's all the story.

  8. #8
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Displaying Information In a form from Listbox Item

    Hi!
    1. For List

    . U can get the selected item index in Listbox b4 executing the form.
    . Use CurrentItemIndex() for it. Keep it saved.
    . After executing form Use SetCurrentItemIndex(TInt aItemIndex) for
    hilighting the same index as before.

    2. For Form

    . I hope u r saving the data for all the item somewhere.(e.g database)
    . While executing the form, get all the details for the particular contact from
    database.
    . Use those parameter values in PreLayoutDynInitL() of ur form.
    . N then u can use the functions of CEikDialog which is a dialog base
    class to set the values. e.g.U can use SetEdwinTextL(--).

    Check the OpponentForm example for details.
    See the class CEikDialog for more details.

    Hope this helps u.
    Regards,
    Shilpa Kulkarni

  9. #9
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    I create Now The Form But It breaks when It starting display here is the code:

    The Header file:

    class CEmailForm : public CAknForm
    {
    public: // Constructors and destructor

    /**
    * Destructor.
    */
    CEmailForm();
    virtual ~CEmailForm();



    private:
    TInt iCurrentId;
    /**
    * From CAknForm

    };

    The RSS:
    RESOURCE DIALOG r_email_form_dialog
    {
    flags = EEikDialogFlagNoDrag |
    EEikDialogFlagNoTitleBar |
    EEikDialogFlagFillAppClientRect |
    EEikDialogFlagCbaButtons |
    EEikDialogFlagModeless;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    //buttons = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    form = r_email_form_detail;
    }


    RESOURCE FORM r_email_form_detail
    {
    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "From:";
    id = ESocketsEmailFromEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 200;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    //--->CC
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "CC:";
    id = ESocketsEmailCCEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 300;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "Date:";
    id = ESocketsEmailDateEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 127;
    lines = 1;
    maxlength = 100;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "Subject:";
    id = ESocketsEmailSubjectEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    //
    //
    type = EAknCtMultilineQuery;
    prompt = "Message Body:";
    id = ESocketsEmailBodyEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 20;
    maxlength = 10000;
    default_input_mode = EAknEditorTextInputMode;
    };
    }
    };
    }

    The Cpp:
    iEmailForm = new ( ELeave ) CEmailForm;
    CleanupStack::PushL(iEmailForm);
    iEmailForm->ConstructL();
    CleanupStack::Pop();
    // This is the enclosing parent control for the dialog.
    // Execute the dialog following the data in the resource file.
    iEmailForm->ExecuteLD(aResourceId);///--->Here It Breaks


    How Resolve this problem?

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Displaying Information In a form from Listbox Item

    A note: you can test the resource with CAknForm:
    Code:
    CAknForm *form=new(ELeave)CAknForm;
    CleanupStack::PushL(form);
    form->ConstructL();
    CleanupStack::Pop(form);
    form->ExecuteLD(R_EMAIL_FORM_DIALOG);
    if it works (appears, etc.) you can start to implement the code.

  11. #11
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Quote Originally Posted by wizard_hu_
    A note: you can test the resource with CAknForm:
    Code:
    CAknForm *form=new(ELeave)CAknForm;
    CleanupStack::PushL(form);
    form->ConstructL();
    CleanupStack::Pop(form);
    form->ExecuteLD(R_EMAIL_FORM_DIALOG);
    if it works (appears, etc.) you can start to implement the code.

    Thanks wizard_hu it works now but the problem is that I cannot edit or scroll throught the form fields how I can scroll and move ? which events in (CAknform) do this? about returning back to the list box how I return to the same Index position on the listbox after the form lost focus?

  12. #12
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Hi wizard_hu

    I forgit something , since ther is (5) fields on the form it display only (3) of them how I display the complete full form?

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Displaying Information In a form from Listbox Item

    I do not really know. My form resources are starting with:
    Code:
    RESOURCE DIALOG r_apro_dialog
    {
    flags = EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagCbaButtons;
    title = "AproDialog";
    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    form = r_apro_form;
    }
    
    RESOURCE FORM r_apro_form
    {
    flags = /*EEikFormEditModeOnly |*/ EEikFormUseDoubleSpacedFormat;
    items =
    {
    ...
    and it is scrollable/editable with CAknForm...

  14. #14
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Quote Originally Posted by wizard_hu_
    I do not really know. My form resources are starting with:
    Code:
    RESOURCE DIALOG r_apro_dialog
    {
    flags = EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagCbaButtons;
    title = "AproDialog";
    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    form = r_apro_form;
    }
    
    RESOURCE FORM r_apro_form
    {
    flags = /*EEikFormEditModeOnly |*/ EEikFormUseDoubleSpacedFormat;
    items =
    {
    ...
    and it is scrollable/editable with CAknForm...

    I do it like this now:

    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "From:";
    id = ESocketsEmailFromEdwin;
    control = EDWIN
    {
    //EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
    width = 200;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };

    But still I'm not able to edit?

  15. #15
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    364

    Re: Displaying Information In a form from Listbox Item

    Now It becomes scroolable but not editable here is the code:

    RESOURCE DIALOG r_email_form_dialog
    {
    flags = EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagCbaButtons;
    buttons = R_AVKON_SOFTKEYS_CANCEL;
    //buttons = R_AVKON_SOFTKEYS_OK;
    //buttons = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
    form = r_email_form_detail;
    }


    RESOURCE FORM r_email_form_detail
    {
    flags = EEikFormUseDoubleSpacedFormat;
    items =
    {
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "From:";
    id = ESocketsEmailFromEdwin;
    control = EDWIN
    {
    //EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
    width = 200;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    //--->CC
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "CC:";
    id = ESocketsEmailCCEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 300;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "Date:";
    id = ESocketsEmailDateEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 127;
    lines = 1;
    maxlength = 100;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = "Subject:";
    id = ESocketsEmailSubjectEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 1;
    maxlength = 1000;
    default_input_mode = EAknEditorTextInputMode;
    };
    },
    DLG_LINE
    {
    //
    type = EEikCtEdwin;
    prompt = "Message Body:";
    id = ESocketsEmailBodyEdwin;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 1000;
    lines = 20;
    maxlength = 10000;
    default_input_mode = EAknEditorTextInputMode;
    };
    }
    };
    }

    And I couldn't copy the Values inside the form fields?

Similar Threads

  1. Prototype SDK 2.0 setup problem
    By jackmcardle in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2007-01-09, 16:21
  2. Replies: 7
    Last Post: 2006-10-07, 07:53
  3. display form on click of listbox item
    By Kapil Kaushik in forum Symbian
    Replies: 0
    Last Post: 2006-03-16, 09:38
  4. Listbox & Form
    By tukaram in forum Symbian
    Replies: 1
    Last Post: 2005-06-28, 05:24
  5. Form not displaying
    By Shabs in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-07-09, 16:38

Posting Permissions

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