SHOWING IMAGE IN A VARIABLE TO IMAGE WIDGET

SHOWING IMAGE IN A VARIABLE TO IMAGE WIDGET

  

hi there, i have a problem where i have a variable that contains an image. When i click a button, i want to show it in a widget. Unfortunately, there is no way to do it.

I am trying some ways, like create a session to store the image, and then call rest api to return it. 


thank you, 

indra

Hi Indra,

Save your binary data in a temporary table

Create a screen that receives an id to find the binary data 

On his preparation you use this binary data and return it using download widget

Now in your Image widget you choose URL method and uses GetEntryURL() to point to  this Screen you have been created before. 


Regards

Fabio



I use mysql db...so..

1. I have to create temporary table using advanced query

2. Insert the image into the table

3. Create a screen with input parameter, say it an id

4. On its preparation action.. the image fetched is downloaded... 

5. In ANOTHer screen where the image widget locates.. call the screen where the download occurs by using getentryUrl..

Is it correct? Tq


How to insert and query image in a temporary table i created? Using advanced query? Tq

Can i just pass image to the input of the download-screen without using temporary table? Tq

Your steps are correctly. I will put an example here, Give me some minutes. At moment I am without an stable internet connection. As soon as come back to my office I will do it. 

You can use an standard table on your espace, and use the create and delete methods. It is not necessary uses adv query. You could create it before call your download screen and delete it on preparation just after to fetch. So your temporary table will be clean.

I suggest to use temporary table , because binary data on input parameters is not recomended. And I believe you are facing some issues if you try to use GetEntry with this kind of parameter.

Regards

Fabio



 

Solution

Hello Indra,

What I have done for a situation where I want to dynamically change the image is that I created a ViewDocument webpage that doesnt have anything. 

In the preparation of this Page I load the binary data, and at the end of the Preparation I set a Download instead of an End or Navigate. And you got to make sure that the Download has the Save to Disk property set to 'No'

So the next thing I do is that where I want to show the image you set the Image Widget to be of type External and point the URL to point to the Document page.

Since we have the Download in the preparation it will load the binary data into the Image Widget


So using MySql you can get the BinaryData in the Preparation of the ViewDocument page which would be the equivalent to my GetObject action.

I did it this way because I did not want to have to add a temporary table to my database.

Hope this helps.

Andres

Solution

Thank you very much  Sirs, it works.

Andres Moreno wrote:

Hello Indra,

What I have done for a situation where I want to dynamically change the image is that I created a ViewDocument webpage that doesnt have anything. 

In the preparation of this Page I load the binary data, and at the end of the Preparation I set a Download instead of an End or Navigate. And you got to make sure that the Download has the Save to Disk property set to 'No'

So the next thing I do is that where I want to show the image you set the Image Widget to be of type External and point the URL to point to the Document page.

Since we have the Download in the preparation it will load the binary data into the Image Widget


So using MySql you can get the BinaryData in the Preparation of the ViewDocument page which would be the equivalent to my GetObject action.

I did it this way because I did not want to have to add a temporary table to my database.

Hope this helps.

Andres

Great solution Andres. Better than add a temporary table. 

Congrats


Best Regards

Fábio



I know this is old but you dont have to do anything really fancy with temporary tables.


here is my solution:



You simply have to reference the binaryToBase64 function under the binaryData module that comes with the platform. 


hope this helps someone