[web2py] Re: web2py.component , ajax call always add ".load" to the first var

2018-08-03 Thread Anthony
The URL extension propagates, so if you call URL() without explicitly 
specifying an extension, it adds the extension of the current request 
(i.e., the request in which URL() is called), with the exception of the 
".html" extension, which is dropped.

So, if the current request has a .load extension, calls to URL() made 
within that request will also have the .load extension by default. You can 
explicitly suppress the extension via URL(..., extension=False), which is 
probably what you should do unless for some reason your Ajax calls need the 
.load extension.

Anthony

On Friday, August 3, 2018 at 6:47:23 AM UTC-4, Artem wrote:
>
> Hello , All!
> I load component via :
>
> $.web2py.component("{{=URL(c='conc2',f='c2.load')}}", 'conc_div') 
>
> component have ajax calls like :
>
> ajax("{{=URL(c='conc2', f='create_new_detail?t=')}}" +t+ 
> '_id='+c_id,[],'mbody_CRUD_Modal');
>
> when i send t and c_id vars to function with ajax call, and print them 
> out by console.log() in browser everything looks how is must be ,
> but ajax call always add .load  to the first var ...
>
> so for example i need  send to controller t='abc' and c_id='001' , but in 
> controller i receive t=.loadabc and c_id=001 .
>
>
>
>
>
>
>
>
>
>
>
> vxvxvxv   
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py.component , ajax call always add ".load" to the first var

2018-08-03 Thread Artem
manage to find the error :
ajax("{{=URL(c='conc2', f='create_new_detail')}}" +'?t=' +t+ 
'_id='+c_id,[],'mbody_CRUD_Modal'); 

On Friday, August 3, 2018 at 6:47:23 PM UTC+8, Artem wrote:
>
> Hello , All!
> I load component via :
>
> $.web2py.component("{{=URL(c='conc2',f='c2.load')}}", 'conc_div') 
>
> component have ajax calls like :
>
> ajax("{{=URL(c='conc2', f='create_new_detail?t=')}}" +t+ 
> '_id='+c_id,[],'mbody_CRUD_Modal');
>
> when i send t and c_id vars to function with ajax call, and print them 
> out by console.log() in browser everything looks how is must be ,
> but ajax call always add .load  to the first var ...
>
> so for example i need  send to controller t='abc' and c_id='001' , but in 
> controller i receive t=.loadabc and c_id=001 .
>
>
>
>
>
>
>
>
>
>
>
> vxvxvxv   
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-03-04 Thread Andrea Fae'
Thank you. If I will have time I will analyze the code.


Il giorno sabato 3 marzo 2018 22:21:51 UTC+1, Anthony ha scritto:
>
> On Saturday, March 3, 2018 at 2:14:29 PM UTC-5, Andrea Fae' wrote:
>>
>> Anthony, what is the difference between
>>
>>  $.web2py.component(url_materia + '?docente=' + v, 
>> 'evento_materia');
>>  
>> and
>>
>>  $.web2py.component(url_materia + '?docente=' + v, 
>> 'evento_materia','no','no',$('#evento_materia'));
>>
>> where is the complete syntax about this?
>>
>
> Relevant code is here: 
> https://github.com/web2py/web2py/blob/b16e33ab652d567ba62fd810814864f124504375/applications/welcome/static/js/web2py.js#L401
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-03-03 Thread Anthony
On Saturday, March 3, 2018 at 2:14:29 PM UTC-5, Andrea Fae' wrote:
>
> Anthony, what is the difference between
>
>  $.web2py.component(url_materia + '?docente=' + v, 
> 'evento_materia');
>  
> and
>
>  $.web2py.component(url_materia + '?docente=' + v, 
> 'evento_materia','no','no',$('#evento_materia'));
>
> where is the complete syntax about this?
>

Relevant code is 
here: 
https://github.com/web2py/web2py/blob/b16e33ab652d567ba62fd810814864f124504375/applications/welcome/static/js/web2py.js#L401

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-03-03 Thread Andrea Fae'
Anthony, what is the difference between

 $.web2py.component(url_materia + '?docente=' + v, 
'evento_materia');
 
and

 $.web2py.component(url_materia + '?docente=' + v, 
'evento_materia','no','no',$('#evento_materia'));

where is the complete syntax about this?
Thanks

Il giorno giovedì 18 gennaio 2018 23:59:08 UTC+1, Anthony ha scritto:
>
> On Thursday, January 18, 2018 at 2:58:47 PM UTC-5, Andrea Fae' wrote:
>>
>> Anthony, you are very good teacher. But can I have a couple of examples 
>> using web2py and javascript? thank in advance.
>>
>
> Maybe think about specific use cases, try something, and come back with 
> specific questions if you can't get it working.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-01-18 Thread Dave S


On Thursday, January 18, 2018 at 1:01:37 PM UTC-8, Dave S wrote:
>
>
>
> On Thursday, January 18, 2018 at 11:58:47 AM UTC-8, Andrea Fae' wrote:
>>
>> Anthony, you are very good teacher. But can I have a couple of examples 
>> using web2py and javascript? thank in advance.
>>
>
> The first example (a simple one, but a starting point) is in the section 
> Anthony mentions.  For easy scrolling, it is the paragraph just above
>  http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD-signature
> >
>

I would add that the code you invoke as a component is just another exposed 
function in your controller, the same technique as used for the parent 
page.  I have an example or two where the same function is either a 
standalone page or a component, the difference being in the view 
(myfunc.html and myfunc.load), and the component call automatically looks 
for the dot-load version.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-01-18 Thread Anthony
On Thursday, January 18, 2018 at 2:58:47 PM UTC-5, Andrea Fae' wrote:
>
> Anthony, you are very good teacher. But can I have a couple of examples 
> using web2py and javascript? thank in advance.
>

Maybe think about specific use cases, try something, and come back with 
specific questions if you can't get it working.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-01-18 Thread Dave S


On Thursday, January 18, 2018 at 11:58:47 AM UTC-8, Andrea Fae' wrote:
>
> Anthony, you are very good teacher. But can I have a couple of examples 
> using web2py and javascript? thank in advance.
>

The first example (a simple one, but a starting point) is in the section 
Anthony mentions.  For easy scrolling, it is the paragraph just above


/dps
 

>
> Il giorno giovedì 18 gennaio 2018 20:46:44 UTC+1, Anthony ha scritto:
>>
>> The end of this section 
>>  
>> mentions web2py_component(), which is an alias for $.web2py.component(). It 
>> is simply the Javascript function that loads an Ajax component on a page 
>> (the first argument is the URL and the second is the ID of the div where 
>> the component should be loaded). You can use it to trigger the creation or 
>> reloading of Ajax components using Javascript (e.g., clicking a button 
>> could load a component).
>>
>> Anthony
>>
>> On Thursday, January 18, 2018 at 2:31:34 PM UTC-5, Andrea Fae' wrote:
>>>
>>> Who is able to explain well $.web2py.component? What is the meaning?
>>> Where is in the web2py book? 
>>> Thank you
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-01-18 Thread Andrea Fae'
Anthony, you are very good teacher. But can I have a couple of examples 
using web2py and javascript? thank in advance.

Il giorno giovedì 18 gennaio 2018 20:46:44 UTC+1, Anthony ha scritto:
>
> The end of this section 
>  
> mentions web2py_component(), which is an alias for $.web2py.component(). It 
> is simply the Javascript function that loads an Ajax component on a page 
> (the first argument is the URL and the second is the ID of the div where 
> the component should be loaded). You can use it to trigger the creation or 
> reloading of Ajax components using Javascript (e.g., clicking a button 
> could load a component).
>
> Anthony
>
> On Thursday, January 18, 2018 at 2:31:34 PM UTC-5, Andrea Fae' wrote:
>>
>> Who is able to explain well $.web2py.component? What is the meaning?
>> Where is in the web2py book? 
>> Thank you
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: $.web2py.component

2018-01-18 Thread Anthony
The end of this section 
 
mentions web2py_component(), which is an alias for $.web2py.component(). It 
is simply the Javascript function that loads an Ajax component on a page 
(the first argument is the URL and the second is the ID of the div where 
the component should be loaded). You can use it to trigger the creation or 
reloading of Ajax components using Javascript (e.g., clicking a button 
could load a component).

Anthony

On Thursday, January 18, 2018 at 2:31:34 PM UTC-5, Andrea Fae' wrote:
>
> Who is able to explain well $.web2py.component? What is the meaning?
> Where is in the web2py book? 
> Thank you
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py.component equivalent for =LOAD

2018-01-07 Thread Andrea Fae'
I'm sorry but in the documentation there isn't written explicitally 
web2py.component with the dotwhere did you find it? And for 
$.web2py.component? What is the meaning?
Thank you

Il giorno giovedì 16 febbraio 2017 22:40:18 UTC+1, Richard ha scritto:
>
> {{=LOAD()}} = HTML
>
> web2py.component() = JS
>
> Signature should be similar, read the doc...
>
> Richard
>
> On Tue, Feb 14, 2017 at 4:26 PM,  
> wrote:
>
>> just realized there are some typo... so is it
>>
>>  web2py.component('{{=URL('default', 'test.load',args=['lspci'])}}', 
>> target='component1')  
>>
>> =LOAD is working but it does automatic rendering, I want to do the same 
>> after the webpage had been loaded, so want to use web2py.component inside 
>> javascript function,
>>
>>
>> On Tuesday, February 14, 2017 at 2:38:53 PM UTC-6, shamimu...@gmail.com 
>> wrote:
>>>
>>> What is the equivalent of following when using web2py.component() ?
>>>
>>> {{=LOAD('default', 'test.load', args=[''lspci'], ajax=True)}}
>>>
>>> is it ?
>>>
>>>  web2py.component('{{=URL('default', 'test2.load',args=['dmesg'])}}', 
>>> target='component1')
>>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py.component equivalent for =LOAD

2017-06-29 Thread Filipe Reis
By any chance did you understand how to use signature with web2py_component?

So when a request is done to the page it only shows if was triggered the 
that call only. This is what I think that @auth.requires_signature() doe

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py.component equivalent for =LOAD

2017-06-29 Thread Filipe Reis
By any chance did you understand how to use signature with web2py_component?

So when a request is done to the page it only shows if was triggered the 
that call only. This is what I think that @auth.requires_signature() does.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py.component equivalent for =LOAD

2017-02-16 Thread Richard Vézina
{{=LOAD()}} = HTML

web2py.component() = JS

Signature should be similar, read the doc...

Richard

On Tue, Feb 14, 2017 at 4:26 PM,  wrote:

> just realized there are some typo... so is it
>
>  web2py.component('{{=URL('default', 'test.load',args=['lspci'])}}',
> target='component1')
>
> =LOAD is working but it does automatic rendering, I want to do the same
> after the webpage had been loaded, so want to use web2py.component inside
> javascript function,
>
>
> On Tuesday, February 14, 2017 at 2:38:53 PM UTC-6, shamimu...@gmail.com
> wrote:
>>
>> What is the equivalent of following when using web2py.component() ?
>>
>> {{=LOAD('default', 'test.load', args=[''lspci'], ajax=True)}}
>>
>> is it ?
>>
>>  web2py.component('{{=URL('default', 'test2.load',args=['dmesg'])}}',
>> target='component1')
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py.component equivalent for =LOAD

2017-02-14 Thread shamimur . rahman
just realized there are some typo... so is it

 web2py.component('{{=URL('default', 'test.load',args=['lspci'])}}', 
target='component1')  

=LOAD is working but it does automatic rendering, I want to do the same 
after the webpage had been loaded, so want to use web2py.component inside 
javascript function,

On Tuesday, February 14, 2017 at 2:38:53 PM UTC-6, shamimu...@gmail.com 
wrote:
>
> What is the equivalent of following when using web2py.component() ?
>
> {{=LOAD('default', 'test.load', args=[''lspci'], ajax=True)}}
>
> is it ?
>
>  web2py.component('{{=URL('default', 'test2.load',args=['dmesg'])}}', 
> target='component1')
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.