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

  • Home
  • SEARCH
  • 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 9002345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:33:30+00:00 2026-06-16T00:33:30+00:00

The main idea: after my controller did update properties on a model successfully I

  • 0

The main idea: after my controller did update properties on a model successfully I want to call a view method which closes the childview.

Template:

<a {{action showUpdate href=true target="view"}}>update</a>

   {{#if view.isUpdate}}   
        {{#view App.UpdateView}}   
            ...here is a form
            <button {{action update}}>Send</button>
        {{/view}}   
    {{/if}}

View:

App.MainView = Ember.View.extend({
  templateName: 'update',
    isUpdate: false,
    showUpdate: function() {
        this.set('isUpdate', !this.get('isUpdate'));
    }
});

App.UpdateView= Ember.View.extend();

Controller:

App.MainController = Ember.Controller.extend({
   updateCon: function() {
               do something
   },
       ...

Router:

 update: function(router, evt) {
    router.get('mainController').updateCon();
    //router.get('mainController.view').showUpdate(); <-- doesnt work
 }

So I tried to call this in my router after my Controller did well, but it doesnt work.

Cannot call method 'showUpdate' of null 

Is that the right approach? When yes: what am I missing? When no: How to deform my view when my controller did something?

  • 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-16T00:33:31+00:00Added an answer on June 16, 2026 at 12:33 am

    The control flow logic is better suited for the Controller. It is generally a good idea to keep views free of state and the controller shouldn’t know about the View. You can move the update flag and function to your controller and target the controller in your Handlebars template. The view’s Handlebars template would be something like:

    <a href="#" {{action showUpdate target="controller"}}>update</a>
    {{#if isUpdated}}
        ...
    {{/if}}
    

    Then the controller would have the update logic:

    App.MainController = Em.Controller.extend({
        isUpdated: false,
        showUpdate: function() {
            this.set('isUpdated', !this.get('isUpdated'));
        }
    });
    

    The view is now nothing but the template name:

    App.MainView = Em.View.extend({
        templateName: 'update'
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a property IsLoading for my main view model. The idea is that
I want to create a multilevel menu using jQuery. The main idea is by
#include<iostream> using namespace std; /*main idea is to construct ordered statistic tree,which is similar
I've got this idea. In a webpage design, after clicking an image i want
Update : It occurred to me after posting this question that the main downside
The main idea is that I have several worker instances of a Rails app,
I'm working on a site where the main idea is to do a lot
I've been trying to learn about metaclasses in Python. I get the main idea,
What is literate programming? To quote Dr. Knuth: The main idea is to regard
The Idea I have a main PHP page that loads content in DIV's from

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.