Insertion of images in the entity and display
Application Type
Traditional Web



I'm having trouble displaying the images I'm saving to the entity in a list. Follow my entity diagram and oml



The logic of CreateOrUpdateProdutoPicture, is within the save action



BuyApp.oap

mvp_badge
MVP
Solution

Hi Fabiano,


The method needs to be set to Submit to actually be pushed to the server and be saved as I mentioned above:

You are using the widget right to show the image.

Hello Fabiano Ferreira

In the assign change the attribute PersonPhotoId from ProdutoId to CreateOrUpdateProdutos.Id

As the id from the ProdutoPicturo and from the Produto are the same, so we must ensure that. Your code is working only for exiting Produtos but when we are creating a new the Id are different so it will crash. 


Regards

Gonçalo Almeida


mvp_badge
MVP

Hi Fabiano,


I noticed some things on your code that needed fixing:

1. When you are "preparing" the record of the ProdutoPicture, you should reference the ProdutoId recently created, not the one in parameter because it is null when you are creating:


2. When you are submitting binaries to the database, your button / link method needs to be set to Submit, not to Ajax Submit. Take into account that with Submit, AJAX refreshes won't work.


I send you the OML in attachment.


Kind Regards,
João

BuyApp2.oml


Thanks, now I will try to display the photo in a list.

 

mvp_badge
MVP
Solution

Hi Fabiano,


The method needs to be set to Submit to actually be pushed to the server and be saved as I mentioned above:

You are using the widget right to show the image.



Thanks now it worked, I hadn't noticed this parameter null

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.