Forum OpenACS Development: Re: GoogleMap Widget on ad_form

Collapse
Posted by Antonio Pisano on
Hello Iuri,

I cannot give precise indications about the JavaScript sorcery you will probably require to achieve your result, but to create a "pure ad_form" widget it should be sufficient to refer to this:
https://openacs.org/api-doc/proc-view?proc=template%3a%3aelement%3a%3acreate&source_p=1

so basically create a new template::widget::googlemaps and a corresponding validator template::data::validate::googlemaps (name will be of your choice of course). Validator can be something as trivial as "return 1", depending on the logic of your widget.

As reference you can have a look at the various widgets and validators already defined:
https://openacs.org/api-doc/proc-view?proc=template%3a%3awidget
https://openacs.org/api-doc/proc-view?proc=template%3a%3adata%3a%3avalidate

Hope this helps

Collapse
Posted by Iuri Sampaio on
Hi there,

Yes, it helps a lot. I see it changes the perspective. They show a way to create a whole new widget, such as category pkg does, which in fact is a better approach (modular, easy to reuse and etc.)

I'm also getting back to old documentation about ad_form, plus grabbing some samples of code from classic packages such as bug-tracker, calendar, and of course, acs-subsite.

Thanks again Antonio.

https://openacs.org/file/493854/ad_form%20cheat%20sheet.pdf