On Mon, Mar 30, 2009 at 5:40 AM, notabene <[email protected]> wrote:
> > On 30 Mar., 09:13, Yarko Tymciurak <[email protected]> wrote: > > On Mon, Mar 30, 2009 at 1:58 AM, notabene <[email protected]> wrote: > > > > > Thumbs up. Very good idea! > > > > > We have had the discussion around MVC. And the conclusion were, that > > > there is no clear-cut border between MVC. No perfect or true division. > > > > I think maybe you missed some point of the discussions on division... > one > > discussion was about where to define forms. > > > > I do not think it is ever a good idea to include color settings in > > controller / business logic... > > As it is right now You can put color-settings in controllers! > I Agree that color-settings hardly never belongs in a controller, but > the example from mr.freeze is just a simple example. I believe you > could as well put business logic into the script. > > Regards Niels Bjerre I still don't understand what the motivation for this is... if the example is not an example of what makes this more useful than what can be done now, then then I'd like to see one... > > > > > > Yarko > > > > > > > > > (Java-) scripting functionality in controllers can ease the way for > > > AJAX forms and functionality in views. > > > > > On 30 Mar., 06:15, mdipierro <[email protected]> wrote: > > > > Some clarifications. > > > > Right now one can already do this in views by inserting somewhere: > > > > > > <script> > > > > $(document).ready(function() { do_something(); }); > > > > </script> > > > > > > Mr. Freeze's suggestions has pros and cons. In my opinion: > > > > > > Pros: > > > > - it is more compact > > > > Cons: > > > > - moves into the controller something that (usually) belongs to > the > > > > view. > > > > - if the script in quotes has a bug it may break web2py_ajax > > > > because everything would go in the same $(..).ready(function(){}). > > > > > > I would like to hear more opinions about this. Perhaps some examples > > > > when this would be better than placing the code in the view. > > > > > > Massimo > > > > > > On Mar 29, 10:46 pm, Jason Brower <[email protected]> wrote: > > > > > > > Good question. > > > > > I like the idea as it gives us a nice place to put scripts and make > > > them > > > > > apply to the views we want very easily. so +1 on that! > > > > > Regards, > > > > > Jason Brower > > > > > > > On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: > > > > > > It's basically a new global list, response.scripts, that is > rendered > > > > > > in the jQuery(document).ready function so you can inject > javascript > > > > > > from the controller. Massimo mentioned that it may go against > MVC > > > > > > separation standards and wanted me to put it out here to get a > few > > > > > > opinions. Sample usage: > > > > > > > > def index(): > > > > > > if not request.vars.name: > > > > > > response.scripts.append("$('#messages').text('Messages: > Name > > > > > > Missing').css('color','red');") > > > > > > else: > > > > > > response.scripts.append("$('#messages').text('Messages: > Hello > > > > > > " + request.vars.name + "');") > > > > > > return dict() > > > > > > > > What do you think? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

