You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
1 - The custom widget may have it's own P4A ID attribute but if we can't reference that in javascript attached to the application's mask. If there's two widgets, they need different IDs and we can easily handle that if the javascript was in the getAsString() of the custom widget
2 - We can set up variables and constants as part of the widget object but we can't get at those from javascript written as part of the parent mask.
3 - To include the custom widget in your application, you need more configuration to set it up, you can't just drop the widget into your application directory, reference it in a build() function and then expect it to work straight away. You have to copy the widget and then insert the javascript manually. It's sort of OK if you wrote the widget yourself, know how it works and what's needed. It's not OK if you want to release the widget for others to download and use - there's lots of special instructions needed and maybe more support questions...
I'm happy to help debug this issue.
The text was updated successfully, but these errors were encountered:
For the "installation" or a contrib widget I always suggest you to put everything inside the "libraries" folder of your application, it's the best place to keep everything in order.
There are work-arounds, sure. it just seems counter-intuitive to have to do that. If you can point me in the right direction, I'm happy to work on this solution myself
they're not workaround, it's the way you gather widget's ids in p4a's javascript.
also cause javascripts could be different from a widget instance to another so..
I still maintain a widget's javascript should be coded into the widget itself, not added to as part of the parent mask.
I know it doesn't have a proper template file but you can easily require it inside the getasstring fuction
I'm not convinced even this works. In ajax mode, all additional <script></script> code is dropped. All that's kept is what you put inside an onclick="" attribute.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Regarding https://sourceforge.net/projects/p4a/forums/forum/340765/topic/5905682
This could do with being fixed for three reasons:
1 - The custom widget may have it's own P4A ID attribute but if we can't reference that in javascript attached to the application's mask. If there's two widgets, they need different IDs and we can easily handle that if the javascript was in the getAsString() of the custom widget
2 - We can set up variables and constants as part of the widget object but we can't get at those from javascript written as part of the parent mask.
3 - To include the custom widget in your application, you need more configuration to set it up, you can't just drop the widget into your application directory, reference it in a build() function and then expect it to work straight away. You have to copy the widget and then insert the javascript manually. It's sort of OK if you wrote the widget yourself, know how it works and what's needed. It's not OK if you want to release the widget for others to download and use - there's lots of special instructions needed and maybe more support questions...
I'm happy to help debug this issue.
The text was updated successfully, but these errors were encountered: