Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:28:54+00:00 2026-06-03T08:28:54+00:00

I have to remove current view being in the same view… if i am

  • 0

I have to remove current view being in the same view…
if i am in the parent view i can do

parentView.remove(childView);

but being on the child view i am not having parentView so how can i pop childView to get parentView on top, as it happens on pressing the back button in iOS??
please help

Here is my childView file..

function DetailView(){


var self = Ti.UI.createView({
    backgroundColor:'#fff'
});
// Create a Button.
var aButton = Ti.UI.createButton({
    title : 'aButton',
    height : '50',
    width : '100',
    top : '10',
    left : '20'
});

// Listen for click events.
aButton.addEventListener('click', function() {

     alert('\'aButton\' was clicked!');

I have to navigate back on press of aButton, what should i Put here to do that

});

// Add to the parent view.
self.add(aButton);


return(self);
 }
module.exports = DetailView;

Here is my parent view:

    //FirstView Component Constructor
    var self = Ti.UI.createView();

    function FirstView() {
//create object instance, a parasitic subclass of Observable


var DetailView = require('ui/common/DetailView');

var data = [{title:"Row 1"},{title:"Row 2"}];
var table = Titanium.UI.createTableView({
    data:data
    });
table.addEventListener('click', rowSelected);

self.add(table);

return self;
    }

    function rowSelected()
    {
var DetailView = require('ui/common/DetailView');

//construct UI
var detailView = new DetailView();
self.add(detailView);

    }

    module.exports = FirstView;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:28:55+00:00Added an answer on June 3, 2026 at 8:28 am

    You can pass your parentView to the constructor of child view at this point:

    //construct UI
    var detailView = new DetailView(parentView);
    self.add(detailView);
    

    and in click event

    aButton.addEventListener('click', function() {
       if ( parentView != null ) {
           parentView.remove(childView);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to remove all ul within li except the current li . <ul>
I am having on xml from which i have to remove the one book
I have read up on remove the character 'u' in a list but I
I have a Dialog which depends on information from the current view. This works
I have two questions, both related to the same view: so there is view
I want to remove the current subview (added atIndex:0) from my root view controller
I have an app which I add a subview to (and remove the same
Im trying to have a searchbox on the top of my list view. But
I want to call a new view controller and remove the current view controller
I have to remove a branch from svn history for good. Normally I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.