On May30, 1:30am, annet.verm...@gmail.com wrote:
> Iceberg,
>
> > Did not look carefully in your code but, if you are expecting some
> > default value to be showed up in your widget, you need to define
> > _value=blah for your widget.
>
> Could you please be a bit more specific about 'blah'
>
> I tried:
>
> _value=record.plaats
>
> derived from: records=db(db.adres.bedrijf==auth.user.bedrijf).select
> (db.adres.ALL,orderby=db.adres.adressoort)
>
> and:
> _value=request.vars.plaats
>
> But they both don't solve my problem.
>
> Annet.


Mmm, just guessing, maybe you want this?

  db.adres.plaats.widget=lambda self,value:INPUT(
    ...,
    value=str(value) if value is not None else "",
    )

Actually the line is derived from official StringWidget. Note that the
key name is "value" but not "_value". (It is tricky, and that's why I
recommend to subclass official widget whenever possible, rather than
start your own.)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to