model-view-controller

Sencha Touch & ExtJS profiles for desktop and mobile in one web project/vhost?

ぃ、小莉子 提交于 2019-12-21 06:21:57
问题 I'm creating a web application with desktop and mobile versions using ExtJS and Sencha Touch. ExtJS 4 and Sencha Touch 2 use an MVC approach, and Sencha Touch 2 incorporates "profiles" for different devices (iPhone, tablet, etc.). ExtJs 4, however, has no notion of profiles. Is it realistically feasible to for dependencies for desktop, iPhone, and iPad versions of the app to live under one vhost, in the same app directory hierarchy? Or, is it generally more acceptable to use different vhosts

Sencha Touch & ExtJS profiles for desktop and mobile in one web project/vhost?

流过昼夜 提交于 2019-12-21 06:21:28
问题 I'm creating a web application with desktop and mobile versions using ExtJS and Sencha Touch. ExtJS 4 and Sencha Touch 2 use an MVC approach, and Sencha Touch 2 incorporates "profiles" for different devices (iPhone, tablet, etc.). ExtJs 4, however, has no notion of profiles. Is it realistically feasible to for dependencies for desktop, iPhone, and iPad versions of the app to live under one vhost, in the same app directory hierarchy? Or, is it generally more acceptable to use different vhosts

ASP.NET MVC C#: Bringing in data from multiple tables/queries into a view

被刻印的时光 ゝ 提交于 2019-12-21 05:39:15
问题 Ok, I'm still getting the hang of asp.net and the MVC framework and converting my knowledge over from classic ASP and VB - so please be gentle. I've got my first view (/home/details/X) functioning well thanks to previous help pointing me in the right direction, now I need to add data from multiple tables and queries/views to the MVC view (I hate that SQL and MVC both use the word view for different meanings). I'm not looking for someone to write the answer for me (unless they're feeling

Client-side validation for custom ValidationAttribute with AttributeTargets.Class

佐手、 提交于 2019-12-21 05:32:08
问题 Is it possible to implement client-site validation for custom ValidationAttribute, which is used in Class scope? For example my MaxLengthGlobal, which should assure global max limit for all input fields. [AttributeUsage(AttributeTargets.Class)] public class MaxLengthGlobalAttribute : ValidationAttribute, IClientValidatable { public int MaximumLength { get; private set; } public MaxLengthGlobalAttribute(int maximumLength) { this.MaximumLength = maximumLength; } public override bool IsValid

Contradictory explanations of MVC in JSF

拜拜、爱过 提交于 2019-12-21 05:17:10
问题 I'd starting to learn JSF, but first I'd like to understand the big picture of it as an MVC framework. There are several answers with many upvotes explaining what are MVC layers in JSF, but they usually contradict themselves. BalusC's answer: What components are MVC in JSF MVC framework? In the big architectural picture, your own JSF code is the V : M - Business domain/Service layer (e.g. EJB/JPA/DAO) V - Your JSF code C - FacesServlet In the developer picture, the architectural V is in turn

Component base MVC framework and action based MVC framework

随声附和 提交于 2019-12-21 05:16:14
问题 Hi I have worked with JSF which is a component based MVC framework . I know a lot of web projects use Spring as their technology and Spring falls under the category "action based UI framework " . I want to know what is the difference here ? Which one is more advanced and gives more flexibility to the users ? Some pros and cons ? 回答1: Component Based Web Framework is a way of implementing Web (HTTP) based applications similar to thick-client applications where user operates on GUI controls

How can I test an event of a MVC controller

陌路散爱 提交于 2019-12-21 04:42:40
问题 I want to test the OnException , OnActionExecuted event of an MVC controller. If I use mock like this: var httpContext = MockRepository.GenerateMock<HttpContextBase>(); var request = MockRepository.GenerateMock<HttpRequestBase>(); httpContext.Expect(c => c.Request).Return(request).Repeat.AtLeastOnce(); request.Expect(r => r.IsAuthenticated ).Return(true).Repeat.AtLeastOnce(); var controller = new MyController() ; controller.ControllerContext = new ControllerContext(httpContext, new RouteData(

ExtJS 4 how to create and display a new controller/view from another controller/view?

旧城冷巷雨未停 提交于 2019-12-21 04:33:37
问题 I have looked over lots of examples of ExtJS 4 MVC, and they all pretty much show the same thing: The application creates a viewport, loads in a view, and has a 'controllers' defined, which init's the controller: Ext.application({ name: 'AM', controllers: [ 'Users' ], launch: function() { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'userlist' } ] }); } }); Thats great, but now let's say in my application I want a button contained within my view to open a whole new

Where does input validation happen in MVC?

孤街浪徒 提交于 2019-12-21 03:32:40
问题 Ok, this has probably been asked before but i cant find a definative answer. Where in the MVC pattern should validation of input happen? I would like to say that things like empty fields and basic general validation should happen in the controller and that rules as lengths and valid characters of for example usernames / passwords etc should happen at the model layer. However, this means spreading this burdon around the application which surely cant be good either? Sorry if this question is

Codeigniter - How to get url variable value inside contoller function?

依然范特西╮ 提交于 2019-12-21 02:57:13
问题 I have URL like this: http://localhost/sitename/some-post-title/code=24639204963309423 Now I have one findUser function in my controller file public function findUser() { // I have tried with $_GET['code'] } and I am trying to get code variable value inside this function. I have tried with $_GET['code'] but did not worked. Any Idea how to get value inside controller function? Thanks. 回答1: Are you trying to get a path segment variable or a GET variable? It looks like you're going for a bit of