开发者

How to load images and fragments dynamically in LiveCycle Designer forms?

I've created a开发者_如何学Python 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.

In the xml datasource I've got this element:

<ClientID>SomeNumber</ClientId>

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:

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

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;
...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜