[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Niphlod
why are you saying that vars are unavailable for LOAD ? On Thursday, April 24, 2014 3:05:20 PM UTC+2, Greg Vaughan wrote: Hi everyone... I am using a LOAD function for a notes field in the sidebar of my app. I am able to load the notes for a specific business by hardcoding the id of the

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Greg Vaughan
Hi Niphlod... {{=response.vars}} shows nothing... nor does {{response.toolbar()}}... db stats shows notes.business = 1 when I hardcode it as above... I took a screenshot here http://screencast.com/t/mmRPGOHUAjt I assume that the filter will have to be sorted in the controller as the LOAD

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Niphlod
how are you using LOAD to load the component ? On Thursday, April 24, 2014 5:23:21 PM UTC+2, Greg Vaughan wrote: Hi Niphlod... {{=response.vars}} shows nothing... nor does {{response.toolbar()}}... db stats shows notes.business = 1 when I hardcode it as above... I took a screenshot here

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Greg Vaughan
Sorry I should have given you all the data... The db table is a simple one # HISTORY db.define_table('notes', Field('business', 'reference calls', writable=False ), Field('note', 'text', label='Add Note' ), auth.signature,

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Derek
put it in the session... On Thursday, April 24, 2014 9:49:28 AM UTC-7, Greg Vaughan wrote: Sorry I should have given you all the data... The db table is a simple one # HISTORY db.define_table('notes', Field('business', 'reference calls', writable=False ),

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Anthony
{{extend 'layout.html'}} {{=form}} {{pass}} {{block right_sidebar}} {{=LOAD('default','note.load',ajax=True)}} {{end}} Just do: {{=LOAD('default', 'note.load', vars=dict(id=request.vars.id), ajax=True)}} And in the note() function: def note(): notes = db(db.notes.business ==

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Derek
session.lead_id=request.vars.id in the 'leads' function. Then the note... current = session.lead_id = is assignment == is comparison On Thursday, April 24, 2014 10:11:29 AM UTC-7, Derek wrote: put it in the session... On Thursday, April 24, 2014 9:49:28 AM UTC-7, Greg Vaughan wrote: Sorry

[web2py] Re: pass current page id to load function in sidebar

2014-04-24 Thread Greg Vaughan
Cheers Anthony Worked a treat... Thanks everyone for the help... On Friday, 25 April 2014 03:12:00 UTC+10, Anthony wrote: {{extend 'layout.html'}} {{=form}} {{pass}} {{block right_sidebar}} {{=LOAD('default','note.load',ajax=True)}} {{end}} Just do: {{=LOAD('default', 'note.load',