Basic Question About Image Viewer and Loader

0
Hi All, Pardon the basic question about Image Viewer and Image Loader as I am a novice (1 week old) still exploring the power of Mendix. Context: I have a product entity that I want to user to be able to upload a product image. What I tried 2 approaches: (1) I created a Product entity with the usual attributes (name, desc, etc) and I created another ProductImage entity that is generalized from System.Image. Then I added a *-1 association (ProductImage_Product) linking the 2 entities. (2) I modified Product entity to be generalized from System.Image. (I don’t like this because it means I can only have 1 image per product). Challenges faced: (a) For approach 1 above, within Product_NewEdit, I created the outer data view for Product, and I tried to add an nested data view for the ProductImage_Product association. But when I click on the select entity button, I cannot find the associated ProductImage entity. I can only see the Product entity. (b) For approach 2, because Product is generalized from System.Image, in Product_NewEdit, I am able to add the Image Loader widget within the Product data view. However, when I run it, the Browse button doesn’t react. What did I do wrong? ** embarrassed smile **
asked
1 answers
0

In approach a you need to add a listview in de outer dataview, as you will be displaying multiple items. A dataview will only display 1 item.

In approach b there can be an issue with the security or even with some styling, but as this is not your desired situation, go for approach a with the list view.

answered