Note that there are some explanatory texts on larger screens.

plurals
  1. POComplex tabbed form with panels in .NET MVC 3
    primarykey
    data
    text
    <p>I'm trying to create some complex form scheme in a .NET MVC 3 project (or so I think). I'll show a wireframe so that you can understand better. <img src="https://i.stack.imgur.com/xZyYx.png" alt="Wireframe for my form"></p> <p>As you can see from the pic above, it's a form to create a new Car Dealership. I can choose from many available car's manufacturers (in the <code>Add a tab</code>), and each selection creates a new tab in the panel underneath it. In each panel there's a html fieldset, and I can add some new cars on it.</p> <p>In the end, I want to submit all the form, which comprehends the data from the dealership (e.g. name), the car's brands that it has and the cars available for each brand. How can I do it with MVC 3? I don't know how exactly should I instantiate the model Car Dealership and its respective View. What should the cars in the panels be? An array of inputs? And how can I separate the inputs from one tab from the ones of another? All of this, using Razor!</p> <p>My real-world scenario is a little bit more complicated, but I'll start by this so that I can try to solve the rest by myself. I'm using jQuery/jQuery UI, but I'm opened to other javascript alternatives (like Backbone, etc - I just don't know them yet). Thanks in advance!</p> <hr> <p><strong>UPDATE (1):</strong></p> <p>These are my models so far: </p> <pre><code>public class CarDealership { public int Id { get; set; } public string Name { get; set; } public virtual ICollection&lt;ManufactorOnDealership&gt; ManufactorsOnDealership { get; set; } } public class Manufactor { public int Id { get; set; } public string Name { get; set; } public virtual ICollection&lt;ManufactorOnDealership&gt; DealershipsOfManufactor { get; set; } } // Junction class: I believe it's needed because the list of Cars belongs to this relationship public class ManufactorOnDealership { public int Id { get; set; } public int CarDealershipId { get; set; } public int ManufactorId { get; set; } public virtual CarDealership CarDealership { get; set; } public virtual Manufactor Manufactor { get; set; } public virtual ICollection&lt;Car&gt; CarsOnDealership { get; set; } } public class Car { public int Id { get; set; } public string Name { get; set; } public virtual ICollection&lt;ManufactorOnDealership&gt; Manufactors { get; set; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload