another way to state this:  partials are language from one very (too) narrow
use case.
The general case is that page CONTAINERS manage output, and decay to one
container per page (or the partials sort of idea that were mentioned).

Now - controller logic is just engineering logic - implementation of
solution / output;

Containers, and the protocol to connect output (URI) to a container is view
logic...

This is important, because this is how outupt to one page (for example for
PyCon) can be collected from controller outupt from 2 frameworks (django or
web2py)....

And this is where this concept shows the boundaries that are appropriate
(the other end of the boundary - even if you never want to combine output
from elsewhere, the point is still  that level of separation is desireable).

Come to think of it, another place to look is what do Yahoo Pipes do?   That
is 3 places to look, and gather ideas:  Yahoo Pipes, jsr Portlets,  .Net /
what dotnetnuke uses to implement application containers...

This last piece is where web2py can start:  think about how to have
"portlets" that can (for example) be connected to web2py application output.

I think this is more appropriate to think of as a general Python solution to
put in place....

- Yarko

On Fri, Apr 3, 2009 at 4:28 PM, Yarko Tymciurak <yark...@gmail.com> wrote:

> I think this is not structured _enough_.
> Looking at what has already been done in this area (see jsr portlets;  I do
> not remember how dotnetnuke does the same with it's "page components" - but
> that is definitely worth analyzing).
>
> What we need is some general way that a
>
> def index():  return something()
>
> May be assigned to a portlet / window (say on a home page - with a "read
> more" action), and
> when read-more is selected, that same index() function may get it's own
> entire page.
>
> The point is this "partials" should not be knowledge within index(), rather
> index should be encapsulated in something that handles this.
>
> Keep thinking about this.....
>
>
> - Yarko
>
>
> On Fri, Apr 3, 2009 at 4:08 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>>
>> There has been a lot of discussion in the past about forms that submit
>> via ajax and may or may not refresh the entire page. It is also useful
>> to be able to break html pages into "modules" or "plugins" or
>> "components" each with its own model, view, controller in such a way
>> that they communicate both serversize (by sharing session and
>> database) and clientsize (one boxed component should be able for
>> example to refresh the entire page or trigger a flash).
>>
>> I have prototype application that does this.
>>
>>    http://www.web2py.com/examples/static/web2py.app.events.tar
>>
>> It uses jquery publisher subscriber mechanism. All the code is in a
>> new web2py_ajax and a class call jDiv (similar to Rails Partial but
>> more powerful in my opinion) which I could include in html.py
>>
>> It allows you to write code like this:
>>
>> def index():
>>   return dict(partial1=jDiv('click me for text','mycallback1'),
>>               partial2=jDiv('click me for flash','mycallback2'),
>>               partial3=jDiv('click me to redirect','mycallback3'),
>>               partial4=jDiv('click me for form','mycallback4'))
>>
>> def mycallback1():
>>   return 'hello world'
>>
>> def mycallback2():
>>   return jDiv.flash('this is a test') # flash on the container page
>>
>> def mycallback3():
>>   return jDiv.redirect('http://www.yahoo.com') # redirects entire
>> page
>>
>> def mycallback4():
>>   form=FORM('your name:',
>>             INPUT(_name='name',requires=IS_NOT_EMPTY()),
>>             INPUT(_type='submit'))
>>   if form.accepts(request.vars):
>>       return jDiv.flash('hello '+form.vars.name)
>>   return form
>>
>> Can you figure out what it does?
>> Not that the page is never reloaded. Only parts (partials, jDivs) of
>> the reloaded. Each jDiv lives in its own container, has one action,
>> can have a view, and can talk to each other.
>>
>> This may require some more thought.
>>
>> Comments?
>>
>> Massimo
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to