Domanda

I have been given the unenviable task of displaying a logo on a flex 3.2 form on our website. I'm learning flex as I go, and I can embed a logo now.

The problem is, I need to display a different logo, depending on which client the user works for. And I need to have it working by end of day, Friday, August 30th. As in, this Friday.

This is the code I have for embedding the logo:

<mx:GridRow width="100%" height="100%">
    <mx:GridItem width="100%" height="100%" colSpan="6">
        <mx:Image width="180" source="@Embed('/assets/images/logo.JPG')"/>
    </mx:GridItem>
</mx:GridRow>

So, what I need to know is, is there any way to get Flex 3.2 to display a different logo for each client? The above code obviously isn't going to do it.

As a further bit of info, we do have the logos as blobs in the Oracle database.

Thanks for any help.

È stato utile?

Soluzione

You need not embed, you can give path to the images on the server. like

 <mx:Image width="180" source="http://somedomain.com/images/logo.JPG" 
id='image'/>

OR, using the id of the image component, you can assign the logo dynamically, like the following

private function onCreationcomplete(e:FlexEvent):void
{
if(client ='xxyy'){
 image.source = 'http://somedomain.com/images/xxyy.JPG ';
}
}

Altri suggerimenti

If you are familiar with BlazeDS, then you could try this approach: BLOB from Java to Flex via BlazeDS.

For the approach from @Zeus I would recommend to write an image servlet which delivers the client logo at request from your database blob.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top