Re: [web2py] Re: ajax is not working in components

2011-06-13 Thread Stifan Kristi
thank you so much for your hints and suggestion, anthony and pbreit. i'll figure it out my wrong code.

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Anthony
On Sunday, June 12, 2011 9:02:20 PM UTC-4, 黄祥 wrote: > > honestly, i'm newbie in programming both in python and web2py, actually i'm > using chrome and use developer tools, but, i don't know how to trace back my > error component elements, any suggestion? > In Chrome, open developer tools, sel

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread pbreit
One thing you can do is tha tif you have LOAD('comp', 'mod.load') you can view it directly in the browser http://127.0.0.1:8000/myapp/comp/mod.load which may give you better visibility not the error messages.

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Stifan Kristi
honestly, i'm newbie in programming both in python and web2py, actually i'm using chrome and use developer tools, but, i don't know how to trace back my error component elements, any suggestion? i will redevelop my code from scratch again, as your suggested to start from simple. if you want to take

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Anthony
On Sunday, June 12, 2011 7:07:28 PM UTC-4, 黄祥 wrote: > > thank you so much for your explaination about onaccept argument, > anthony, yeah, i admit my failure code on the e.g. 2 but in e.g.1. the > result is same no error appears just never ending loading... on the list > view comments component

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Stifan Kristi
thank you so much for your explaination about onaccept argument, anthony, yeah, i admit my failure code on the e.g. 2 but in e.g.1. the result is same no error appears just never ending loading... on the list view comments component. On Sun, Jun 12, 2011 at 7:15 PM, Anthony wrote: > What error a

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Anthony
What error are you getting? Note, the onaccept argument has to be a function (respons.js is just a string). Is that the source of your error? On Sunday, June 12, 2011 7:28:18 AM UTC-4, 黄祥 wrote: > your example is work fine on me, anthony, thank you so much, but when i > tried to implement on my

Re: [web2py] Re: ajax is not working in components

2011-06-12 Thread Stifan Kristi
your example is work fine on me, anthony, thank you so much, but when i tried to implement on my application it returns an error. e.g. 1. def __add_2(table_0, index_link, table_1, field): page = table_0(request.args(0)) or redirect(URL(index_link)) response.js = 'web2py_component(action =

Re: [web2py] Re: ajax is not working in components

2011-06-11 Thread Anthony
On Saturday, June 11, 2011 8:47:05 PM UTC-4, 黄祥 wrote: > > thank you so much for your hints, anthony, i've already move out the hidden > class div but got the same results, the components show as a loading > i don't know where is the problem. > I'm not sure exactly where your problem is. T

Re: [web2py] Re: ajax is not working in components

2011-06-11 Thread Stifan Kristi
thank you so much for your hints, anthony, i've already move out the hidden class div but got the same results, the components show as a loading i don't know where is the problem.

Re: [web2py] Re: ajax is not working in components

2011-06-11 Thread Anthony
Try getting rid of the "hidden" in your component target name. The target name is used as a CSS div id, and I don't think you can have multiple CSS ids for a single HTML element. Anthony On Saturday, June 11, 2011 5:39:42 AM UTC-4, 黄祥 wrote: > thank you so much for corrected my mistook code,

Re: [web2py] Re: ajax is not working in components

2011-06-11 Thread Stifan Kristi
thank you so much for corrected my mistook code, anthony, but the results is same now the blog comment show appears loading... First time my incorrect code show the blog comment form page appears loading... and then right now the blog comment show. actually i come from the simple things one (witho

Re: [web2py] Re: ajax is not working in components

2011-06-10 Thread Anthony
I think you're specifying the target div name in the wrong place. Instead of: {{=LOAD('default', 'blog_comment_show.load', args = page.id, ajax = True)}} {{=LOAD('default', 'blog_comment_add.load', args = page.id, target = 'comments_%s hidden' % page.id, ajax = True)}} I think you want: {

Re: [web2py] Re: ajax is not working in components

2011-06-10 Thread Stifan Kristi
yes, i have. def blog_comment_show(): return __show_2(blog, blog_index, blog_comment, blog_comment_blog_id, blog_comment_active) @auth.requires_login() def __show_2(table_0, index_link, table_1, field, active): page = table_0(request.args(0)) or redirect(URL(index_link)) results = db(

Re: [web2py] Re: ajax is not working in components

2011-06-10 Thread Anthony
Do you have a blog_comment_show() action in your controller? On Friday, June 10, 2011 10:58:56 PM UTC-4, 黄祥 wrote: > thank you so much for your hints, anthony, but, pardon me, the results on > the form components is loading..., the page didn't show an error, but keep > loading..., is there some

Re: [web2py] Re: ajax is not working in components

2011-06-10 Thread Stifan Kristi
thank you so much for your hints, anthony, but, pardon me, the results on the form components is loading..., the page didn't show an error, but keep loading..., is there something i missed in my code? e.g. *=== controller ===* blog = db.blog blog_comment = db.blog_comment blog_comment_blog_id = d

[web2py] Re: ajax is not working in components

2011-06-10 Thread Anthony
Maybe try having the post comment action return some JS via response.js that calls the web2py_component JS function to update the list component: def post_comment(): # do some stuff response.js='web2py_component(action="%s",target="%s")' % (URL('list_comments.load'), 'comment_list')