Roger Blanchard
447 posts
Registered:
29 Jun 2018
23 Oct 2020
Link to this post
I have a form where we allow the user to select an image from disk and store the base64 encoded flavor in a CLOB. Right now I am storing that value in an ultratextbox and it will flow back to the server when we save changes. I would prefer not having a control on the form to store this. I was thinking using the DatasetController to GET/SET the value. The GET will work just fine...
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
METHOD PUBLIC LONGCHAR GetImageData ( ):
DEFINE VARIABLE lcImageData AS LONGCHAR NO-UNDO.
IF AVAILABLE eItemImage THEN
DO:
COPY-LOB FROM eItemImage.ImageData TO lcImageData.
RETURN lcImageData.
END.
However,
The SET does not appear to work. I will already be "ModifyingData" in the viewer. If I use the code below should that work where the value will get back to the server? If not what would be the best way to do this?
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
METHOD PUBLIC VOID SetImageData ( plcImageData AS LONGCHAR ):
IF AVAILABLE eItemImage THEN
DO:
COPY-LOB FROM plcImageData TO eItemImage.ImageData.
END.
RETURN.
END METHOD.
RETURN "".
END METHOD.