Re: email address-like field control
Ok,
I'm still banging my head against the wall for this.
I know I could find a different way to do what I need, but now I'm tremendously curious to know what is that I'm not getting.
Briefly, I'm trying to build a custom field like the one used in accounts and contacts to store email addresses in edit and detail views.
Basically, I need to implement this field because:
- I need it separated from the other fields (ie: name, phone number, etc)
- I need an array of four text fields linked to each other
- I need a button like the "add email" to eventually add further arrays on the fly
Looking into Sugar's structure, I discovered that that particular field is a class defined in <sugar-root>\include\SugarEmailAddress\SugarEmailAddress. php.
It uses a template defined in <sugar-root>\include\SugarEmailAddress\templates\*.tpl
and some javascript functions defined in <sugar-root>\include\SugarEmailAddress\SugarEmailAddress. js
In my last attempt to re-create this field, I
- created a custom field myField in Accounts Module (I want this custom field there)
- added custom code for this field in <sugar-root>\custom\modules\Accounts\metadata\editviewdef s.php that does the same as <sugar-root>\include\SugarEmailAddress\templates\forEditV iew.tpl
- wrote a <sugar-root>\custom\modules\Accounts\myField.js which defines the javascript functions as done in <sugar-root>\include\SugarEmailAddress\SugarEmailAddress. js
Now my question is: since SugarEmailAddress.js uses some variables taken from SugarEmailAddress.php, where should I put my version of those functions to have them work properly?
I tried many different solutions, none of them actually working.
All I've got so far is a brand new non-functioning custom field
Please somebody drop me a line on this....
Also a "you looser!" would be better than nothing
Last edited by DragonflyMaster; 2008-04-28 at 03:13 PM.
What do you think the cookie monster eats ?
Bookmarks