Setting Background Colour with a Value Retrieved from a Database

I'm retrieving different colours from a database and I want
to set the background colour of a canvas to the colour retrieved.
I've tried doing the following:
<mx:TileList
x="2" y="237"
direction="horizontal"
dataProvider="{MakeUpColours.lastResult.Colour}"
backgroundColor="#FFFFFF"
width="288" height="167.04999"
themeColor="#FFFFFF">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas width="35" height="35">
<mx:Canvas width="30" height="30" x="5" y="5"
backgroundColor="{data.ColourNo}">
<mx:Image source="
http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/>
<mx:Label text="{data.@ColourNo}"/>
</mx:Canvas>
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
But it just makes the background colour black. Any
suggestions?
Thanks
Katy

"katychapman85" <[email protected]> wrote in
message
news:g6svqs$eli$[email protected]..
> I'm retrieving different colours from a database and I
want to set the
> background colour of a canvas to the colour retrieved.
I've tried doing
> the
> following:
>
> <mx:TileList
> x="2" y="237"
> direction="horizontal"
> dataProvider="{MakeUpColours.lastResult.Colour}"
> backgroundColor="#FFFFFF"
> width="288" height="167.04999"
> themeColor="#FFFFFF">
>
> <mx:itemRenderer>
> <mx:Component>
> <mx:Canvas width="35" height="35">
> <mx:Canvas width="30" height="30" x="5" y="5"
> backgroundColor="{data.ColourNo}">
> <mx:Image
> source="
http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/
>>
> <mx:Label text="{data.@ColourNo}"/>
> </mx:Canvas>
> </mx:Canvas>
> </mx:Component>
> </mx:itemRenderer>
> </mx:TileList>
You're referring to both data.@ColourNo and data.ColourNo. Is
it an
attribute or an element?

Similar Messages

  • How do i set the transparency of an image retrieved from a database? (image was stored as blob)

    I had stored a png image into a database, when i retrieve it and display it the background is no longer transparent?
    I am loading the blob returned from the select statement by using the "loadBytes" method of the "UILoader" class.
    Thanx in advance
    gv1979

    If you want to stick with adjusting the scale you can do this two ways. Edit the value graph or edit the speed graph.
    The problem is that a camera move, a zoom or a dolly in, is not linear and scale is. This means the graphs are not a good representation of what you'll see visually. This makes them hard to use. At a constant rate for scale the appearance is that the increase in size slows down to closer you get to the final value. In other words, as you scale an object up at a constant rate, the visual appearance is a gradual slowing.
    A speed graph edited to look like this gives the appearance of a constant rate scale of the layer when you expect an acceleration at the end. There's just not enough granularity in the graph editor or enough control to predictably achieve the results you want.
    You'll have better luck editing the value graph to look something like this:
    While this looks extreme, you will get closer to achieving the results you want using the value graph. Once again, the amount of control and the resolution of the graph combined with the visual tomfoolery that scaling an object brings with it makes this a difficult way to achieve predictable results.
    You select the graph you'll edit by clicking on the second icon from the left.
    As I said before, you'll have much better luck getting the look you want if you make the layer 3D and move a camera toward it.

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • Can I use stored procedures to improve data retrieval from the database?

    I have been requested to get multiple pieces of data from multiple tables and return the output in an array for use in a Java program.
    Eliminating multiple calls to the database. Currently, the data is retrieved from the database in multiple steps but to eliminate
    possible bottlenecks in the future, I created several complex sql statements.
    For instance,
    In the first table there are 20 columns of data. has a column named type which can have the one of these values: line, inn, or bsc
    In the second table there are 6 columns of data. has the additional data for type line
    In the third table there are 7 columns of data. has the additional data for type inn
    In the fourth table there are 2 columns of data. has data regardless of type
    etc...
    Depending on a specific column value retrieved (inn) from the first table:
    I need to collect all 20 columns in the first table and get all the columns in third table and the columns in the fourth table, etc.
    Question: How can I remove the duplicate primary key columns without specifying for each table the column names to be returned?
    I used the wildcard SELECT * because I didn't want to have to update the retrieval methods if additional columns are added to these
    secondary tables.
    example of my sql for type inn data:
    select * from first_table f, third_table s, fourth_table t
    where (f.column1='xxxx' and f.column2='xxxx') (the 'xxxx' are passed into the sql statement)
    and
    ((s.column1=f.column1 and s.column2=f.column2)
    and
    (f.column3=t.column1));
    Currently, I've duplicated the separate sqls for each valid type found in the first table (at least a dozen types). The only difference is
    the table name. Instead of the third table I use the second table, etc.
    The MAIN Question: How can I set this up to have one sql to handle each type? I want to eliminate having over a dozen duplicated sqls. Can I
    incorporate this into a stored procedure or something? If so, how? Can anyone provide sample coding?
    Your help is very much appreciated. Thank you.
    GD

    Hi, Salah.
    Use "Exec" in your query to run procedures.
    SAPbobsCOM.Recordset     oRS;
    oRS = (SAPbobsCOM.Recordset)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
    oRS.DoQuery ("EXEC YourStoredProcName");
    Triggers are not supported in SDK.
    Regards,
    Aleksey

  • How do I set BI Publisher to read html tags from the database?

    How do I set BI Publisher (Release 10.1.3.4) to read html tags from the database? For example if the text is quoted with a bold tag I want my output to display the text in bold. Is there a setting or something I can set?

    I took a look at Tim Dexter's blog as suggested and the sample worked, but for the elements in the xml file not for the value coming from the database, however this is good to know as well!
    I have data in the data base column which looks like this:
    'MS Applied <B(bold tag)> Mathematics</B(bold tag)>University of Southern California'
    I want the data to be rendered like this:
    'MS Applied <B>Mathematics</B> University of Southern California'.
    In Report Builder on the property sheet I would set Contains HTML Tags property to Yes and the report would render correctly.
    In BI Publisher 10.1.3.4 I can not seem set it to read this I have change the configure properties of the report to Character set to HTML and Make HTML output accessible to True. I just can't figure out what I'm missing.
    Thank you for any assistance you can offer.

  • Unable to set background colour JTableHeader in Java 1.6_18

    We're moving our application from Java 1.4.2 to 1.6_18, so far without major problems but there's some small issues with the GUI. Originally we'd change the background colour of the JTableHeader, but in 1.6_18 that doesn't seem to work. Instead of colouring the complete header it just seems to draw an outline. It kind of gives the impression that there's something on top of the table header which hides the coloured background.
    The code below shows what I'm trying to do, and gives different results when compiled in Java 1.4.2 and Java 1.6_18. It makes no difference whether I'm using the UIManager or setting the background directly on the JTableHeader.
    The application still works fine of course, but it bugs me that I can't work out what the problem is, so any suggestions would be greatly appreciated! I've already had a look at bug [6521138|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521138], but it makes no difference whether a new JTableHeader is set, so I think it's different. Also, the workaround for bug [4776303|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4776303] has no effect so I think that doesn't apply either.
        public static void main(String[] args) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                // Doesn't give the expected result in Java 1.6_18, the background remains white-ish with only a coloured border.
                // UIManager.put("TableHeader.background", Color.GREEN);
                // UIManager.put("TableHeader.foreground", Color.BLUE);
            } catch (Exception exception) {
                exception.printStackTrace();
            final JFrame frame = new JFrame();
            frame.getContentPane().add(createPanel());
            frame.getContentPane().setLayout(new FlowLayout());
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
        private static JPanel createPanel() {
            final JPanel panel = new JPanel();
            final DefaultTableModel model = new DefaultTableModel(3, 2);
            final JTable table = new JTable(model);
            // Tableheaders.
            final TableColumnModel columnModel = table.getColumnModel();
            columnModel.getColumn(0).setHeaderValue("First");
            columnModel.getColumn(1).setHeaderValue("Second");
            // Doesn't give the expected result in Java 1.6_18, the background remains white-ish with only a coloured border.
            table.getTableHeader().setBackground(Color.GREEN);
            table.getTableHeader().setForeground(Color.BLUE);
            final JScrollPane scrollPane = new JScrollPane(table);
            panel.add(scrollPane);
            scrollPane.setSize(400, 100);
            panel.setSize(500, 500);
            panel.setPreferredSize(panel.getSize());
            return panel;

    Hillster wrote:
    Ah yes, when I change that setting the background of the table header indeed gets the expected background colour. Unfortunately it also makes my desktop look hopelessly outdated :-( And I can't really expect my end-customers to change their settings just to run my little application. Still, I suppose this proves that the problem lies in the L&F?Seconded Jeanette's sentiment, this is definitely a feature, not a problem. You want system LaF, you get System LaF, with all the bells and whistles. If you're sure you don't want the system embellishments, you could consider using my [_default table header cell renderer_|http://tips4java.wordpress.com/2009/02/27/default-table-header-cell-renderer/].
    db

  • Reports 3: setting background colour.

    Using Reports 3 how do I set the background colour for the
    margin? I do mean the margin and not the objects in the margin
    (they're easy).
    Thanks for any help.
    null

    "katychapman85" <[email protected]> wrote in
    message
    news:g6svqs$eli$[email protected]..
    > I'm retrieving different colours from a database and I
    want to set the
    > background colour of a canvas to the colour retrieved.
    I've tried doing
    > the
    > following:
    >
    > <mx:TileList
    > x="2" y="237"
    > direction="horizontal"
    > dataProvider="{MakeUpColours.lastResult.Colour}"
    > backgroundColor="#FFFFFF"
    > width="288" height="167.04999"
    > themeColor="#FFFFFF">
    >
    > <mx:itemRenderer>
    > <mx:Component>
    > <mx:Canvas width="35" height="35">
    > <mx:Canvas width="30" height="30" x="5" y="5"
    > backgroundColor="{data.ColourNo}">
    > <mx:Image
    > source="
    http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/
    >>
    > <mx:Label text="{data.@ColourNo}"/>
    > </mx:Canvas>
    > </mx:Canvas>
    > </mx:Component>
    > </mx:itemRenderer>
    > </mx:TileList>
    You're referring to both data.@ColourNo and data.ColourNo. Is
    it an
    attribute or an element?

  • Changing background colour with hex code?

    Hi, i want to change the background colour of my documents. So far i can only find 1 way of doing it by going file > document setup then chaning the colour under transparency. I have two problems with this though. First, it seems to only change the colour in illustrator and not the actual image when saved/printed etc. And secondly i need to change the colour to a specific hex colour and i'm at a loss of how to do this.
    I have done a little searching on this but so far i seem to be failing at finding the answer. Anyone help?

    E'ss,
    First, it seems to only change the colour in illustrator and not the actual image when saved/printed etc.
    That is because it is only something like a simulation of coloured paper, so you can see what it looks like when printed on such paper. In other words, it is not part of the artwork and therefore not transferred.
    And secondly i need to change the colour to a specific hex colour and i'm at a loss of how to do this.
    When you set the colour, one option is RGB which is an equivalent to the hex colour. To find the right RGB combination without having to remember/calculate it, you may do as follows:
    1) Create a rectangle (or whatever);
    2) In the Color palette/panel flyout choose Web Safe RGB and insert the desired hex colour (the first two characters as R, the next two as G, and the last two as B);
    3) Switch to (normal) RGB and read the values to use.

  • Global Background Colour with individual Overide Text Boxes

    Hi I am looking to apply a global background colour using the details properties.
    However I have individual text boxes that have their own background colour based on expressions that I want to overide the global details properites.
    So I set up the global one with this expression
    IIF(Fields!Number_of_Defendants.Value = 1 ,"Yellow","Transparent")
    for the individual text box I used a nested IIF
    =IIF(Fields!Bill_Rate.Value = 115,"Red",IIF(Fields!Number_of_Defendants.Value = 1 ,"Yellow","Transparent"))
    This works but I'm wondering if their is a easier way so I don't have to have the 2nd clause.
    Regards

    Hi aivoryuk,
    As per my understanding, I think the expression you post is simple way. If you don’t want to use IIF function, I suggest we can try to use switch function as below to achieve the similar requirement:
    =Switch(Fields!Bill_Rate.Value = 115,"Red",Fields!Number_of_Defendants.Value = 1 ,"Yellow")
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How do you populate a page item in apex with a value read from excel

    Dear All
    I am working on application where I am uploading a csv file in oracle apex. I then need to access a value in Cell B2 of the csv file and populate a page item called
    :P2100_AUTHORISATION_ID with this value. Many of the examples I have found upload the data using v_data-array into a table but I don't need to do that I just need to get the value from the csv file and then display additional information about the file allowing the user to either or continue or cancel the request to upload. I am running into a small problem that I can't explain and wondered if anyone had any ideas.
    Here is the code I am using to try and populate and item called :P2100_AUTHORISATION_ID but when I poulate the item the value is always 0. But if I replace the line :P2100_AUTHORISATION_ID:= v_data_array(2) with a raise_application_error(-20001,v_data_array(2)); The correct value is displayed in the eror. Any Help would be appreciate and I apologise in advance if this akes no sense at all:-)
    declare
    --variables needed to read excel data from flow files
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    v_raw_chunk RAW(10000);
    v_char CHAR(1);
    c_chunk_len number := 1;
    v_line VARCHAR2 (32767) := NULL;
    v_data_array wwv_flow_global.vc_arr2;
    v_rows number;
    v_sr_no number := 1;
    begin
    --------------------------------------get file info from www_flow_files
    select blob_content into v_blob_data from wwv_flow_files
    where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER) and id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    --Read and convert binary to char
    WHILE ( v_position <= v_blob_len ) LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(p_bl_wd_data_entry.hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities </span>
    v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data </span>
    v_data_array := wwv_flow_utilities.string_to_table (v_line);
    --get filename from wwv_flow_files
    select filename into :P2100_FILE_NAME from wwv_flow_files where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER) and id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
    :P2100_AUTHORISATION_ID:= v_data_array(2);
    -- Clear out
    -- v_line := NULL;
    --v_sr_no := v_sr_no + 1;
    END IF;
    END LOOP;
    end;
    Best Regards
    Lynn

    Hi Joel
    Continuing on from my last question, there was something else I want to ask if you dont mind.
    Now that I have the v_data_array(2) value in a page item I would like to use as an input value to a procedure to return some information I need displayed on the page. To do this I need to convert it to a number but when I try to so this I get the following error
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    When I use the wwv_flow.debug that you told me about it is outputting a value '4851 ' so it look like there may be some sort of asii character causing a problem. I have tried using trim(v_data_array(2)) and ascii(v_data_array(2)) but nothing seems to work.
    Would you know how to convert a v_data_array value to a number? At the moment I am attemting to do it withiin the same code I attached in my earlier post but I have replaced the assignment of :P2100_AUTHORISATION_ID with the code below where P_BL_WD_DATA_ENTRY.getauthid is the procedure returning the values I need.
    :P2100_AUTHORISATION_ID:= P_BL_WD_DATA_ENTRY.getauthid(to_number(v_data_array(2)));
    Thanks
    Lynn

  • Setting background colour to transparent?

    Why does cropping a photo leave a green background instead of being transparent? I'm fairly new at using the Photo Elements 10, I had v.7 which I could select "reverse" and delete background, then copy and paste into a new picture. However, the "copy" has a feathered edge and when I flatten the image then try to re-size/crop image, the background of the copy is still dark green??
    I can't remember how to set the background colour to "clear" not coloured nor feathered .... Please help.
    Thanks in advance for your help.
    Leona Buckner

    Double click the background layer to turn it to a regular layer before you start. If you delete on a background layer, the empty space fills with the chosen background color.

  • Reason to set MaxErrorCount along with Propogate value for Excel Files

    Hi,
    I had an ETL earlier which processed CSV files from a folder. The requirement was to load the error files into a Rejected folder but continue to process all the files from the source Folder. This requirement was satisfied by setting the value of the
    system variable "Propogate" in EventHandler section for DataFlowTask to "false".
    MaxErrorCount value for the ForEach Loop is having its default value as "1".
    When tested, it was working perfectly fine
    Now currently there is an Excel file as source having same requirement as above. But even when then variable "Propogate" was set to "false" as above, the execution was getting stopped when an error file was found.
    Later I found the below link :
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/0065b5c2-f633-4cbf-81f9-031d1ed25555/how-to-skip-wrong-excel-files-ignore-errors-on-ssis-foreach-task
    As mentioned in the link, I have done below changes
    1)Set MaxErrorCount for ForEachLoop to 1000
    2)"Propogate" variable is set to false
    Now this is working perfectly fine.
    Can you please let me know why did the setting of "Propogate" worked for CSV but did not work for Excel. For Excel files why was an additional setting for MaxErrorCount  was required.
    It would be very much helpful if I can get a detail information on the above
    Thanks,
    Raksha
    Raksha

    Hi Raksha,
    In you SSIS package, setting the Propagate system variable to False of the Event Handler prevents the Data Flow Task (DFT) propagating its failure to its parent container. For the ValidateMetadata property of a Data Flow Task Component, it doesn’t only affect
    the DFT at design time but also at runtime. During the Validation phase, a component is supposed to check to make sure that the cached metadata in the package is still in sync with the underlying table/view/query. If there is a mismatch, the component returns
    a special status (VS_NEEDSNEWMETADATA). When this happens at design-time, SSIS triggers a metadata refresh by calling ReinitializeMetadata(). At runtime, this results in an error.
    In your scenario, by setting the ValidateMetadata property to false, the error of the DFT is avoided, hence, you don’t need to set the MaxErrorCount to a value more than 1.
    For more information about how ValidateMetadate property works, please see Matt’s answer in the following thread:
    http://stackoverflow.com/questions/3297097/validateexternalmetadata-property-what-exactly-does-this-do 
    Regards,
    Mike Yin
    TechNet Community Support

  • Problems with Apple Mail retrieval from EarthLink

    I just bought a new computer (MacBook Pro 10.8.2 Mountain Lion) and when trying to set up Apple Mail v.6.2 I have a problem. It won't connect properly with my ISP email (EarthLink). I am unable to retrieve any POP mail on Apple Mail. It keeps saying "Logging in to the Earthlink POP server "pop.earthlink.net" failed. Make sure the user name and password you entered are correct....." However, I am able to send mail via Apple Mail because the outgoing mail server (smtpauth.earthlink.net) does work. It's strange because it's the same user and password. So I can send but not retrieve using Apple Mail.
    I also have Thunderbird, which I don't really like, and its POP setup both sends and retrieves from EarthLink without a problem. Plus I can always go to the EarthLink website if necessary. So this is not critical, but I prefer Apple Mail.
    Any ideas?
    (I'm also going to contact EarthLink to see if they can help.)

    I'm having this difficulty with my shared host provider as well.  hostpapa.ca keeps telling me to 'check my account settings.'  This is not difficult to do and the error code I keep getting tells me that there's a problem connecting to the mail server.
    While I argue with them, is it possible that there is a problem from within Apple Mail or with my wifi?  Mail works well when I'm not on my home network - at the office, on 3G, if I use webmail, if I connect directly to my DSL modem.  I tried to delete the account and add it in again - but it just won't connect when on wifi.
    I'm wondering if there's anyone who has an answer to this...?

  • JFrame background colour, with LookAndFeel

    Dear All:
    I am using frame for my java application. No matter what background colour I set, it won;t change on the screen? I dont really know why this is the case.
    Today, When I move my program to another PC, the jframe color, button style, changes completely! I don't know what is going on.
    Is it something to do with lookAndFeel

    Hi
    Try adding the following to change the background colour of the jFrame
    it needs to be after the component has initialised.
    colour can be changed to suit
    this.getContentPane().setBackground(new Color(218,208,200)); // this is needed to set the background of the jFrame

  • Creating a property with list values derived from other hierarchy

    Hello Friends,
    Thanks in advance for any help in this regard.
    1)     Can we have a property with list values populated automatically from other hierarchy.
    2)     Can we select multiple items from the list box. Does property allows multiple values.
    The example is like this. There are 2 hierarchies.
    Customer
         Customer 1
         Child Customer
    Industry
         Hightech
         Computers
         TVs
    Manufacturing
         Auto
         Steel
         Healthcare
         Pharma
         HealthInsurance
    The requirement is to add Industry hierarchy as property of Customer Hierarchy and select each customer is what type of Industry they belong as a property value.
    Thanks

    Use property data type ListGroup for multiselect.
    To select values from another hierarchy you can use Node or MultiNode, or an Asscociated Node property, of which there are several types. I'm not fond of the property editors for Node data types and will often just use a string and validate the user input by defaultin prefixes and such with a derived property that is checked by a query based validation. Make sense?

Maybe you are looking for

  • LDAP user no longer able to log in

    We have CQ 5.3 set up using LDAP authentication.  We have one user who has been using CQ with her AD Userid/password for over a year with no issues, but she came in one day and now it's saying her user id and password don't match. We've tried on mult

  • Idoc number generation

    Hi All, How the Idoc number will be generated. Is it generates dynamically or do we need to give the Idoc number manually? While transfering Idoc, data is transfering successfully, but no Idoc number is found. Can u help me to generate the Idoc numbe

  • How can I make two separate photos into a single photo.

    I wpuld like to put together two photos into one. I will appreciate your help. Thanks. Vernon

  • Field "Batch" mandatory for components in Purchase Order

    Hi, If a PO with item category 'L' subcontracting is created, the system explodes the material BOM for the material being purchasesd. In the subcreen for components in the purchase order (as determined by BOM explosion), there is an option to assign

  • Problem with playing mu

    hi everyone, sorry if this is posted somewhere else. well i have a audigy 2 sound card and a plaintronics usb connected headphones with mic. my problem is that when im on a teamspeak server and talking with friends some times we play music through th