Page 1 of 1

New Tab

Posted: 2020-12-01 16:14
by cesteban
Hi,

I am learning to use the AppGini Helper JavaScript Library and I try to add a Tab but nothing appears, I'm also using the compaction and It's working well

My code is:

dv.compact ();
var dv = new AppGiniDetailView ();
var tab = dv.addTab ("nombre", "Title", "icon");


Thank you

Re: New Tab

Posted: 2020-12-01 16:21
by jsetzer
Please check the console output of your browser's developer tools. I guess there will be at least one (red) error message:

Reason: You are using dv-variable before declaring it. This should raise a javascript error and following code will not be executed at all, usually.

Try this instead:

Code: Select all

// file: hooks/TABLENAME-dv.js
var dv = AppGiniHelper.DV;
dv.compact();
var tab1 = dv.addTab("tab1", "Title 1", "cog", ["field1", "field2"]);

(1) replace TABLENAME by the real name of your table
(2) replace field1 and field2 by your fieldnames. You can add more fields, of course, comma-separated and wrapped in "double quotes"
(3) "icon" is just a placeholder for the name of the icon you want to add to the tab caption.
Here is an overview of available icons: https://glyphicons.bootstrapcheatsheets.com/

Re: New Tab

Posted: 2020-12-01 16:36
by cesteban
I think AppGini Helper JavaScript Library is having trouble with two fields which are from images (fotogirl, fotogde)
I am not including these fields in the Tab that I am creating

This is my code

var dv = AppGiniHelper.DV;
dv.compact();
var tab1 = dv.addTab("tab1", "Title 1", "cog", ["nombre", "prefijo"]);

This is what I found on the console

AppGiniHelper.min.js:7 AppGini Helper JavaScript Library
AppGiniHelper.min.js:7 Version 2020.10.26.1
AppGiniHelper.min.js:7 AppGiniHelper | ChangeHandler for field 'fotochica': Fieldtype not supported: file
_0x28da4a.<computed> @ AppGiniHelper.min.js:7
AppGiniHelper.min.js:7 AppGiniHelper | ChangeHandler for field 'fotogde': Fieldtype not supported: file
_0x28da4a.<computed> @ AppGiniHelper.min.js:7
DevTools failed to load SourceMap: Could not load content for http://sebusca.com.mx/consultorio/resou ... ox.min.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for http://sebusca.com.mx/consultorio/resou ... ap.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Regards

Re: New Tab

Posted: 2020-12-01 16:58
by jsetzer
(1) First two lines are for information, only.
(2) Messages starting With "AppGiniHelper | " come from the lib, the others not.
(3) The yellow messages are warnings, only. They are not errors nor exceptions.
They are for information and debugging purposes and not critical for execution of the code.
(4) remember to clear browser cache after changing js or css when reloading the page

Questions for narrowing down:
  1. Where did you put the code? filename?
  2. What is the name of the table? (case sensitive!)
  3. Can you please double check the spelling of your fields "nombre" and "prefijo" (case sensitive!).
    Especially check uppercase- and lowercase characters please.
PS: Please, when posting in this forum, wrap code fragments in [ code ] [ / code ] for better readability.

Re: New Tab

Posted: 2020-12-01 17:05
by cesteban
I double checked the names of the fields and they are fine (nombre and prefijo)

I am sure the file corresponds because I am using compaction and if done right with this table

The ones that seem very strange to me is that two fields (fotochica and fotogde) that I am not using in the Tab, are the ones that mark an error

Regards

Re: New Tab

Posted: 2020-12-01 17:09
by jsetzer
Are you really sure those two fields "fotochica" and "fotogde" raise an error (red message) or is it a warning (yellow message)?

Re: New Tab

Posted: 2020-12-01 17:13
by cesteban
Sorry,

I only see that it marks as an error in each of these fields and it seems that they are linked to AppGiniHelper

AppGiniHelper.min.js:7 AppGiniHelper | ChangeHandler for field 'fotochica': Fieldtype not supported: file
AppGiniHelper.min.js:7 AppGiniHelper | ChangeHandler for field 'fotogde': Fieldtype not supported: file

Regards

Re: New Tab

Posted: 2020-12-01 17:24
by jsetzer
I have checked the code:

Those irritating messages "ChangeHandler for field 'FIELANAME': Fieldtype not supported" can be ignored. They are warnings (no errors, no exceptions) and I am going to remove those warnings in the next release.

So, There must be a different reason for the tab-problem.

Did you clear browser-cache on reload?


Just in case this is not clear enough:
chrome_pcZIAJ8lsW.png
chrome_pcZIAJ8lsW.png (10 KiB) Viewed 5525 times
  1. = warning (yellow)
  2. = error (red)
  3. = exception (red + additional information)

Re: New Tab

Posted: 2020-12-01 17:33
by cesteban
I already cleared the cache and now it works fine

Thanks

Re: New Tab

Posted: 2020-12-01 17:46
by jsetzer
@all: especially for starters I recommend reading the troubleshooting guide here:
https://appgini.bizzworxx.de/support/troubleshooting/

There is also a block about browser cache and so much more which will help you with the first steps. This will save you ( and us :P ) a lot of time.

If you are new to database modeling I also recommend reading the best-practice guide here:
https://appgini.bizzworxx.de/support/best-practice/

It is certainly not obligatory to model and name tables and columns the way I recommend, but the naming conventions have helped me in my work for years. They have proven to be very useful at least for me and my teams in the past.

Re: New Tab

Posted: 2020-12-01 18:55
by cesteban
Thanks a lot

Re: New Tab

Posted: 2020-12-18 13:59
by jsetzer
You are welcome. Take care!