wrapLabels bug?

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

wrapLabels bug?

Post by SkayyHH » 2020-06-06 21:16

Hello,

i am currently trying out the AppGini Helper JavaScript Library.

The "wrapLabels ()" function does not work for all tables. The function delays in "detail view mode" and hang in "detail add mode". this means that the fields are not arranged on the left and the labels are not on top on the fields. On child pages the warp function will work.

It seems that this only occurs with master / children tables in the master (parent).

Does one of you have a solution / Workaround for me for that issue.

Thank you, Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-06 22:10

Hi,

I guess you are referring to the wrapLabels function for muliti-column layouts.

Can you please post your hooks/TABLENAME-dv.js code (as code for better readability) including your .addLayout() function calls.

Additionally can you please post screenshots so that we can see the problem.

Some basic tipps:

Are there any warnings or errors in the console tab? Which?

If there are errors in console tab, please eliminate them before. Mostly, javascript will not continue interpreting code if there are errors. For example js will not execute AG Helper js library code if there are syntax errors in your code before.

Which version of agh js lib are you using?

Which browser?

Which media-size (xs, sm, md or lg)?

Did you / do you clear browser cache on every reload after js or css changes?

Did you follow the troubleshooting guide?

Regards,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-06 23:42

Hello,

attached 2 screenshots. Once normal view, once add view. The function is not executed in the add view, delayed in normal view. It only occurs with master tables. Therefore, problems other than appgini in connection with the helper scripts can be excluded.

Here is the content of the file "Employees-dv.js":

new AppGiniLayout ([12])
.add (1, ["#Patient", "Firstname", "Name", "EmployeeNumber", "DateOfBirth", "MaritalStatus", "Age", "HireDate", "Discharge", "Adress", "PersonalEmail" , "PersonalPhone", "Mobilphone", "JobTitle", "Department", "WorkEmail", "WorkPhone", "WorkMobil", "EmergencyKontakt", "Image", "Notes"])
.wrapLabels ();


Here are the console errors:

TypeError: "currentNode is null"
canMutationImpactCurrentStyles resource: //devtools/client/inspector/shared/style-change-tracker.js: 66
onMutations resource: //devtools/client/inspector/shared/style-change-tracker.js: 84
_emit resource: //devtools/shared/event-emitter.js: 226
with resource: //devtools/shared/event-emitter.js: 172
with resource: //devtools/shared/event-emitter.js: 324
getMutations resource: //devtools/client/fronts/walker.js: 402
event-emitter.js: 241: 21
[Exception ... "Favicon at" https://forums.appgini.com/favicon.ico "failed to load: Not Found." nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource: ///modules/FaviconLoader.jsm :: onStopRequest :: line 227" data: no] FaviconLoader.jsm: 227: 22
onStopRequest resource: ///modules/FaviconLoader.jsm: 227
[Exception ... "Favicon at" https://forums.appgini.com/favicon.ico "failed to load: Not Found." nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource: ///modules/FaviconLoader.jsm :: onStopRequest :: line 227" data: no] FaviconLoader.jsm: 227: 22
onStopRequest resource: ///modules/FaviconLoader.jsm: 227
[Exception ... "Favicon at" https://forums.appgini.com/favicon.ico "failed to load: Not Found." nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource: ///modules/FaviconLoader.jsm :: onStopRequest :: line 227" data: no] FaviconLoader.jsm: 227: 22
onStopRequest resource: ///modules/FaviconLoader.jsm: 227

I have no idea why AppGini is looking for a favicon here for the admin. But it is the same with the working tables.

Thanks much, Kai

http://managersystem.de/!/2020-06-07_012401.png
http://managersystem.de/!/2020-06-07_012335.png

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 04:59

SkayyHH wrote:
2020-06-06 23:42
I have no idea why AppGini is looking for a favicon here for the admin.
Dear Kai,

none of the errors you have posted has been raised by AppGini Helper Library. All errors have other sources and reasons.

AppGiniHelper errors should always start with "AppGiniHelper" prefix in console output.

Regards,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 05:14

Are you sure this is the error output of the "add new" detail view?
Therefore, problems other than appgini in connection with the helper scripts can be excluded.
Well, according to the error output there are several bugs and problems in other scripts your browser has loaded (chrome extensions?). Just have a look at the given error-source-files, for example: style-change-tracker.js and others.

I cannot see any AppGini error nor AppGini Helper error in the list or errors. So at this point I can not exclude other reasons having nothing to do with AG.

As asked for before: can you please tell us the version number of AppGini javascript Helper library. It will always been logged in thr first few lines of console tab.

Anyway, I am going to check wrapLabels functionality for addNew_x detail views the next days.

Regards,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-07 06:24

Hello,

thank you for checking the function again. The error occurs with chrome, IE and firefox.

Below is the link to the saved website to test yourself. After a while the page jumps to the wrapped version.

ILLEGAL DOWNLOAD LINK OF SkayyHH REMOVED BY ADMIN

Best regards, Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 07:54

...after a while...
You should check in network tab of dev tools if there is any ajax call taking too much time. I guess there is some other script which you have included (or browser extension) which waits for a server reply and therefore blocks the page from being loaded completely. This would explain why the layout change takes place "after a while".

The label wrapping takes place as soon as all previous ajax calls have been completed. This "waiting for ajax complete" is necessary due to dynamically loaded fields like all lookup-fields/dropdowns (lazy loading). Obviously, we cannot wrap labels of lazy loaded fields earlier, because they do not exist in the beginning of page load nor on document.ready. So we have to wait for the lazy loaded fields.

You should be able to reduce the delay by fixing other bugs, file-not-found errors and timeouts we have seen in the log you have posted.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 08:01

Anyone else having problems with .wrapLabels()-function in "add_new" mode, only?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-07 14:28

Did you test my uploaded page?

I have an ajax_check_login.php coming from AppGini. I didn't change anything in AppGini and just created a small test app.
If I deactivate the AppGini Membership System, the error persists.

Kai

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-07 14:57

I`m surprised that you have no problems with it. I tested everything. Locally and on my web server. Likewise with 3 different computers and different browsers.

Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 16:29

@Kai: Finally, thank you for answering my questions and for giving enough infomation to me. I was able to setup a testing project and could experiment with different data types and layouts. I was able to reproduce the behaviour you have mentioned and narrow it down.
new AppGiniLayout ([12])
.add (1, ["#Patient", "Firstname", "Name", "EmployeeNumber", "DateOfBirth", "MaritalStatus", "Age", "HireDate", "Discharge", "Adress", "PersonalEmail" , "PersonalPhone", "Mobilphone", "JobTitle", "Department", "WorkEmail", "WorkPhone", "WorkMobil", "EmergencyKontakt", "Image", "Notes"])
.wrapLabels ();
Where is your second layout row having different widths???


According to the specs and documentation...
... wrapLabels() function can be used for label-width optimization in multi-column layouts having more than one layout row.

In the code you have posted there is only one layout row. So there is no label-size problem which could be fixed by the .wrapLabels function. After all our conversation, I guess you are trying to (mis-) use the .wrapLabels function for a different purpose but for fixing size-problems due to Bootstrap Grid System :? .

Workaround

Anyway, here is a workaround which, after experimenting, is required in the following scenarios:
  • Relevant in Add-New mode, only
    and
  • if you don't have any lookup field
    and
  • if you don't have any custom ajax calls
If all three conditions are true, just add the following line at the end of your TABLENAME-dv.js file.

Code: Select all

$j.ajax("ajax_check_login.php");
This should solve the issue. Please provide some feedback if this helps in the scenario above.
Hope this helps!

Regards,
Jan

PS: Additionally, we are going to implement some kind of fix in next release just in case others are facing similar scenarios in the future.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

SOLVED: wrapLabels bug?

Post by SkayyHH » 2020-06-07 19:25

Thanks a lot. That was the problem.

However, the details in the tab do not match the rest of the layout. Please, see the screenshot.

http://managersystem.de/!/2020-06-07_211704.png

Best regards, Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: wrapLabels bug?

Post by jsetzer » 2020-06-07 19:33

Yes, this is the default layout of AppGini generated detail views. Fortunately, our AppGini Helper Javascript Library contains functions for changing the default:

https://appgini.bizzworxx.de/products/j ... ct-layout/
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-07 21:37

OK. But I also have a gap when I use the wraplabel function with compact mode.

http://managersystem.de/!/2020-06-07_233210.png

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

SOLVED: children tabs expand

Post by jsetzer » 2020-06-08 00:48

You can force expanding children tabs using expand() function:

Code: Select all

var dv = new AppGiniDetailView();
// ...
dv.childrenTabs.expand(true);
chrome_3ulkftmtFX.png
chrome_3ulkftmtFX.png (16.17 KiB) Viewed 4517 times
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

SOLVED: wrapLabels bug?

Post by SkayyHH » 2020-06-08 07:51

Hello,

thanks much. Now the page looks nice :-)

Sorry for the trouble beforehand ...

Kai

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Q: PDF Documentation [ Re: wrapLabels bug? ]

Post by SkayyHH » 2020-06-08 13:11

Hello,

is there a pdf documentation or similar where such functions are described? Like dv.childrenTabs.expand (true);

Thank you very much, Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

ANSWER: PDF-Documentation [ Re: wrapLabels bug? ]

Post by jsetzer » 2020-06-10 06:09

No, there is no PDF documentation but a lot of online documentation, for example here:
Additionally, there is a changelog.txt file inside the zip archive which can be downloaded after purchase and in every update.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: wrapLabels bug?

Post by SkayyHH » 2020-06-10 18:53

Hi, Thanks a lot. I've already looked at this documentations.

Many Greetings, Kai

Post Reply