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 7572681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:59:11+00:00 2026-05-30T15:59:11+00:00

Trying to create a page that allows users to add edit and view a

  • 0

Trying to create a page that allows users to add edit and view a parent child combined.

UI has 3 columns
Parent : List of Parents Children : Child

I want to configure the controllers(s) so that users can come back to right where they were but see no need to have it so both Parent and child can be editable.

// Getting closer using backbone marionette but still having some small issues

    MyRouter = Backbone.Marionette.AppRouter.extend({
        appRoutes: {
            '': 'AddClient',
            'View/:clientid': 'ViewClient',
            'Edit/:clientid': 'EditClient',
            'View/:clientid/Add': 'PolicyAdd',
            'View/:clientid/View/:policyid': 'PolicyView',
            'View/:clientid/Edit/:policyid': 'PolicyEdit'
        }
    });

    someController = {
        AddClient: function () {
            var someView = new ClientAdd();
            MyApp.clientPane.show(someView);
        },
        ViewClient: function (clientid) {
            var someView = new ClientView();
            MyApp.clientPane.show(someView);
        },
        EditClient: function (clientid) {
            var someView = new ClientEdit();
            MyApp.clientPane.show(someView);
        },
        PolicyAdd: function (clientid) {
            this.ViewClient(clientid);
            var someView = new PolicyAdd();
            MyApp.policyPane.show(someView);
        },
        PolicyView: function (clientid, policyid) {
            this.ViewClient(clientid);
            var someView = new PolicyView();
            MyApp.policyPane.show(someView);
        },
        PolicyEdit: function (clientid, policyid) {
            this.ViewClient(clientid);
            var someView = new PolicyEdit();
            MyApp.policyPane.show(someView);
        }
    };

Having the “this.ViewClient” feels hacky and also doesn’t work.

  • 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-05-30T15:59:12+00:00Added an answer on May 30, 2026 at 3:59 pm

    Multi-part answer, here…

    “this.ViewClient is not a function”

    this is a bug in Marionette. the controller method is called in the context of the router instead of the controller, so the call to this.ViewClient is trying to find it on the router.

    oops.

    bug logged. will fix asap. https://github.com/derickbailey/backbone.marionette/issues/38

    —

    UPDATE: this bug is now fixed in v0.5.1 of Backbone.Marionette https://github.com/derickbailey/backbone.marionette

    —

    to work around this issue for now, you can do this:

    PolicyEdit: {
      someController.ViewClient();
      // ...
    }
    

    If that doesn’t work, you may need to use Underscore.js’ bind or bindAll methods to ensure the correct binding on your controller functions.

    These workaround won’t be necessary once i get the bug fixed… hopefully later today / tonight.

    is basically calling other routes the best way to manipulate multiple regions?

    The direct answer to this question is no.

    But, you’re not calling a route in this case. You’re calling a method on your controller. That’s perfectly fine – and actually, I would encourage this. It’s a proper use of your object, and is one of the things that I think should be done instead of calling another route / router handler.

    Routers And Controllers

    A router is a feature, not an architectural requirement. Your app should work without a router, and a router should only add the ability to use bookmarks and the browser’s forward/backward button.

    With that philosophy in mind (which I know is controversial), using a controller like you have and calling multiple methods on your controller in order to get your application to the correct state, is one of the right approaches to take.

    Look at it this way: if you removed the router from your app, you would be forced to call methods on your controller directly. To prevent duplication of code, you’ll want to create many small methods on your controller that can do one thing very well, and then compose larger methods out of those smaller methods.

    Hope that helps. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an ASP.NET/C# page that allows the user to edit a
I'm trying to create a page by using view 2. This page list all
I'm trying to create a page that allows a user to change the "look
I'm trying to create an application that allows users to go through a set
Im trying to create a page that allows a user to select a maximum
I'm trying to create a page that contains a grid and searching. The issue
I am trying to create a simple page that enters data in to a
I am trying to create a custom accordion for my page to that display
I am trying to create a page to display a list of links for
I am trying to create a search page, this allows the admin to search

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.