Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Custom) Widget (sortablejs) doesn't work (mostly) #149

Open
MartinLichtblau opened this issue Oct 31, 2019 · 1 comment
Open

(Custom) Widget (sortablejs) doesn't work (mostly) #149

MartinLichtblau opened this issue Oct 31, 2019 · 1 comment
Labels

Comments

@MartinLichtblau
Copy link

Using widgets is a pain using angular2, both with the widgets library and custom widgets. At least for me trying to integrate sortablejs and barrating.
I looked into all examples and found that creating a custom widget gives you more control, yet this doesn't work either.

Why is this error happening only on first load and disappears after reloading (F5) and then successfully showing sortablelist?
Error: Cannot find template with ID survey-widget-sortablelist
Full Error Log:

Message: Unable to process binding "if: function(){return koCurrentPage }"
Message: Unable to process binding "template: function(){return { name:'survey-page',data:koCurrentPage,afterRender:koAfterRenderPage} }"
Message: Unable to process binding "template: function(){return { name:'survey-rows',data:$data} }"
Message: Unable to process binding "foreach: function(){return { data:rows,as:'row'} }"
Message: Unable to process binding "if: function(){return row.visible }"
Message: Unable to process binding "foreach: function(){return { data:row.elements,as:'question',afterRender:row.koAfterRender} }"
Message: Unable to process binding "if: function(){return question.isVisible }"
Message: Unable to process binding "template: function(){return { name:question.koElementType,data:question,afterRender:$parent.koElementAfterRender} }"
Message: Unable to process binding "template: function(){return { name:question.koTemplateName(),data:question,afterRender:question.koQuestionAfterRender} }"
Message: Cannot find template with ID survey-widget-sortablelist ; Zone: angular ; Task: Promise.then ; Value: ViewWrappedError Error: Error in :0:0 caused by: Unable to process binding "if: function(){return koState() =="running" }"
Message: Unable to process binding "if: function(){return koCurrentPage }"
Message: Unable to process binding "template: function(){return { name:'survey-page',data:koCurrentPage,afterRender:koAfterRenderPage} }"
Message: Unable to process binding "template: function(){return { name:'survey-rows',data:$data} }"
Message: Unable to process binding "foreach: function(){return { data:rows,as:'row'} }"
Message: Unable to process binding "if: function(){return row.visible }"
Message: Unable to process binding "foreach: function(){return { data:row.elements,as:'question',afterRender:row.koAfterRender} }"
Message: Unable to process binding "if: function(){return question.isVisible }"
Message: Unable to process binding "template: function(){return { name:question.koElementType,data:question,afterRender:$parent.koElementAfterRender} }"
Message: Unable to process binding "template: function(){return { name:question.koTemplateName(),data:question,afterRender:question.koQuestionAfterRender} }"
Message: Cannot find template with ID survey-widget-sortablelist
    at ViewWrappedError.ZoneAwareError (http://127.0.0.1:5200/static/node_modules/zone.js/dist/zone.js:992:33)
    at ViewWrappedError.BaseError [as constructor] (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:1239:20)
    at ViewWrappedError.WrappedError [as constructor] (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:1297:20)
    at new ViewWrappedError (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:6167:20)
    at CompiledTemplate.proxyViewClass.DebugAppView._rethrowWithContext (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:12385:27)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:12358:22)
    at ViewRef_.detectChanges (http://127.0.0.1:5200/static/node_modules/@angular/core/bundles/core.umd.js:9377:24)
    at RouterOutlet.activate (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:5058:46)
    at ActivateRoutes.placeComponentIntoOutlet (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4337:20)
    at ActivateRoutes.activateRoutes (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4304:30)
    at eval (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4240:62)
    at Array.forEach (<anonymous>)
    at ActivateRoutes.activateChildRoutes (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4240:33)
    at ActivateRoutes.activateRoutes (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4287:26)
    at eval (http://127.0.0.1:5200/static/node_modules/@angular/router/bundles/router.umd.js:4240:62)

Of course I prefer to use the widgets library. But with it no widgets shows up and no error is thrown; so it's impossible to get it to work.

@tsv2013 tsv2013 transferred this issue from surveyjs/survey-library Oct 31, 2019
@tsv2013
Copy link
Member

tsv2013 commented Oct 31, 2019

Have you seen this repo - https://github.com/surveyjs/surveyjs_angular_cli ?
It demonstrates custom widgets integration with Angular 2+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants