Perhaps because your customized widget does not contain any "requires"
restriction? I assume web2py still need that when doing form.accepts
(...)

My experience is try to use a subclass of the original widget whenever
possible.

On May 27, 8:01 pm, [email protected] wrote:
> The auto_complete field is working, however, adding the auto_complete
> functionality introduces a flaw in the update function.
>
> In the view I have got:
>
> <td>
>   {{=A(T('update/delete'),_href=URL(r=request,f='update_address',args=
> [record.id]))}}
> </td>
>
> when the user clicks the link the update_adress function is called:
>
> @auth.requires_membership('core_manager')
> def update_address():
>     response.view='core/update.html'
>     response.flash=T('update or delete record')
>     db.adres.bedrijf.writable=False
>     record_id=request.args[0]
>     record=db(db.adres.id==record_id).select(db.adres.bedrijf)[0]
>     if not record:
>         redirect(URL(r=request,f='crud_address'))
>     elif not record.bedrijf==auth.user.bedrijf:
>         redirect(URL(r=request,f='crud_address'))
>     form=crud.update(db.adres,request.args[0],next=(URL
> (r=request,f='crud_address')))
>     return dict(form=form)
>
> which displays an update/delete form, in which the plaats field is
> empty. When I click the submit field without updating the record, the
> record is updated with an empty plaats fields, whereas in the model
> there I defined an IS_NOT_EMPTY() validator on the field. Removing the
> widget restores the update function, but this is no solution, since I
> need the widget.
>
> db.adres.plaats.widget=lambda self,value:INPUT
> (_id='place',_name='plaats',_class='ac_input',_type='text')
>
> Kind regards,
>
> Annet.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to