Hi,

I have created a simple form derived from CAknForm with some simple EDWIN dialog-lines in it. On pressing the OK-button on one of these lines I create a new form with multiple pages on it. For the second form I create a new CEIkEdwin editor for every page and fill these editors with some text.

And nor my problems:

1. After creating the second form the first form ist still in front of the display and I have to click on the back softkey to see the second form.
2. The text of the editor on the first multipage of the new form is shown correct, but when I go to the other pages I have to press an other key (up or down key) to show their text correct.

What did I do wrong? Please help me!

Here is the shortened code of the first form:
Code:
void CRoamingMenuForm::ConstructL()
	{
	CAknForm::ConstructL ();	
	}

void CRoamingMenuForm::PreLayoutDynInitL()
    {
    CAknForm::PreLayoutDynInitL();
    ConfigureFieldsL();    
    }

TKeyResponse  CRoamingMenuForm::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
	{
	if(aType != EEventKey)
        {
        return EKeyWasNotConsumed;
        }
    switch(aKeyEvent.iCode)
        {
        case EKeyOK: // display an information note when item is selected
            {
            // Gets the ID of the Control having Focus //
            TInt focusedControlId = IdOfFocusControl();
            switch(focusedControlId)
            {
            case ERoamingData:
            	{
            	CRoamingDataForm* roamingDataForm = CRoamingDataForm::NewL();
				roamingDataForm->ExecuteLD(R_ROAMING_DATA_DIALOG);
            	break;
            	}
            default:
            	break;
            }
            }
        default:
        	return CAknForm::OfferKeyEventL(aKeyEvent, aType);
            break;
        }
    return EKeyWasNotConsumed;
	}

void CRoamingMenuForm::ConfigureFieldsL()
	{
	//initialize fields on start

	}
Here is the code for the second form:
Code:
void CRoamingDataForm::ConstructL()
{
	//Create backgroundcontext
	TRect rect = CEikonEnv::Static()->EikAppUi()->ClientRect ();
	iBgContext = CAknsBasicBackgroundControlContext::NewL (
			KAknsIIDQsnBgAreaMain, rect, ETrue);
	CAknForm::ConstructL ();
	}

void CRoamingDataForm::PreLayoutDynInitL()
    {	
	InitializeEditor (ECallToEditor, R_CALL_TO_TEXT);
	InitializeEditor (ECallFromEditor, R_CALL_FROM_TEXT);
	InitializeEditor (EMessagesEditor, R_MESSAGES_TEXT);

	CAknForm::PreLayoutDynInitL ();
    }

TKeyResponse  CRoamingDataForm::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
	{
	if(aType != EEventKey)
        {
        return EKeyWasNotConsumed;
        }
    switch(aKeyEvent.iCode)
        {
        case EKeyOK: // display an information note when item is selected
            {   
            return CAknForm::OfferKeyEventL(aKeyEvent, aType);
            break;
            }
        default:
        	return CAknForm::OfferKeyEventL(aKeyEvent, aType);
            break;
        }
    return EKeyWasNotConsumed;
	}
 
 void CRoamingDataForm::InitializeEditor(TInt aControlId, TInt aResourceId)
	 {
	 iFormatLayer = CEikonEnv::NewDefaultCharFormatLayerL ();
		TCharFormat charFormat;
		TCharFormatMask charFormatMask;
		iFormatLayer->Sense (charFormat, charFormatMask);
		charFormat.iFontPresentation.iTextColor=KRgbBlack;
		charFormatMask.SetAttrib (EAttColor);
		iFormatLayer->SetL (charFormat, charFormatMask);
	 
	 textEd = (CEikEdwin*)Control( aControlId );
	 textEd->SetCursorPosL(0, EFalse);
	 textEd->SetFocus(EFalse);
	 textEd->SetCharFormatLayer(iFormatLayer);
	 textEd->SetSkinBackgroundControlContextL(iBgContext);
	 
	 HBufC* msg1 = iEikonEnv->AllocReadResourceLC(aResourceId);
	 TBuf<1000> agbText1(*msg1);
	 textEd->SetTextL( &agbText1 );
	 CleanupStack::PopAndDestroy(1);
	 }
And here is the code from resource file:

Code:
RESOURCE DIALOG r_roaming_form_dialog
	{
	flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
	EEikDialogFlagNoBorder |EEikDialogFlagCbaButtons;
	buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
	title = qtn_currency_form_title;
	form = r_roaming_form;
	}
	
RESOURCE FORM r_roaming_form
	{
	flags = EEikFormShowBitmaps | EEikFormUseDoubleSpacedFormat;
	items =
		{
		DLG_LINE_INDIRECT
			{
			line = r_dlg_line_roaming_data;
			}
		};
	}
RESOURCE DLG_LINE r_dlg_line_roaming_data
	{
	type = EEikCtEdwin;
	id = ERoamingData;
	control = EDWIN
		{
		flags = EEikEdwinDisplayOnly;
		maxlength = KAmountMaxTextFieldLength;
		};
	}
	
RESOURCE DIALOG r_roaming_data_dialog
	{
	flags = EEikDialogFlagFillAppClientRect|
	EEikDialogFlagNoBorder|EEikDialogFlagCbaButtons;
	buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
	pages = r_roaming_data_pages;
	}
	
RESOURCE ARRAY r_roaming_data_pages
	{
	items =
		{
		PAGE
			{
			id= ECallToPage;
			text = qtn_call_to;
			lines= r_roaming_data_call_to_form;
			},
		PAGE
			{
			id= ECallFromPage;
			text = qtn_call_from;
			lines = r_roaming_data_call_from_form;
			},
		PAGE
			{
			id= EMessagesPage;
			text = qtn_messages;
			lines= r_roaming_data_messages_form;
			}
		};
	}

RESOURCE ARRAY r_roaming_data_call_to_form
{
items =
   {
      DLG_LINE
      {
      id = ECallToEditor;
      type = EEikCtEdwin;
      control = EDWIN
         {
         flags = EEikEdwinReadOnly;
         lines = 12;
         max_view_height_in_lines = 5;
         base_line_delta = 21;
         maxlength = KAmountMaxTextFieldLength;
     	 avkon_flags = EAknEditorFlagEnableScrollBars;
         };
      }
   };
}