Hi Massimo,

On 02/11/2011 20:12, Massimo Di Pierro wrote:
Can you show us your code? which web2py version?


Sure, and I'm on 1.99.2.

Interestingly, in my efforts to reproduce this I've figured out when it works and when not.

This fails: -

def property_detail_update():
    crud.settings.showid = True
    crud.messages.submit_button = 'Update Property Detail'
    form=crud.update(db.property_detail, request.args(1)
        ,deletable=True
        ,next='/landlord/property_detail_index.load/property_id/[id]'
        )
    return dict(form=form)

...and Firebug tells me: -

"NetworkError: 400 BAD REQUEST - https://s4a.w2p.xfr.co.uk/landlord/property_detail_index.load/property_id/%5Bid%5D";


...but I made two mistakes in my problem report. The first was not to realise that it is /Firebug/ that's showing me that encoding, but in reality all web2py is doing is passing along "[id]" unmodified. The second, and most important, was that I was explicitly calling the controller and adding a leading slash. If I remove "/landlord/" from the above it works fine.

I'm still curious as to whether I can access the ID value in the controller with an expression, rather than having my string substituted, though!


--

Regards,

PhilK


'a bell is a cup...until it is struck'

Reply via email to