Skip to content

Conversation

@BigadePreston
Copy link

I was getting browser console errors with this widget. Unsubscribe tried to use an undefined value - because subscribe was not working. Also _resizeImage was called (apparently) after uninitialize when imageNode was empty - so I added a condition around that. I'm not very familiar with the lifecycle of these so there may be a better solution to that.

Regards

Adrian

@JelteMX
Copy link
Contributor

JelteMX commented Feb 28, 2017

What kind of errors do you get? And in what Mendix version?

mx.data.subscribe should not be used anymore, so I can't accept this PR

@BigadePreston
Copy link
Author

Hi. I am using Mendix 6.10.3. Using the test app (upgraded to that version) I get 'Unitialize of Dynamic Image Viewer failed' referring to DynamicImage.js:56. This happens when I close the Image Attribute test page.

image

If I change to use this.subscribe/unsubscribe I still get this. Is this because, when uninitialize is called the _BaseWidget has already unsubscribed subscriptions? So the uninitialize can have the unsubscribe calls removed?

I also have another issue with this widget. Under some circumstances _updateRendering is called multiple times for a single instance of the widget and each time this.connect is called. The result is that clicking on the image causes the connected microflow to be called more than once. I propose recording that connect has been called for the Widget and calling disconnect before connect if it has.

Thanks
Adrian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants