mvc

How do I get a selection model to work with a proxy model?

I have a model and two views set up like this: Model ---> OSortFilterProxyModel ---> OListView Model ------------------------------> OTableView When the user selects something in one of the views, I want the other view to mirror that selection. So I thought I'd use a QSelectionModel to link them together. But this does not work. I hav...

MVC, where do the classes go?

My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it) Models are the things that interface with the database Views are the design/layout of the page Controllers are where everything starts and are essentially the page logic I'm using CodeIgniter but I would hazard a guess it's not just limite...

Is MVC-ARS preferable to classic MVC to prevent overloading?

The popular design pattern MVC (Model/View/Controller) has an extended cousin MVC-ARS (Action/Representation/State). The added components all live within the database layer and while are not part of the model, they are invoked by it. Details are as follows: State, as in state machine. This follows the classic state machine pattern. ...

MVC n-level route building

I want to create a productcatalog with N-Level Categories e.g. /Catalog/Category1/Category2/../SubCategoryN/Product/{ProductActions}/{ID} And at the same time be able to /Catalog/Category1/Category2/../SubCategoryN/{CategoryActions} Is that possible and if Yes how? ...

Alternatives to the MVC

What are the alternative "design methods" to the Model View Controller? MVC seems to be popular (SO was built with it, I know that much) but is it the only method used? ...

Lightest possible PHP MVC

I currently use CodeIgniter for an MVC framework in PHP because it's a very bare framework, is there anything even more bare than CodeIgniter? ...

How do I inject a form value with jQuery?

I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC has an Extension Method on HttpRequest called "IsAjaxMvcRequest" that detects if the POST was an Ajax request. This Extension Method basically "sniffs" for a form value called "__MVCASYNCPOST" and (basically) returns true if it sees this element. What I want to do i...

How you design Controller layer of MVC design pattern in .NET

Here are my thoughts: The purpose of using MVC is seperation of concerns and testability of gui logic. View should be able to work with different models and model should be able to work with different views. I think controller class must implement an interface for mocking/testing reasons and view should call controller methods through th...

In Django, where is the best place to put short snippets of HTML-formatted data?

Hi there, This question is related to (but perhaps not quite the same as): http://stackoverflow.com/questions/61451/does-django-have-html-helpers My problem is this: In Django, I am constantly reproducing the basic formatting for low-level database objects. Here's an example: I have two classes, Person and Address. There are multiple...

What's the best approach to migrate a CGI to a Framework?

Hi, i have a big web application running in perl CGI. It's running ok, it's well written, but as it was done in the past, all the html are defined hardcoded in the CGI calls, so as you could imagine, it's hard to mantain, improve and etc. So now i would like to start to add some templating and integrate with a framework (catalyst or CGI:...

When deleting hasOne or hasMany associations, should the foreignKey be set to NULL?

Given : Group hasMany Persons but the relationship is independent (ie. Persons can exist without belonging to a Group), should the foreign key in the persons table (ie group_id) be set to 0 (or NULL) when deleting a group? If you do not, the person will try to belong to a group that does't exist. The reason I ask is that this is...

Unit Testing the Views?

Any idea on how to unit test the views in ASP.NET MVC? I am sick of encountering the yellow screen of death when I launch my MVC project just because I forget to update the views when one of the Action methods of my controller changes name. ...

MVC tutorial that doesn't rely on a framework?

I want to learn MVC "architecture pattern" but I don't want to jump into a framework like Rails or Django just yet. I want to understand the concept first and write some simple code in my currently familiar environment, which happens to be php/html/css/mysql. I don't necessarily need a tutorial that is based on php, as I do understand ...

ActionUrl in ASP.NET MVC Preview 5

Hi. I don't need a Link but rather only the href= part of the ActionLink. But if I call Html.ActionLink(...) I get a back. Is there a way to just return the URL of the Action while not getting the ? ...

What are some good toolsets for graphing/charting in a web application?

What are some good toolsets for graphing/charting in a web application? Preferably open-source/freeware, and particularly looking at developing with ASP.NET MVC or Silverlight 2.0. ...

Trailing slash on an ASP.NET MVC route

In the latest MVC preview, I'm using this route for a legacy URL: routes.MapRoute( "Legacy-Firefox", // Route name "Firefox-Extension/", // URL with parameters new { controller = "Home", action = "Firefox", id = "" } // Parameter defaults ); The problem is that both of these URL's work: http://mysite.com/Firefox-Extension http://mysit...

ASP.NET MVC - Problem passing parameters to the controller

I have a controller with an action method as follows: public class InventoryController : Controller { public ActionResult ViewStockNext(int firstItem) { // Do some stuff } } And when I run it I get an error stating: The parameters dictionary does not contain a valid value of type 'System.Int32' for parameter 'f...

Creating A Private Photo Gallery Using Asp.Net MVC

I need to create a photo gallery service that is managed by users. I've done this a million times using just Asp.net but I was wondering if there are any special considerations that I need to make when using Asp.net MVC. Basically, I will be storing the actual images on the filesystem and storing the locations in a database linking the ...

Asp.net MVC View Testing?

With more and more code pushed to the Views in Asp.Net MVC (i.e. AJAX, JQuery, etc...), how do you maintain the 'testability'? How do you test your Views? How do you test your views with client-side jscript code? How do you test your Views with Async behavior? It seems that most examples on the testability of MVC deal with controller...

MVC User Controls + ViewData

Hi im new to MVC and I've fished around with no luck on how to build MVC User Controls that have ViewData returned to them. I was hoping someone would post a step by step solution on how to approach this problem. If you could make your solution very detailed that would help out greatly. Sorry for being so discrete with my question, I wo...