Hi,
Giving that a model can be shared between several views.. How can I know which views are using my model from inside the my model class?
Thanks,
Carlos.
Hi,
Giving that a model can be shared between several views.. How can I know which views are using my model from inside the my model class?
Thanks,
Carlos.
In general, you can't; this would violate the model/view design. Models are sources of data and nothing more; they provide data upon request, without regard for the view asking for it.
Most often, if you find yourself wanting this sort of information, there's something wrong with your design.
seems that public ItemModel API doesn't allow to know connected views.
I think it is correct because the Models provide data and don't need to know where and how these data are displayed.
If you need you can inherits your model class and reimplement setModel in order to save views list
A camel can go 14 days without drink,
I can't!!!
Bookmarks