This might help you get something working, it is a form that does the
bookmarklet on ru.ly via GET using url params:
def bookmarklet():
default_url = request.vars.url or DEFAULT_LINK
form = FORM(TEXTAREA
(default_url,_id='link_textarea',_name='url',_rows='4',requires=resource.url.requires),
INPUT(_type='submit',_value='Make Ruly'))
if FORM.accepts(form,request.vars,keepvalues=True,formname=None):
vars = resource.after_accept(form.vars)
uvars = {}
if request.env.request_method=='GET':
uvars = {'c':'1'}
redirect(URL(r=request,f='show',args=[vars['tiny']],vars=uvars))
response.form = form
return response.render(dict())
{{def bookmarklet_link():
u=URL(r=request,f='bookmarklet',host=True)
out=A('Ruly',_href=XML("javascript:location.href='"+u+"?
url='+encodeURIComponent(location.href);"))
}}
<div id="bookmarklet"><span class="new">New</span>
- Drag this bookmarklet tool to your browser's toolbar: <span
class="link">[{{=out}}]</span></div>
{{pass}}
Robin
On Jan 3, 7:59 pm, mdipierro <[email protected]> wrote:
> I think the problem is that you cannot have url variables in a page
> that submit a form. As far as I know, HTTP specs do not say how to
> handle the case in which you have both GET and POST vars. web2py
> processes both but the browser may not be sending all of them. This is
> browser dependent and will always cause some trouble.
>
> Massimo
>
> On Jan 3, 6:28 pm, "sudhakar m" <[email protected]> wrote:
>
> > Hi Massimo,
>
> > Happy to see you back ;)
>
> > @Is this the latest trunk?
>
> > Yes I am using the latest trunk
>
> > Hi Robin,
>
> > Try setting formname = None:
>
> > > team_form.accepts(request.vars, formname=None)
>
> > > Then try inspecting the request.vars to ensure that 'id' var matches
> > > db.Team.id.
>
> > > Also try submitting w/o any id at all.
>
> > Tried setting formname = None, still no success. Team id is correct too.
> > After setting formname = None, normal edit (using edit_url) also gives same
> > error. so setting it back to default
>
> > Here's the url for teamhttp://cric2.alwaysdata.net/init/team/
>
> > Edit urlhttp://cric2.alwaysdata.net/init/team/edit/2worksfine
> > but urlhttp://cric2.alwaysdata.net/init/team/edit/2?name=englandfails
>
> > FYI: redirection & Flash are not set in the edit method (for measuring
> > performance), so even after successful edit, it will again render edit
> > again.
>
> > Thanks,
> > Sudhakar.M
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---