8
Views
3
Comments
Solved
How can I display the image when I need to edit
Question
Application Type
Reactive

How can I display the image when I need to edit

if i click on edit the result show without  image how can fix this


And if the user chooses a different type of image extension, I need an error message


Also in the attachment OML

Movies.oml

Rank: #56
Solution

Hi Andrew,


You have the image to show what is on variable BinaryDataVar, so you need to set the value that is on the database after the query.

For that, you need to create a OnAfterFetch event on the GetMoviesByActorId query:

And then update the BinaryDataVar with the image on the database:


OML in attachment.


Regards,
João

Movies.oml

Rank: #1443

if the user chooses a different type of image extension, I need an error message


Rank: #56

I missed that part.

You have to add a handler on the OnChange event of the Upload widget:

And there, you can get the extension from the name and do the validation you want. If the extension is not the right one, you reset the Name and BinaryDataVar variables and show an error message to the user:


I don't know which extensions you want, so my example and OML in attachment considers any extension other than .jpg and .png as invalid.

Movies.oml