×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Page Navigation in MVC pattern

    Dear All,
    I have written a program (DBMS) with 3 views (for example V1, V2 and V3). I know that every symbian project should follow MVC pattern in which the Controller is used to manage all actions such as clicking phone buttons, joystick and such things. In my program, DBMSAppui.cpp manages navigating between views. In V1, I Show some items in a listbox and after clicking (Options -> Show Details) I navigate to V2 and show the details in another listbox.
    As you see by clicking Options -> Show Details the Controller (DBMSAppui.cpp->changeview) activates and destroys V1 and shows V2.
    My problem is that I wonder how can I perform navigation by selecting an item of listbox (for example in V1) and clicking OK button and handle it inside V1 (using OfferKeyEventL method). I can not destroy V1 without going through DBMSAppui and show V2. I Also can not create an instance of DBMSAppui inside V1 because it is already presents and manages the events.
    Thanks Beforehand.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Page Navigation in MVC pattern

    Hi,

    If I understand your question correctly you've navigated to a second view and you want to get back to the first one from within one of the member fuctions of the second view?

    You can access the AppUi from any of the views to tell it to change the view - try something like:

    AppUi()->ActivateLocalViewL(TUid::Uid(EYourFirstViewId));

    Hope that helps,
    Sorcery

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Re: Page Navigation in MVC pattern

    Hi,
    I have access to ActivateViewL method in my second view and I can not see AppUi->ActivateLocalViewL.
    I use ActivateViewL in the following way :

    const TUid KUidDBMSApp = {0x101F5466};
    appUi->ActivateViewL(TVwsViewId(KUidDBMSApp,TUid::Uid(2)));


    appui is an oblect of my Controller class(CDBMSAppUi* appUi= new (ELeave) CDBMSAppUi.

    and I get the following error:
    function call '[CDBMSListboxView].ActivateViewL(TVwsViewId)' does not match 'CCoeAppUi::ActivateViewL(const TVwsViewId &)' (non-static) 'CCoeAppUi::ActivateViewL(const TVwsViewId &, TUid, const TDesC8 &)' (non-static)

    Any Suggestion might help.
    Thanks.
    Last edited by hojatvaheb; 2007-10-23 at 12:34.

  4. #4
    Regular Contributor
    Join Date
    May 2007
    Posts
    91

    Re: Page Navigation in MVC pattern

    the error is due to the 3rd paramater of the ActivateViewL you are just specifing only 2 parameters... ActivateViewL(TVwsViewId(KUidDBMSApp,TUid::Uid(2))); it should be ActivateViewL(KUidDBMSApp, TUid::Uid(2), _L8(""));....

    hope this will help you...

    Vinod.

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Re: Page Navigation in MVC pattern

    Thanks but now I get the following error:

    function call '[CDBMSAppUi].ActivateViewL({lval} const TUid, TUid, TPtrC8)' does not match 'CCoeAppUi::ActivateViewL(const TVwsViewId &)' (non-static) 'CCoeAppUi::ActivateViewL(const TVwsViewId &, TUid, const TDesC8 &)' (non-static)

    how can I use AppUi()->ActivateLocalViewL ? AppUi() is not identified in my code.
    Thanks.

  6. #6
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Re: Page Navigation in MVC pattern

    ActivateViewL() is used to switch to other applications, so I have to use ActivateLocalViewL. But it seems that my application is not a view architecture GUI application (http://wiki.forum.nokia.com/index.ph...lication_views) and it is a traditional Eikon GUI application.

    What can I do?

  7. #7
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Page Navigation in MVC pattern

    Hi,

    No, you are only passing in 1 parameter in the first instance, that was not the problem. The 3 parameter overload is for passing messages between views when they are activated.

    Your problem is that your appUi is of type CCoeAppUi when you need CAknViewAppUi. Are you developing an S60 app? AppUi() is a member function of CAknView. What class are your views?

    Sorcery

  8. #8
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Re: Page Navigation in MVC pattern

    my views are of CCoeControl type; ActivateViewL() can not be used for my purpose since I don't want to switch to another application. Am I right?

  9. #9
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Page Navigation in MVC pattern

    OK,

    I haven't ever developed an application directly using CONE. It is normal to develop using the S60 or UIQ UI's directly depending on the platform you are developing for. Did you mean to develop you application with CCoeControl's for portability or is it an accident? What SDK are you using?

    It is true that Nokia have implemented an easy view switching architecture in S60 and that it isn't quite so simple to do it using only Symbian components.

    If there's no reason why you shouldn't use S60 then I'd suggest you port your application code over into some CAknView's and a CAknViewAppUi. If you need to stick with pure Symbian for some reason then I think someone else with experience in this will have to help, or you could try asking on the Symbian Developer Network site rather than Forum Nokia?

    Sorcery

Similar Threads

  1. Navigation Panes for Series 60
    By rguia in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-02-24, 15:19
  2. Replies: 0
    Last Post: 2005-02-17, 06:15

Posting Permissions

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