In a view I have the following button:
<a class="btn" onclick="{{="web2py_component('%s','component-pane')"
%URL('cmsadmin','delete',args=row.Organization.nodeID)}}">Delete</a>
In the form I normally add the following cancel button:
def addCancelButton(form):
form[0][-1][1].append(INPUT(_type="button",_value="Cancel",_onclick="javascript:history.go(-1);"))
return None
Since this form is within a page that loads its contents as ajax views, I
have to re-write the cancel button to go to:
{{=LOAD('indexContent.load',ajax=True,target='component-pane')}}
I tried:
'def addCancelButtonCMS(form):
form[0][-1][1].append(INPUT(_type="button",_value="Cancel",_onclick="'web2py_component("%s","component-pane")'%URL('indexContent')"))
return None
... but that results in an syntax error, I guess it's the quotes ...
Annet.