There is no special place for this.
You can put them in a module and import, in a controller or in a model
where you need them.
For example:

def mywidgetfield, value):
        return INPUT(_type='text',
            value=value,
            _id = '%s_%s' % (field._tablename, field.name),
            _class = field.type,
            _name = field.name,
            requires = field.requires)

...Field('myfield',widget=mywidget)...


On Jan 24, 11:21 pm, weheh <richard_gor...@verizon.net> wrote:
> OK, now I'm scared. I don't even know what file the custom widget is
> supposed to live in (and I've read the doc, I swear). Do you know of
> any good examples I could look at on doing an AJAX call on a drop down
> list, where the drop down value is used to pick a value from a table
> and then send it back to the view to update a div?
>
> On Jan 24, 11:03 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > yes
>
> > On Jan 24, 9:15 pm, weheh <richard_gor...@verizon.net> wrote:
>
> > > I'm combining two tables into one form (yet again). I'm using
> > > SQLFORM.factory(db.auth_user,db.table1) to combine the 2 tables into 1
> > > form. All fields have unique names.
>
> > > I am custom designing the form to make it more compact than the linear
> > > approach used by SQLFORM. Therefore, I end up using
> > > form.custom.begin ... form.custom.widget.fieldname ...
> > > form.custom.end.
>
> > > One of the widgets is a drop-down list. Based on the value of the drop
> > > down, I want to query the db and get a cost information on the fly and
> > > update the form with this information. Do I need to write a
> > > custom.widget to make this work? How else can I get the AJAX script to
> > > talk to the form?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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