Nativescript obtaining Another (upper) View from Button of Inner Frame

Recently I used the drawerapp template using the usual instruction as mentioned here : link.

I have no problem for acquirement this until the deployment. Then, I add a new page for login :

login-structure

And make some adjustment inside the app-root.xml as the following:

The Frame showing the Login page

with extra portion layout that i want to be visible or hidden partially.

Layout that shown and hidden

And then, inside the login-page.xml i have this portion that make the button calling function onVerify.

onVerify action called by button

When i made some adjustment inside login-page.js especially for onVerify function. :

 export function onVerify(args){
  var page = args.object.page;
  var form = getViewById(page, "login-form-layout");
  page.frame.navigate({
    moduleName: 'home/home-page',
    clearHistory: true,
  });

  // but the code below didnt work!
  var menuUnlogged = page.getViewById("unlogged");
  var menuLogged = page.getViewById("logged-in");

  menuUnlogged.visibility = "collapse";
  menuLogged.visibility = "visible";
}

But it didnt work. The app crashed! Is that the referencing variable that didnt catch the view element or something else i didnt understand yet?

Hope someone could help me out of this matter. Thanks in advanced!