The solution of Joshua is still the way to go, since the widget must be placed inside the context. If you have created a custom widget with multiple datasources, you don't comply with the Mendix approach, which is as Joshua describes. OR you have to place the widget in the main dataview and pass the referenced objects using an expression something like this $currentObject/Entity1_Entity2/Entity2/Attribute
My gut feeling says me that you created your own custom widget, without the right knowledge of Mendix. I strongly recommend that you first take the Rapid developer learning path before you start building custom thing for Mendix
Instead of retrieving the object 2 in the microflow, you can try to retrieve it from the page, if it’s a simple association you just have to create a dataview of object 1, and inside of it create another dataview of object 2 (linked by association).
If the logic to retrieve the object 2 is a bit more complex you can use inside the dataview of the object 1, another dataview with an xpath source or a microflow source.