Images on datagrid

Posted by mflanegan on 06-Nov-2014 06:38

Hi there,

We have a datagrid with images on each row, we are able to return the images correctly from the BLOB field. When assigning the images to the image control, the images are all displaying one row lower than they should be. The dataset is correct, it just seems to be the assignment of the image that is giving us issues. The image control in the first row of the grid is displaying the default 'no-image' of the control and not our default.

Seems there is a delay between our assignment and the control rendering. The assignment of the image to the image control happens via a local storage variable with javascript. Anyone able to help us align the images correctly? 

Thanks in advance.

Posted by ymaisonn on 14-Nov-2014 05:10

Cause:

The following error...

The URL: GET appdesigner.rollbase.com/.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)

..was occuring because when mapping the tt-cimage JSDO element to the imgPart element, the src attribute was assigned the image bytestream

<img src=".../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q==" .../>

The client would then process the src value as a target URL and run a GET operation on the server.

the correct value for src should be

"data:image/jpg;base64,.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q=="

In other words we need to prepend "data:image/jpg;base64," to the image bytestream.

This can be achieved on the client via JS. However in the case of datagrids, the value is assigned AFTER the JSDO read operation is complete for the grid item. This causes the src value to be assigned to the next image grid element.

Resolution:

Build the content type directly on the AppServer, ie prepend the "data:image/jpg;base64," to the CLOB temp table field that stores the image bytestream.

ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = "data:image/jpg;base64," + BASE64-ENCODE(encdmptr) 

All Replies

Posted by mflanegan on 07-Nov-2014 02:19

has anyone got any ideas for me?

This is pretty urgent.

Posted by Santosh Patel on 07-Nov-2014 03:23

A screenshot would help understand the issue. Also do share the javascript code that you use. Thanks.

Posted by mflanegan on 07-Nov-2014 04:12

The below javascript is in the local storage variable edit js. The local storage variable is linked to the clob field, returned by the dataset.
Appery("imgPart").attr("src","data:image/jpg;base64," + value);
 
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: Santosh Patel [mailto:bounce-sapatel@community.progress.com]
Sent: 07 November 2014 11:24 AM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by Santosh Patel

A screenshot would help understand the issue. Also do share the javascript code that you use. Thanks.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 04:16

The code to display the image is it within the data mapping?

Posted by mflanegan on 07-Nov-2014 04:24

Hi John,
 
Yes it is.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 12:18 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

The code to display the image is it within the data mapping?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 04:29

great - Can you upload the image to here showing the data mapping.

Posted by mflanegan on 07-Nov-2014 04:31

 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 12:30 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

great - Can you upload the image to here showing the data mapping.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 04:57

Is the image on the grid called imgPart? I dont see any mapping to that.

Posted by mflanegan on 07-Nov-2014 05:37

The local storage variable is setting the value of the image control with the javascript code.
That’s the way I thought it should be done as the database is sending back the image in a binary format and needs to be converted on the client side.
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 12:59 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

Is the image on the grid called imgPart? I dont see any mapping to that.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by mflanegan on 07-Nov-2014 05:41

This is the appserver code:
 
    
        FIND FIRST catimage WHERE catimage.pm-partno EQ phDataset:GET-BUFFER-HANDLE(1)::pm-partno NO-LOCK NO-ERROR.
        IF AVAILABLE catimage THEN DO:  
 
            COPY-LOB FROM OBJECT catimage.cti-image TO encdmptr NO-CONVERT NO-ERROR.
            ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = BASE64-ENCODE(encdmptr)
                   encdmptr = ?.
        END.
        ELSE DO:
            COPY-LOB FROM FILE "c:\MidasWeb\MidasWeb\MobileImg\noimage.jpg" TO OBJECT encdmptr NO-CONVERT NO-ERROR.
            ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = BASE64-ENCODE(encdmptr)
                   encdmptr = ?.           
        END.
       
        IF phDataset:GET-BUFFER-HANDLE(1)::tt-cimage EQ ? THEN DO:           
            COPY-LOB FROM FILE "c:\MidasWeb\MidasWeb\MobileImg\noimage1.jpg" TO OBJECT encdmptr NO-CONVERT NO-ERROR.
            ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = BASE64-ENCODE(encdmptr)
                   encdmptr = ?.
        END.  
 
Here is the data mapping:
 
 
Then in edit js. Next to the local storage variable “ltest” I am using this javascript:
 
Appery("imgPart").attr("src","data:image/jpg;base64," + value);
 
This is the full detail of what I’m doing. Maybe this could also help someone else in the future that’s trying to do the same thing.
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: mflanegan [mailto:bounce-mflanegan@community.progress.com]
Sent: 07 November 2014 01:38 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by mflanegan
The local storage variable is setting the value of the image control with the javascript code.
That’s the way I thought it should be done as the database is sending back the image in a binary format and needs to be converted on the client side.
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

 

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

 

Disclaimer

 
[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 12:59 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

Is the image on the grid called imgPart? I dont see any mapping to that.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

Posted by John Goodland on 07-Nov-2014 05:52

Have you tried moving the mapping to the imgPart and not the local variable?

Use something like this for the JS behind the imgPart

element.attr("src","data:image/jpg;base64," + value);

Posted by mflanegan on 07-Nov-2014 05:57

Hi John,
 
This is the result:
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 01:53 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

Have you tried moving the mapping to the imgPart and not the local variable?

Use something like this for the JS behind the imgPart

element.attr("src","data:image/jpg;base64," + value);

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 06:03

The JS behind the local variable is it just:-

Appery("imgPart").attr("src","data:image/jpg;base64," + value);

Also, in chrome if you inspect the element then goto resources and view the JSON dataset for the grid. Copy this JSON dataset throw it into http://json.parser.online.fr/ and the answer should become clear. You are looking at what the JSON dataset says for imgPart

Posted by mflanegan on 07-Nov-2014 06:14

I was using the safari browser previously when I tried your way with mapping the field to the image control. I now tried to test it on chrome.
The image displays in the right place then suddenly disappears. In the debugger I get this error message:
 
‘Resource interpreted as Image but transferred with MIME type text/html’
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 02:04 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

The JS behind the local variable is it just:-

Appery("imgPart").attr("src","data:image/jpg;base64," + value);

Also, in chrome if you inspect the element then goto resources and view the JSON dataset for the grid. Copy this JSON dataset throw it into http://json.parser.online.fr/ and the answer should become clear. You are looking at what the JSON dataset says for imgPart

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 06:21

Is imgPart an image on your grid? If so, try removing the JS behind the imgPart mapping

Posted by mflanegan on 07-Nov-2014 06:31

I have removed the JS. The image doesn’t appear at all now, not even for one second. It just displays the images like the last screen shot I sent you.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 02:22 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

Is imgPart an image on your grid? If so, try removing the JS behind the imgPart mapping

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by John Goodland on 07-Nov-2014 06:35

I need to see the JSON dataset for the grid. Could you drop this into http://json.parser.online.fr/ and see whats in imgPart?

Posted by John Goodland on 07-Nov-2014 06:42

No problems :)

My beer account is available for donations in PUG - Dusseldorf ;)

Posted by mflanegan on 10-Nov-2014 01:16

Hi john,
 
There seems to be a new error now:

GET https://appdesigner.rollbase.com/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)
 
From the research I have done, it looks like I would need to use a post instead of a get. If you agree with this are you able to tell me how would one implement this on the client side?
 
Thanks in advance.
 
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: john.goodland [mailto:bounce-johngoodland@community.progress.com]
Sent: 07 November 2014 02:43 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by john.goodland

No problems :)

My beer account is available for donations in PUG - Dusseldorf ;)

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by mflanegan on 11-Nov-2014 02:27

Hi There,

After my image has been returned correctly, it is being run again and is looking at remote address,  54.208.2.17:443 and the request URL begins with appdesigner.rollbase.com followed by the value of the image. This is causing error 414 (Request-URI Too Large), therefor causing the image control to be cleared.

Why would this be happening? and what can one do to prevent this from happening?

Thanks in advance.

Posted by ymaisonn on 11-Nov-2014 06:48

Why do you pass the image bytestream in the request URL?  

Posted by mflanegan on 11-Nov-2014 07:21

It’s the only way we know how to do it, what would you suggest doing?
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: ymaisonn [mailto:bounce-ymaisonn@community.progress.com]
Sent: 11 November 2014 02:50 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by ymaisonn

Why do you pass the image bytestream in the request URL?  

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by mflanegan on 11-Nov-2014 08:29

My apologies,
 
I am not passing in the request. I am getting it returned in the dataset which is json formatted string data.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: mflanegan [mailto:bounce-mflanegan@community.progress.com]
Sent: 11 November 2014 03:22 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by mflanegan
It’s the only way we know how to do it, what would you suggest doing?
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

 

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

 

Disclaimer

 
[collapse]
From: ymaisonn [mailto:bounce-ymaisonn@community.progress.com]
Sent: 11 November 2014 02:50 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by ymaisonn

Why do you pass the image bytestream in the request URL?  

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

Posted by ymaisonn on 11-Nov-2014 11:12

The dataset should return in the response body, so such an error shall not occur.

The URL: GET appdesigner.rollbase.com/.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)

is a request (not a response) sent from the client to the server to read data.

Posted by mflanegan on 12-Nov-2014 00:14

The error does not occur the response body, it is happening in the get but the get should not be firing. Is there any way we can stop the get from firing?
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: ymaisonn [mailto:bounce-ymaisonn@community.progress.com]
Sent: 11 November 2014 07:13 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by ymaisonn

The dataset should return in the response body, so such an error shall not occur.

The URL: GET appdesigner.rollbase.com/.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)

is a request (not a response) sent from the client to the server to read data.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by ymaisonn on 14-Nov-2014 05:10

Cause:

The following error...

The URL: GET appdesigner.rollbase.com/.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)

..was occuring because when mapping the tt-cimage JSDO element to the imgPart element, the src attribute was assigned the image bytestream

<img src=".../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q==" .../>

The client would then process the src value as a target URL and run a GET operation on the server.

the correct value for src should be

"data:image/jpg;base64,.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q=="

In other words we need to prepend "data:image/jpg;base64," to the image bytestream.

This can be achieved on the client via JS. However in the case of datagrids, the value is assigned AFTER the JSDO read operation is complete for the grid item. This causes the src value to be assigned to the next image grid element.

Resolution:

Build the content type directly on the AppServer, ie prepend the "data:image/jpg;base64," to the CLOB temp table field that stores the image bytestream.

ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = "data:image/jpg;base64," + BASE64-ENCODE(encdmptr) 

Posted by mflanegan on 16-Nov-2014 23:53

Hi
 
Yes, this sorted out the issue. Thank you very much for your help.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: ymaisonn [mailto:bounce-ymaisonn@community.progress.com]
Sent: 14 November 2014 01:11 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] Images on datagrid
 
Reply by ymaisonn

Cause:

The following error...

he URL: GET appdesigner.rollbase.com/.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q== 414 (Request-URI Too Large)

..was occuring because when mapping the tt-cimage JSDO element to the imgPart element, the src attribute was assigned the image bytestream

<img src=".../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q==" .../>

The client would then process the src value as a target URL and run a GET operation on the server.

the correct value for src should be

"date:image/jpg;base64,.../2wBDAAQDAwMDAgQ…dcavddzPbL2w+b2S9n7jmgBx9LRbClzBW1rhSleVaaUuLt7OMVX2/Mvze3h7ZcfacgAB//2Q=="

In other words we need to prepend "date:image/jpg;base64," before the image bytestream.

This can be achieved on the client via JS. However in the case of datagrids, the value is assigned AFTER the JSDO read operation is complete for the grid item. This causes the src value to be assigned to the next image grid element.

Resolution:

Build the content type directly on the AppServer, ie prepend the "date:image/jpg;base64," to the CLOB temp table field that stored the image bytestream.

ASSIGN phDataset:GET-BUFFER-HANDLE(1)::tt-cimage = "date:image/jpg;base64," + BASE64-ENCODE(encdmptr) 

 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed