mvc

call to undefined method Request::getParam ???

Fatal error: Call to undefined method Request::getParam() in C:\wamp\www\Admin\corporate\for-upload\activecollab\application\modules\system\controllers\CompaniesController.class.php on line 219 in controller class I've written $this->request->getParam('is_owner'); and in request i've passed $router->map('people_companies_add_owne...

asp .net mvc ajax submit

Hi, I am facing a problem that's driving my crazy for sometime. I have an asp .net mvc page(.ascx). This view has a form which can be ajax submitted to a controller action. I have an ajax submit button that posts the form. In the view I have some if conditions as follows If(Model.SampleID.HasValue) { alert('sample created');...

What is the advantage of using multiple Controller classes in ASP.NET MVC?

I'm just learning the basics of ASP.NET MVC and am wondering what the benefit is in breaking up website logic amongst multiple controllers versus just having a single Controller class that runs the whole website, besides simply organizing code better. (In my opinion, just the latter benefit should not be enough to affect the end user via...

how mvc+smarty in php works?

this is a handler for building menu new MenuItem('Owner', lang('Owner'), assemble_url('Owner'), get_image_url('navigation/Company.gif')), new MenuItem('Client', lang('Client'), assemble_url('Client'), get_image_url('navigation/people.gif')), One system module class in which i've mapped the route $router->map('Owner', 'Owner','nu...

Suggest MVC frameworks that do not use controller base classes.

pseudo-code: class SomeController { def myAction(){ // controler is an property passed via ctor controller.redirect(toWhereever) } } // another variant class AnotherController { def myAction(controller){ // controler is an method argument controller.redirect(toWhereever) } } Any suggestions? ...

Spring 3 MVC: Show validation message with custom validator

Hi, I need help. I am beginner in jsp, MVC. I want to validate form input with custom validator in Spring 3 MVC. My validator class package validators; import models.UserModel; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; im...

MVC and Classic OO Paradigm. How to?

Hi, I'm a little bit confused about MVC and OO paradigms. I have read some documentation about classical OO in the book "The Object-Oriented Thought Process". Now I need to apply what I have learn in this book in the context of MVC pattern. How can I design from scratch using the OO paradigm and implement it in a MVC Framework like C...

Where to store label font information - in the Model or the View?

What is the best practice for storing font information of labels in Cocoa-Touch following the MVC paradigm? In my data model I would like to store information that are displayed by a custom view as UILabels. It is evident that the label text belongs to the data model. But where should I store the corresponding font (and in my situation ...

One server, multiple domains, sharing PHP MVC

I'd like to produce regional versions of a php powered website, for example: www.mysite-england.co.uk www.mysite-wales.co.uk www.mysite-scotland.co.uk I'd like to setup one LAMP server to serve all the domains with a single php MVC using $_SERVER['HTTP_HOST'] (or similar) as the primary content modifier. Ie if($_SERVER['HTTP_HOST'...

Win32 MVC pattern implementation

Hi, I'm currently working on a win32 application and I'm thinking I should probably use the MVC pattern. Now according to the pattern, the code that handles user interaction should be in the controller so that I can update the model and/or view accordingly. But in Win32, would that mean that my windowProc should be in the controller ? I...

javascript mvc and ajax form submitting..

I just started to investigate mvc on javascript client side (JavaScript MVC). Everything looked great until I got to form submitting :) View part won't do it, that's simple. Event is attached in Controller, so Controller is good place to validate form data, but I'm not sure I want my Controller to know specific server address (were to po...

Parsing text in MVC

You have a blog. You want certain combinations of symbols (i.e. :), :(, :p ...) to be parsed into emoticons before the post in the blog are printed on the screen. Should this parsing be a responsibility of the Model, the View or the Controller? ...

How do I update a JTable based on a notification received from a long-running task in other thread?

I've an Observer TableModel which listens to some changes, performed in the database, and when so the update method below is called. My problem is, how should I prevent errors like: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.set(ArrayList.java:337) ...

Returning Json Result with object name MVC

When a json result is returned by the controller the object name seems to be missing, I normally wouldn't mind but the flexbox jquery plugin requires the json result in a particular format. Flexcombobox expected format {"results":[ {"id":"1","name":"Ant"}, {"id":"2","name":"Bear"}, {"id":"3","name":"Cat"}, {...

HTML encoding custom HTML helper

I wish to encode my HTML sent to the browser. In my .ASPX pages I can use the <%: %> syntax. In a HTML helper of mine I try... public static string Image(this HtmlHelper helper, string imageName, string altText) { return helper.Encode(String.Format("<image src='/images/{0}' alt='{1}' />", imageName, altText)); } ...

Unable to locate my nhibernate config file when debugging my MVC web-application

I've got an MVC web-project that's referencing a class-library-project that contains my Domain and Persistence tiers. I'm using nHibernate for my OR/M. Since I've got multiple databases to connect to, I'm initializing my session-factories by specifying the file-names: var config = new Configuration().Configure(nHibernateCfgFileName) ...

Test driven development : asp.net mvc..

Hi, I am taking baby steps in to strictly following TDD and IOC methodology from my asp.net mvc project. Its very painful and its hard for me to think straight. Its like I am going blind and totally in the dark. Its forcing me to learn new C# features. God.. I miss the good old drag and drop days and just keep coding away the featur...

ASP.NET MVC 2 Returning to previous screen

Is there a way to return to the previous view without having to record all the parameters that were used to get to the view in question. Consider this situation. You have a search screen with input parameters, you press search and get results displayed on the page. You click on one item to get a detailed look which redirects you to a new...

Preventing Nhibernate from persisting a specific collection in a class.

Hello Everyone, I have a Sponsor object which has a collection that looks like this... public virtual IDictionary<SettingId, object> SettingValueDefaults { get; set; } These are actually being pulled as a subset of a larger table. I need to be able to read from these, and that is working correctly. However, I would like to be able...

Use ActionInvoker with url to return a MethodInfo

I’m trying to create my own smart ActionLink htmlhelper that determines if a user is authorized to perform the action that the link points to. If they are not authorized then I want to launch a javascript modal login box to screen. I have gotten it to work in cases where my method names are all unique. But I need it to be more intellige...