×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Jul 2012
    Posts
    82

    Saving data from form.

    Hi,

    I took the reference of the following link.

    http://www.developer.nokia.com/docum...Form_API4.html

    ok as per this link when i fill the from in the editable mode & after that when we press back or Save button it will call the function SaveFormDataL();

    Now as per the code we have:--

    CEikEdwin* user =
    (CEikEdwin*)Control( EMyAppControlIdTextEd );
    TDes& aUser;
    user->GetText(iData.iName);

    it means we have the control(pointer) in the row with id - EMyAppControlIdTextEd ;
    ok

    now when we call
    user->GetText(iData.iName);
    The whole content of the row will be copied to the iData.iName.
    if data is saved this function will return ETrue.

    Am i wright? Please suggest if i understood any thing wrong.

    when in from my Function after filling the data i put the check

    if( SaveFormDataL())
    {
    //launch other screen.
    but i am getting error at this point.
    }

    Please help/

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Saving data from form.

    Basially the Control returns a pointer to CCoeControl type instance, then you cast it to the correct control type, like in this case you cast it to CEikEdwin. So you could simply check SDK docs for the CEikEdwin to see what functions it implements and what they do.

    For the error, you would need to check what it is actually and then copy the description in here. Also do mention whether its compilation time error, or run time.

  3. #3
    Regular Contributor
    Join Date
    Jul 2012
    Posts
    82

    Re: Saving data from form.

    Quote Originally Posted by symbianyucca View Post
    Basially the Control returns a pointer to CCoeControl type instance, then you cast it to the correct control type, like in this case you cast it to CEikEdwin. So you could simply check SDK docs for the CEikEdwin to see what functions it implements and what they do.

    For the error, you would need to check what it is actually and then copy the description in here. Also do mention whether its compilation time error, or run time.
    Its a run time error.

    after executing the form i got:->


    CDesCArray* array = new (ELeave) CDesCArrayFlat( 8 );
    CleanupStack::PushL( array );
    array->AppendL( _L("January") );
    array->AppendL( _L("February") );
    array->AppendL( _L("March") );
    array->AppendL( _L("April") );
    array->AppendL( _L("May") );
    array->AppendL( _L("June") );
    CAknQueryValueTextArray* textArray = CAknQueryValueTextArray::NewLC();
    textArray->SetArray( *array );
    CAknQueryValueText* queryVal = CAknQueryValueText::NewLC();
    queryVal->SetArrayL( textArray );
    queryVal->SetCurrentValueIndex( 0 );

    TMyData myData;
    myData.iAnswer = _L("");
    myData.iConfirmPass = _L("");
    myData.iPass = _L("");
    myData.iName = _L("");
    myData.iQuestion = _L("");

    CAknForm* dlg = new ( ELeave ) CMyForm( myData );
    CleanupStack::PushL( dlg );
    dlg->ConstructL( 0 ); // default menu items only
    CleanupStack::Pop( dlg );
    dlg->ExecuteLD( R_MY_DIALOG );
    CleanupStack::PopAndDestroy(queryVal);

    and after this i filled all my data & pressed save.

    When i am calling
    if(SaveDataL)
    {
    }
    in the line if(savedataL) i am getting the error.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: Saving data from form.

    Any error/crash code visible while running this code?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: Saving data from form.

    I can not imagine how that example survives. These ancient casting magics are really nice, but a thing you may rather want to try is the setter-getter method pairs inherited from CEikDialog, methods like Get/SetEdwinText, like a call
    Code:
    GetEdwinText(iData.iName,EMyAppControlIdTextEd);
    for storing the editor contents of field "EMyAppControlIdTextEd" into iData.iName.

  6. #6
    Regular Contributor
    Join Date
    Jul 2012
    Posts
    82

    Re: Saving data from form.

    Quote Originally Posted by wizard_hu_ View Post
    I can not imagine how that example survives. These ancient casting magics are really nice, but a thing you may rather want to try is the setter-getter method pairs inherited from CEikDialog, methods like Get/SetEdwinText, like a call
    Code:
    GetEdwinText(iData.iName,EMyAppControlIdTextEd);
    for storing the editor contents of field "EMyAppControlIdTextEd" into iData.iName.

    I tried the get set method. But still getting the same error.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: Saving data from form.

    Quote Originally Posted by akki123 View Post
    I tried the get set method. But still getting the same error.
    Ah, now I noticed "but i am getting error at this point." in the first post. You probably know the things will happen now, questions will come like "what is the error code", perhaps someone will post a link to http://www.developer.nokia.com/Commu...ded_panic_code

Similar Threads

  1. Saving of data
    By zhenhan82 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 6
    Last Post: 2010-04-13, 06:25
  2. Hide/disable appuifw.Form after saving
    By sbn in forum Symbian
    Replies: 2
    Last Post: 2009-09-15, 10:32
  3. saving form data to database
    By lopesrohan1988 in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-02-28, 19:52
  4. problem with saving combo in form
    By zezier in forum Symbian
    Replies: 1
    Last Post: 2008-09-30, 19:03
  5. Downloading And Saving Attachment Dialog Form Code Needed
    By mubx2000 in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-10-18, 12:44

Posting Permissions

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