本文介绍了如何在LiveCycle Designer中的形式动态加载图片和片段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了几个共享模板(.xdp)将在多个客户之间共享。很显然,每个客户都有自己的标志,我想设置在表单生成的标志。

I've created a couple of shared templates (.xdp) which will be shared among several clients. Obviously, each client has their own logo and I'd like to set the logo upon form generation.

我已经成功地动态改变的标志,虽然我不知道如果我的做法是很好的。

I've managed to change the logo dynamically although I'm not sure if my approach is good.

在XML数据源,我得到这个元素:

In the xml datasource I've got this element:

<ClientID>SomeNumber</ClientId>

在窗体本身我设置图像的href与此javascript code:

In the form itself I set the image href with this javascript code:

SomeHiddenTextField::calculate
HeaderLogo.value.image.href = $record.ClientID + "_logo.jpg";

我有存储在服务器上,在相同的文件夹共享模板的标识。

I've got the logos stored on the server in the same folder as the shared templates.

这是一种正常的方式来加载标识动态?

Is this an alright approach to load logos dynamically?

我一直在试图实现与每一个客户的页脚片段相同的动态行为,但我一直无法弄清楚如何按需加载这些。我的可以的使每个页脚片段中的形象,但我想避免,如果可能的。

I've been trying to achieve the same dynamic behaviour with each client's footer fragment, but I have been unable to figure out how to load these on demand. I could make each footer fragment in to an image but I'd like to avoid it if possible.

推荐答案

我大致知道加载图像动态我必须做到以下几点:

I know generally for loading images dynamically I had to do the following:

创建返回一个byte []与图像数据SOAP服务的(Base64)

Create a SOAP service that returns a byte[] with the image data (base64)

从的LiveCycle调用服务:

Call the service from LiveCycle:

var cURL = "http://host/path/MyService?wsdl"
var oService = SOAP.connect(cURL);
try {
    var cText = "";
    var myRequest;
    var cSOAPAction;
myRequest = { 
 myMethod: { 
 Param1:value
 };
cSOAPAction= "http://mynamespace/myMethod";
}
    var myNamespace = "http://mynamespace";

    var oResults = SOAP.request ({
        cURL: cURL,
        oRequest: oGetNameByIdRequest,
        cAction: cSOAPAction,
        bEncoded: false,  // If false then document/literal encoding will be used.
        cNamespace: myNamespace,
        cResponseStyle: SOAPMessageStyle.Message
    }); 
    HeaderLogo.rawValue = oResults[0].soapValue[0].soapValue;
...

这篇关于如何在LiveCycle Designer中的形式动态加载图片和片段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 02:02