Hi,
Just fixed an irksome problem and wanted to share!
I have a component, called with "load". In the component is a view of a
record with an edit button, "linkified" using web2py's Ajax trap: -
{{=A(XML('<button type="button">Edit Landlord Registration</button>'),
_href=URL(r=request, c='landlord', f='update', args=['landlord',
request.args(1)]),
cid=request.cid)}}
This pulls the edit form into the component as expected, and the edit
form is trapped by web2py and brings the view back up with the edit
form. However, at this point "cid" is no longer in the request (verified
with "{{=request.cid}}", which throws "None"), so the Ajax trap fails
and I see my "bare" component.
The cause seems to be the fix for file upload in components from slice
#113, which warns about the loss of headers.
The solution is dead simple - if I specify target='landlord_panel' in
the load statement, I can name the target in my linkified button, and
all is well: -
{{=A(XML('<button type="button">Edit Landlord Registration</button>'),
_href=URL(r=request, c='landlord', f='update', args=['landlord',
request.args(1)]),
cid='landlord_panel')}}
Hope this helps someone else, as it had me scratching my head for a few
minutes...
--
Regards,
PhilK
'a bell is a cup...until it is struck'