Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

在本文中,我们将向您展示如何使用JDBC数据库绑定器显示来自表单上传字段的图像  。

Image Added

图1:列表中的图像

这就是我们想要实现的,如上图1所示。

Image Added

我们需要首先获取图像的路径,如上面的图2所示。

图2:获取图像的URL

Image Added

然后,在Datalist中,我们将需要构建  img  html标签,模仿图片的URL路径。在这种情况下,我们使用默认的数据库,并基于MySQL数据库编写SQL。

In this article, we will show you on how to show images from form upload field by using the JDBC 数据库绑定器.

Image Removed

Figure 1: Image in a listing

This is what we want to achieve, as shown in Figure 1 above.

Image Removed

We will need to get the path to the image first, as shown in Figure 2 above.

Figure 2: Getting the URL of the image

Image Removed

Then, in the Datalist, we will need to construct the img html tag, mimicking the image URL path. In this case, we are using the default database and writing the SQL based on MySQL database.

Code Block
languagesql
titleSQL
SELECT id, c_title, c_image, concat("<img src='http://localhost:8080/jw/web/client/app/imageInList/1/form/download/sample/", id, "/", c_image, ".'/>") as 'image',
concat("<img src='http://localhost:8080/jw/web/client/app/imageInList/1/form/download/sample/", id, "/", c_image, ".thumb.jpg'/>") as 'imagethumb' FROM app_fd_sample

Note: If you are using Joget Workflow v5, you can control whether you want the image files to be accessed as anonymous or not. In Joget Workflow v4, one must be logged in in order to see the images.

注意:如果您正在使用Joget Workflow v5,则可以控制是否要将图像文件作为匿名访问。在Joget Workflow v4中,必须先登录才能看到图像。

您可以下载本文中使用的示例应用程序以供参考。You can download sample app used in this article for your reference.

View file
nameAPP_imageInList-1-20160406111704.zip
height250

...