×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    can a view in an app switch to another view in same app?

    I have some problems understanding how the view architecture in Symbian works. This keeps giving me trouble one app after the other. Hope someone can help me with this one:

    I have an application with 3 views (V1 to V3). Each view has its ContainerView class and its Container class (I follow here the same naming convection as the uidesigner).

    Is it possible to switch views from within a method inside a ContainerView?, and a Container?

    Here is my current problem in more detail:

    - V1 is the main view.
    - V2 is a form.

    1. When the user selects an option in menu inside V1, the method handing this options activates V2.
    V2 get activated, but the form is non-editable independent of whether it is set to editable in resource file.

    2. Calling SetEditableL() inside PreLayoutDynInitL() of the form container for V2 has no effect (First problem hit). It should have work this way.

    3. Calling formcontainer->SetEditableL() from within DoActivate() in V2's ContainerView does work.

    4. The user fills in the form and presses OK.

    5. The method that handles the OK activates V1 again.

    6. V1 DoActivate() is called and processed OK.

    7. V2 DoDeactivate() is called next. The application abort (no panic generated, only aborts) when deleting the Container for V2 inside V2's DoDeactivate()

    After a few hours working on this problem , and trying multiple things, I still have absolutely no clue what is wrong. And, as I mentioned, it is not the first time I have problems with the View Architecture. It's definetely not as simple as switching views from one to the other.
    ----------------------------------------------
    Every journey starts with a small step.

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

    Re: can a view in an app switch to another view in same app?

    You can get pointer to your Appui Class from any parts of your applciation, thus you can call the view swithing code from AppUI class from any parts of your applciation as well.

    For the crashing, so check the panic code, and if you can not get it for some reason still, then do use my Y-Tasks::Crashmonitor, it will show the process exit codes for every process thate exits

  3. #3
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    Re: can a view in an app switch to another view in same app?

    Thanks symbianyucca, but I have no problem to access AppUi statically to switch views from anywhere in my app.
    The problem is that switching apps does not seem towork too well. Or, maybe, it is a problem with uidesigner.

    You can do a simple trial:

    a. Start a new Symbian C++ project that uses uidesigner.
    b. Create a form view as the first view.
    c. Add a Text input to the form (CEikEdwin control).
    c. Run the app. -> In my case, the form is not editable. And adding SetEditableL(ETrue) to PreLayoutDynInitL() has no effect. In my 5800, the CEikEdwin looks like a button and seems to respond to button events (OkToExitL( TInt aButtonId ) is called when I touch on the CEikEdwin control).

    d. Insert a second view. An empty one with one option in the "Options" menu. Let's call it "option1".
    e. In the handler of option one, add code to activate the form view (just a single "ActivateLocalViewL" call).
    f. In the OkToExitL() method of the form, add a call to ActivateLocalViewL to activate the empty view.
    g. The application exits when the form is deleted in DoDeactivate() of formview.

    You do not need to add almost any code. Just a couple of calls to ActivateLocalViewL as mentioned there. The rest of code is generated by Carbide's uidesigner.

    I have tried the code in a 5800, E71 and 6210. Same result in all.
    ----------------------------------------------
    Every journey starts with a small step.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: can a view in an app switch to another view in same app?

    you should try getting the panic code: http://wiki.forum.nokia.com/index.ph...ded_panic_code

    also you could try debugging the app in emulator to see whther you can find the actual line that causes the crash.

  5. #5
    Registered User
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380

    Re: can a view in an app switch to another view in same app?

    I get a Kern-Exec 3 in red line below:

    Code:
    void CLynxBackupLoginFormView::DoDeactivate()
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	CleanupStatusPane();
    	
    	if ( iLynxBackupLoginForm != NULL )
    		{
    		AppUi()->RemoveFromStack( iLynxBackupLoginForm );
    		delete iLynxBackupLoginForm;
    		iLynxBackupLoginForm = NULL;
    		}
    	// ]]] end generated region [Generated Contents]
    	}
    as I said, this is code generated by the uidesigner and I don't touch it. iLynxBackupLoginForm is also "clean" code generated by uidesigner. I have not touched anything there except for adding the following lines at the very begining of to OkToExit():

    Code:
    	if( aButtonId == EAknSoftkeyBack )
    		{
    		static_cast<CLynxBackupAppUi*>(CEikonEnv::Static()->AppUi())->iUsername.Copy(_L(""));
    		static_cast<CLynxBackupAppUi*>(CEikonEnv::Static()->AppUi())->iPassword.Copy(_L(""));
    		}
    	else
    		{
    		iLogin->GetText(static_cast<CLynxBackupAppUi*>(CEikonEnv::Static()->AppUi())->iUsername);
    		iPassword->GetText(static_cast<CLynxBackupAppUi*>(CEikonEnv::Static()->AppUi())->iPassword);
    		}
    	static_cast<CLynxBackupAppUi*>(CEikonEnv::Static()->AppUi())->ActivateLocalViewL(TUid::Uid(ELynxBackupContainerViewId));
    	return ETrue;
    iLogin and iPassword are CEikEdwin* and CEikSecretEditor* respectively. They are both added with the uidesigner.

    I also added SetEditableL(ETrue) at the very end of PreLayoutDynInitL(). But it has no effect whatsoever on the form.

    I am starting to think that this is a problem with the uidesigner itself.
    ----------------------------------------------
    Every journey starts with a small step.

Similar Threads

  1. how to switch views in traditional view architecture
    By tlr in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-03-26, 11:59
  2. How to switch from Form to another view?
    By mohammednguyen in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-02-19, 02:36
  3. Switch view mode programatically?
    By Neverhouse in forum Symbian
    Replies: 2
    Last Post: 2008-04-04, 10:25
  4. app view remains dimmed after global note is shown
    By liammurray in forum Symbian User Interface
    Replies: 4
    Last Post: 2003-03-22, 17:22

Posting Permissions

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