Coooooool!

16 views
Skip to first unread message

mdipierro

unread,
Apr 6, 2009, 2:09:12 AM4/6/09
to web2py Web Framework
I just changed the layout....

http://www.web2py.com/events/default/index
http://www.web2py.com/examples/static/web2py.app.events.tar

try:
- click on "form"
- type a= 2 [enter]
- type b= 3 [enter]

- click on "post a message"
- type something and see the "list messages" open up automatically

- click on "register" and "login" and "logout"

- click on watch the movie!

- move jDivs (the windows) around.

- look at the source code on default.py

Isn't this cool?
Pros? Cons? Suggestions for improvement?

Massimo

Zoom.Quiet

unread,
Apr 6, 2009, 2:31:01 AM4/6/09
to web...@googlegroups.com

囧rz...
web os ...

> Pros? Cons? Suggestions for improvement?
>
> Massimo

--
http://zoomquiet.org
'''过程改进乃是催生可促生靠谱的人的组织!'''
金山常年招聘Py/C++人才! http://bit.ly/UoTV 简历直投俺就成;-)

Vidul Petrov

unread,
Apr 6, 2009, 3:33:40 AM4/6/09
to web2py Web Framework
This is splendid!

I am wondering - is jDiv able to show/hide some text/image, indicating
the processing activity?


On Apr 6, 9:31 am, "Zoom.Quiet" <zoom.qu...@gmail.com> wrote:

desfrenes

unread,
Apr 6, 2009, 4:54:00 AM4/6/09
to web2py Web Framework
Hi,

It's nice but how about using existing plugins for the ajax stuff ?
jquery.taconite.js and jquery.form.js are great (see page test here:
http://www.desfrenes.com/playground/carnet_adresse/ )

Taconite plugin: http://malsup.com/jquery/taconite/

Regards,

Mickaël.

On Apr 6, 8:09 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I just changed the layout....
>
> http://www.web2py.com/events/default/indexhttp://www.web2py.com/examples/static/web2py.app.events.tar

Oleg

unread,
Apr 6, 2009, 8:33:09 AM4/6/09
to web2py Web Framework
Strange... Does not work for me :( FF 3.0.8

On Apr 6, 8:09 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I just changed the layout....
>
> http://www.web2py.com/events/default/indexhttp://www.web2py.com/examples/static/web2py.app.events.tar

Álvaro Justen [Turicas]

unread,
Apr 6, 2009, 9:07:52 AM4/6/09
to web...@googlegroups.com

Congratulations, very cool!
Two bugs:

1) When I click to expand some jDiv, Firefox croll the page to top.
It's because "href" element is set to "#". Solution: change href to
"javascript:somefunction();" (it can be void()).

2) If I move jDiv "A" to the right, even I move it to a long distance
in comparation with other jDivs, jDivs above "A" are moved down when I
expand "A", even in cases that it isn't necessary.

--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/

Álvaro Justen [Turicas]

unread,
Apr 6, 2009, 9:34:26 AM4/6/09
to web...@googlegroups.com
Ah, there is a "bug" in CSS: I use Iceweasel (Firefox with a "free"
visual identity) 3.0.6 and the second half of text "[web2py] events"
is showed.
In Epiphany (GNOME's web browser) all pages of web2py are showed this
way. I think it's a div position issue.

mdipierro

unread,
Apr 6, 2009, 12:17:28 PM4/6/09
to web2py Web Framework
because, as far as I understand, this does something different.

the main point is that jDiv catches the self-submitting forms and
prevents from reloading the entire page. I can use this with existing
web2py actions.

taconite has a flexible mechanism for allowing one page to embed code
into the page (using a new XML based syntax) but I prefer to use the
native publisher/subscriber mechanism in jQuery and let the server
always send the HTML to each component. I am ok with one component
triggering an aciton in a different component (like "load" or "flash"
or "slideToggle") but I am not ok with a component editing the content
of another component (something that taconite is for). I believe the
latter approach become un-manageble for complex systems.

Massimo

On Apr 6, 3:54 am, desfrenes <desfre...@gmail.com> wrote:
> Hi,
>
> It's nice but how about using existing plugins for the ajax stuff ?
> jquery.taconite.js and jquery.form.js are great (see page test here:http://www.desfrenes.com/playground/carnet_adresse/)
>
> Taconite plugin:http://malsup.com/jquery/taconite/
>
> Regards,
>
> Mickaël.
>
> On Apr 6, 8:09 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > I just changed the layout....
>
> >http://www.web2py.com/events/default/indexhttp://www.web2py.com/examp...

mdipierro

unread,
Apr 6, 2009, 12:20:18 PM4/6/09
to web2py Web Framework
The jDiv should be made "absolute" and not "relative" but this is a
detail. If you can fix the index.html code to make it look better
please email it to me.

On Apr 6, 8:34 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:

desfrenes

unread,
Apr 6, 2009, 2:42:04 PM4/6/09
to web2py Web Framework
ok, I understand.

ceej

unread,
Apr 6, 2009, 2:52:06 PM4/6/09
to web2py Web Framework
I think there should defiantly be a way to specify what div the
response is loaded in and also the option to load different parts of
the response in different divs.

mdipierro

unread,
Apr 6, 2009, 3:34:09 PM4/6/09
to web2py Web Framework
This can already be done. Here is a better layout and absolute Divs.

http://www.web2py.com/events/default/index

desfrenes

unread,
Apr 6, 2009, 3:37:29 PM4/6/09
to web2py Web Framework
liking the background :-)

mdipierro

unread,
Apr 6, 2009, 3:45:02 PM4/6/09
to web2py Web Framework
I stole it on the web. Not my artwork. Hope the author does not mind.

Massimo

Tito Garrido

unread,
Apr 6, 2009, 7:02:21 PM4/6/09
to web...@googlegroups.com
Freaking Cool!!!
--
Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

weheh

unread,
Apr 7, 2009, 1:05:22 AM4/7/09
to web2py Web Framework
Massimo - this is exactly what I was looking for! Very cool! However,
on IE7 there are some display issues, so your example comes across a
little raw. Under the hood, I think it looks like it's working fine.
If you couple this with something like YUI it should work fine across
many browsers.

notabene

unread,
Apr 7, 2009, 6:28:08 AM4/7/09
to web2py Web Framework
Very nice and cool!

Because of the static height (style="height: 35px;" in views/default/
index.html) it only works for me when moving the div/window away from
the left column.

is jDiv and the new web2py_ajax.html finding its to web2py or a svn
repository?

Niels

On 6 Apr., 08:09, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I just changed the layout....
>
> http://www.web2py.com/events/default/indexhttp://www.web2py.com/examples/static/web2py.app.events.tar

Wes James

unread,
Apr 9, 2009, 6:37:16 PM4/9/09
to web...@googlegroups.com
I registered, logged in then when I log out I got a ticket:

Traceback (most recent call last):
File "/opt/20090331-w2p/gluon/restricted.py", line 98, in restricted
exec ccode in environment
File "/opt/20090331-w2p/applications/events/controllers/default.py",
line 63, in <module>
File "/opt/20090331-w2p/gluon/globals.py", line 75, in <lambda>
self._caller = lambda f: f()
File "/opt/20090331-w2p/applications/events/controllers/default.py",
line 27, in logout
auth.logout(next=None)
File "/opt/20090331-w2p/gluon/tools.py", line 611, in logout
redirect(next or self.settings.next)
File "/opt/20090331-w2p/gluon/http.py", line 88, in redirect
location = location.replace('\r', '%0D').replace('\n', '%0A')
AttributeError: 'NoneType' object has no attribute 'replace'


Also when you click to open an item, is it supposed to push the other
things down. I tried safari and firefox and the windows open behind
the ones below...

great ideas! thx

-wj

mdipierro

unread,
Apr 9, 2009, 10:18:43 PM4/9/09
to web2py Web Framework
cj and I are working this. Then we need to focus on wirting specs for
plugins.

Massimo

On Apr 9, 5:37 pm, Wes James <compte...@gmail.com> wrote:
> I registered, logged in then when I log out I got a ticket:
>
> Traceback (most recent call last):
> File "/opt/20090331-w2p/gluon/restricted.py", line 98, in restricted
> exec ccode in environment
> File "/opt/20090331-w2p/applications/events/controllers/default.py",
> line 63, in <module>
> File "/opt/20090331-w2p/gluon/globals.py", line 75, in <lambda>
> self._caller = lambda f: f()
> File "/opt/20090331-w2p/applications/events/controllers/default.py",
> line 27, in logout
> auth.logout(next=None)
> File "/opt/20090331-w2p/gluon/tools.py", line 611, in logout
> redirect(next or self.settings.next)
> File "/opt/20090331-w2p/gluon/http.py", line 88, in redirect
> location = location.replace('\r', '%0D').replace('\n', '%0A')
> AttributeError: 'NoneType' object has no attribute 'replace'
>
> Also when you click to open an item, is it supposed to push the other
> things down. I tried safari and firefox and the windows open behind
> the ones below...
>
> great ideas! thx
>
> -wj
>

Jeffield

unread,
Apr 9, 2009, 11:17:21 PM4/9/09
to web2py Web Framework
> Isn't this cool?
very! I have been dying to play with GWT but have not had the time
I figured it would make creating ajax interfaces easer.

> Pros? Cons? Suggestions for improvement?
I feel silly for saying this... but think it warrents being said.
"click me", "click me", "click me"
....has got to go.... IMHO.

On Apr 6, 1:09 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I just changed the layout....
>
> http://www.web2py.com/events/default/indexhttp://www.web2py.com/examples/static/web2py.app.events.tar

Yarko Tymciurak

unread,
Apr 9, 2009, 11:53:18 PM4/9/09
to web...@googlegroups.com
just doesn't work at all from a mobile browser...

might need to start by doing some detection...

(look forward to seeing what you've got when I get home)

- Yarko

Yarko Tymciurak

unread,
Apr 9, 2009, 11:55:47 PM4/9/09
to web...@googlegroups.com
just doesn't work at all from a mobile browser...

might need to start by doing some detection...

(look forward to seeing what you've got when I get home)

- Yarko

On 4/6/09, mdipierro <mdip...@cs.depaul.edu> wrote:
>

mdipierro

unread,
Apr 10, 2009, 12:28:50 AM4/10/09
to web2py Web Framework
LOL. It will go away. Promise.

On Apr 9, 10:17 pm, Jeffield <jeff.sheffi...@gmail.com> wrote:
> > Isn't this cool?
>
> very! I have been dying to play with GWT but have not had the time
> I figured it would make creating ajax interfaces easer.
>
> > Pros? Cons? Suggestions for improvement?
>
> I feel silly for saying this... but think it warrents being said.
> "click me", "click me", "click me"
> ....has got to go.... IMHO.
>
> On Apr 6, 1:09 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > I just changed the layout....
>
> >http://www.web2py.com/events/default/indexhttp://www.web2py.com/examp...

Ted G

unread,
May 1, 2009, 4:39:18 AM5/1/09
to web2py Web Framework
I'm having a problem using upload fields within forms that are used
within jDiv containers. Testing edit() below by itself provides a form
that I can successfully select and update an image. When I encapsulate
the same edit() within a jDiv, all fields update with the exception of
the upload field, even though form.accepts is successful.

The code below contains the essential elements of what I am doing.
Updating the profile edit form correctly forces a refresh of the other
jDiv that is displaying the profile info, and all fields are updated
correctly when changed, with the exception of the upload field.

Any help with this is appreciated.

P.S. - Despite this hiccup, I am enthusiastic about this addition of
the jDiv container.


db.py model:
--------------------------

db.define_table('user_profile',
SQLField('nickname', type='string'),
SQLField('bio', type='text'),
SQLField('owner', db.auth_user, notnull=True, required=True,
writable=False),
SQLField('image', 'upload', uploadfield='image_data'),
SQLField('image_data', type='blob', default='', writable=False)
)


profile.py controller:
-----------------------------
def index():
# create profile form and profile info containers
profile_form = jDiv('',URL(r=request,f='edit'),_id='1')
user_profile = jDiv('',URL
(r=request,f='profile'),timeout=0.01,_id='2')

return (profile_form = profile_form )

def edit():

user_profile=db(db.user_profile.owner==auth.user.id).select()[0]

form=SQLFORM(db.user_profile, user_profile, deletable=False)

if form.accepts(request.vars,session):
# refresh profile container
jDiv.set(jDiv.trigger('#target_2','load'))
return dict(form=form,user_profile=user_profile)

def profile():
# first get our profile, if we don't yet
# have one, then create it
try:
profile=db(db.user_profile.owner==auth.user.id).select()[0]
except:
db.user_profile.insert(owner=auth.user.id,nickname='n00by')
profile=db(q_profile).select()[0]
return dict(profile=profile)

index.html view:
-----------------------------
{{extend 'layout.html'}}

{{=user_profile}}
<hr/>
{{=profile_form}}

profile.html view:
-------------------------

<img width="100", height="100" src="{{ =URL
(r=request,f='download',args=[profile.image]) }}" />
<h4>{{=auth.user.first_name + " " + auth.user.last_name}}'s Profile</
h4>
<hr/><strong>Nickname: {{ =profile.nickname }}</strong><br/>
email: {{=auth.user.email}}<br/>
{{ =profile.bio }}

edit.html view:
-----------------------
<h3>Edit profile</h3>
{{=form}}
<hr/>



On Apr 6, 12:45 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I stole it on the web. Not my artwork. Hope the author does not mind.
>
> Massimo
>
> On Apr 6, 2:37 pm, desfrenes <desfre...@gmail.com> wrote:
>
> > liking the background :-)
>
> > On 6 avr, 21:34, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > This can already be done. Here is a better layout and absolute Divs.
>
> > >http://www.web2py.com/events/default/index
>
> > > On Apr 6, 1:52 pm, ceej <cjlaz...@googlemail.com> wrote:
>
> > > > I think there should defiantly be a way to specify what div the
> > > > response is loaded in and also the option to load different parts of
> > > > the response in different divs.
>
> > > > On Apr 6, 1:42 pm, desfrenes <desfre...@gmail.com> wrote:
>
> > > > > ok, I understand.
>
> > > > > On 6 avr, 18:17, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > > because, as far as I understand, this does something different.
>
> > > > > > the main point is thatjDivcatches the self-submitting forms and

DJ

unread,
May 7, 2009, 3:46:19 PM5/7/09
to web2py Web Framework
This interface looks great! Nice work Massimo.

Works fine on Firefox but am seeing issues on IE 8.

-Seb
Reply all
Reply to author
Forward
0 new messages