Skip to Content
author's profile photo Former Member
Former Member

How to go first view to second view

hi,

i have 2 views........ one is login.view.js and other main.view.js.....how can i go to login view to main view...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 08, 2014 at 11:23 AM

    Hi,

    You need to delete the content of the first view and then set the second view as the content of first view.

    you can do so by,

    view1.destroyContent();

    view1.addContent(view2);

    but I would suggest to craete a parent view and do the following approach

    parentview.addContent(view1);

    parentview.destroyContent();

    parentview.addContent(view2);

    Regards,

    Atanu

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Amit,

      I don't have much idea on this.. But you can go from view2 to controller and then you can use view1 function which is in controller to do some functionality on button click which you want to do on view1 elements..

      For that You have to create two functions. One is after click on logon button call function2() in controller from view2 and another one function1() is from view1. So that you can use function1() elements which are from view1 on click on button using function2().

      You can call a function from another function in controller as below..

      function2:......{

      sap.ui.controller("foldername.controllername").function1();

      }

      Regards,

      Surendra.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 01:02 PM

    you can use navigation

    veiw1.setVisible(false);

    viesw2.setVisible(true);

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 03:55 PM

    Hi,

    It depends on what are the way that your app is built.

    Some examples:

    - You could change the URL after the correct authentication process, so that, each HTML/page/template/whatever that you are using sets the new content

    - If you use a single div#content area, you could replace the content of that div with something like

    loginView.placeAt("content")

    .... some place called AFTER the authentication process ...

    mainView.placeAt("content", "only")

    - If you are using a panel, you can do something like:

    windowPanel.addContent(loginView)

    .... some place called AFTER the authentication process ...

    windowPanel.destroyContent()

    windowPanel.addContent(mainView)

    and there are many other ways!

    Regards

    Luis Alberto

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 06:59 AM

    Hi Amit,

    Check out this blog. Here the blogger has beautifully explained the Navigations.

    Hope it helps.

    Regards,

    Sharique

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.