Info window, image fieldtype doesn't work

Description

i was able to select on info window - product info - an reference = image for column imageurl

 

 

 

when refresh product info
1. when no product with image url no exception, returning 0

2. when product includes images/iD32.png returning database exception error

3. when product referring to external url returning database exception

Proposal

  1. fix above use cases - support url fieldtype with valid image url *.jpg, *.jpeg, *.webp, *.png

  2. add support for images referring to columns XX_anyimagefield_ID

  3. idea: addionally support image from attachment (looks not practical

  4. if no image show placeholder - no image :)

depends on zk component feature, would be great support on hower for showing image with original or max image size

example. thumbnail size can be 100x100px but original can be 500x500 (show in hover box)

 

Our custom implementation example

we are in progress implementing a product supplemental window based on attributes comparison. this already support load display images based. allow close and replace sales order line.

 

Environment

v12

Attachments

9

Activity

Show:

Carlos Ruiz October 2, 2024 at 9:57 AM

Thanks - will test it - can you please add wiki documentation page for this?

Heng Sin Low October 2, 2024 at 8:51 AM

Hi ,

I’ve fixed the web image URL support for AD_Form, AD_InfoWindow and AD_InfoProcess and merge the font icon patch you uploaded above.

Regards,

Low

Carlos Ruiz September 30, 2024 at 1:48 PM

Thanks

I approved the pull request 2466 as the tests were successful.

 

However, I would advice to open a new ticket for fixing and making more uniform the management of AD_Form, AD_InfoProcess, AD_InfoWindow and AD_PrintTableFormat.

It is curious also that AD_PrintFormatItem can manage the three cases, would be great if all ImageURL can manage the same.

But from my tests I noticed:

  • AD_Form, AD_InfoWindow → I tried to test with the value ā€œbellā€ or ā€œbell16.pngā€ - basically font-icon is not supported because the Tab.decorate tries to find an internalURL and when not found then is used as imageKey not taking into account if is a font-icon. The attached patch SupportIcon.patch ā€œsolvesā€ that, but I think is not the best solution

  • AD_InfoProcess → I tried also to test here with ā€œbellā€ → error, ā€œbell16.pngā€ → error, ā€œasdf/bell16.pngā€ → worked, translated to bell

It would also be great to document how those fields work, can be in the same Help of the columns stating that are intended for internal images. And also if possible give a link to where we can find the list of font-icons that can be used. I tested with ā€œbellā€ found on the list but I’m not sure if that’s the correct version supported.

Heng Sin Low September 30, 2024 at 6:41 AM

  • AD_Form ImageURL, load from theme or fragment attached to org.adempiere.ui.zk

  • AD_InfoProcess Image URL, load from theme

  • AD_InfoWindow ImageURL, load from theme or fragment attached to org.adempiere.ui.zk

  • AD_PrintFormatItem.ImageURL, load from web, theme or fragment attached to org.adempiere.ui.zk

  • AD_PrintTableFormat.ImageURL, load from web

  • AD_UserDef_Info.ImageURL, same as AD_InfoWindow ImageURL

The new ImageURL editor only support web URL.

Carlos Ruiz September 27, 2024 at 11:47 AM

Hi - my test cases:

  • Changed M_Product.ImageURL to be the new type ImageURL

  • Added images to M_Product.ImageURL, AD_User.AD_Image_ID, C_BPartner.Logo_ID

  • Added image to Product Info and BP Info

  • Created an info window for User with image

  • Added an ImageURL icon to Info Window User

  • Added an ImageURL to AD_Form Payment Allocation

Success tests:

  • new imageURL editor works fine

  • displaying the image in grid and info windows works fine

  • hovering over the image works fine but has a problem (see below)

Found some code needs:

  1. Please add the new type ImageURL to DisplayType.getDescription

Failed tests cases:

  1. Model Generator is generating an Object class type instead of a String - I mean, if I generate the X_M_Product the get/setImageURL uses Object instead of String

  1. Product Info
    open the image on hover
    double click on image (the full image remains on foreground and cannot be closed - not even a change role removes the image, just a logout)

  2. (Probably old problem not related to this ticket): the ImageURL on AD_Form and AD_InfoWindow is not working, it just shows an empty box on the tab when opened, and it doesn’t show anything on the Views dashboard.

 

Wondering also if some of the ImageURL fields can be converted to the new type, in:

AD_Form
AD_InfoProcess
AD_InfoWindow
AD_PrintFormatItem
AD_PrintTableFormat
AD_UserDef_Info
I_Product
M_Product

Or maybe some of these are OK to change, but others could have collateral consequences?

 

Regards,

Carlos Ruiz

Heng Sin Low September 24, 2024 at 1:07 PM
Edited

  • Added Image URL display/data type

  • Added client level AD_SysConfig ZK_THUMBNAIL_IMAGE_HEIGHT, default to 100

  • Added client level AD_SysConfig ZK_THUMBNAIL_IMAGE_WIDTH, default to 100

  • Implemented thumbnail rendering for Image and Image URL data type (Grid View and Info Window)

  • Implemented showing full size image for thumbnail on hover of the thumbnail image

Norbert Bede September 19, 2024 at 9:23 AM

ok, i read it again, no not supported yet.

Norbert Bede September 19, 2024 at 9:19 AM

attached. n

Heng Sin Low September 19, 2024 at 3:27 AM

Hi , what is your team use to display image in the custom window above ?

Does it support thumb nail and show original size on hover ?

I’m thinking whether some of those code can be reused to add image URL support to info window.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created September 14, 2024 at 11:27 AM
Updated December 2, 2024 at 2:31 PM
Resolved October 11, 2024 at 10:17 AM