Two Columns Combobox

I want to create a two columns ComboxBox , the first column show the account code, the second column show the account description.
Can the comboBox do that?
Thank you

Not quite, but you could write a custom renderer that does the trick, or you go the lazy way and override your Account's toString method.

Similar Messages

  • ComboBox with two columns?

    Do you guys know how we can have a DAC comboBox with two columns(e.g. emp_no, emp_name) to update a column(e.g. emp_no) in database?
    Thanks for your response.
    Ali
    null

    grin You don't like my suggestion of creating a view ( or view object ) that where you concatenate 2 or more strings of interest into a separate new attribute... that is used to display?
    Yeah, kinda hokey, but quick to implement.

  • Plz help me to put two columns in JCombobox

    hi everyone...
    Please help anyone to display two column in a jComboBox.......
    I want the smple coding.....
    with regards
    Anand

    Hallo.
    Afaik, it's not possible using only classes provided in java.swing/java.awt packages.
    One possible solution is to use custom renderer. By default JList and JComboBox are rendered using single JLabel. Our renderes should use several labels put on panel as rendereing component. For information see "Providing custom renderer" in "How to Use Combo Boxes" tutorial article, please. http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer
    Sample (functional but not very nice) code is below. Sorry, I've tried to make it as short as possible.
    import java.awt.*;
    import javax.swing.*;
    public class Main extends JDialog {       
        Main() {       
            JComboBox jPiceList = new JComboBox(new Object[] {
                new Object[] { "Lemon", 0.5 },
                new Object[] { "Tee", 3 },
                new Object[] { "Pinguin", 1 },
            jPiceList.setRenderer(new MyRenderer());       
            add(jPiceList);       
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            pack();
        public static void main(String... args)
        throws Exception {               
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
    * This class use panel with two labels to render
    * list (combobox) cell
    class MyRenderer implements ListCellRenderer {
        JComponent rendererComponent;
        JLabel labels[] = { new JLabel(), new JLabel() };
        public MyRenderer() {
            // We use panel with two labels as renderer component
            rendererComponent = new JPanel();
            rendererComponent.setLayout(new GridBagLayout());
            // Add labels
            GridBagConstraints c = new GridBagConstraints();
            c.fill = c.HORIZONTAL;
            c.weightx = 0.1;
            rendererComponent.add(labels[0],c);
            rendererComponent.add(labels[1]);
        public Component getListCellRendererComponent(
                JList list, Object value, int index,
                boolean isSelected, boolean cellHasFocus) {
            Object rowData[] = (Object[])value;
            // Prepare colors
            Color foreground = isSelected?
                list.getSelectionForeground(): list.getForeground();
            Color background = isSelected?
                list.getSelectionBackground(): list.getBackground();
            // Set panel colors
            rendererComponent.setForeground(foreground);
            rendererComponent.setBackground(background);
            // TODO Prepare and set panel border for hint
            // @see DefaultListCellRenderer#getListCellRendererComponent        
            // Now set label value and colors
            int col = 0;
            for(JLabel label : labels) {
                label.setBackground(background);
                label.setForeground(foreground);
                label.setText( String.valueOf(rowData[col++]) );
            return rendererComponent;
    }

  • Add Two Column in report ,Download and Delete

    Hi Friends,
    i have one item File Browser to use browse :P1_file_browser and i have create a Report
    My Table Is
    CREATE TABLE  "ARM_DOC_CER"
       (     "ID" NUMBER,
         "NAME" VARCHAR2(500),
         "MIME_TYPE" CLOB,
         "BLOB_CONTENT" BLOB,
         "SUBJECT" VARCHAR2(500)
    i jus want to add two column in my report
    1--Download
    2--Delete
    When i click on download then download file and when i click on delete then delete corresponding file.
    How can i do this.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    You can use concat function or also '||' to combine two columns.
    1. with concat-
    concat("D4 Product"."P01 Product","D4 Product"."P02 Product Type")
    2. With '||' operator
    "D4 Product"."P01 Product" || '-'||"D4 Product"."P02 Product Type"
    (Remove '-' if not required)
    This should resolve. Hope this helps
    Regards
    MuRam

  • How do I compare two columns of data in Numbers to find the unique results?

    Hello all,
    I'm looking for a way to compare the data from two columns so I can find the unique results and display that data in a third column. To be specific, here's what I'm doing.
    Column A is a list of email addresses for people I have already written. Column B is a list of email addresses for people I would like to contact. I am not sure if there are email address from Column A in Column B, but there may be and if there are, I must find out so that I don't send a second email to these recipients. How can I have Numbers look at both columns and tell me which email addresses in Column B are not in Column A?
    Thanks for the help!!!

    gfmp123,
    Here's an alternate use of MATCH to find duplicates. I hope you find one of the two solutions, Wayne's or this one, useful for your case.
    The expression in Column C is:
    =IFERROR("Dup in Row "&MATCH(B, A,0), "")
    Regards,
    Jerry

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Count first two columns

    Hello,
    I have a count requirement that i havent been able to solve by searching sdn.  Maybe someone can help.
    I have a query built on a multiprovider that points to two basic cubes.  The basic cubes do not contain a count key figure.  The first two columns of my query are characteristics.  My requirement is to count the occurences of the combination of the first two column (characteristics).  I am looking for a way to do this in the query so i do not have to reload the cubes as they have large volumes of data.  All the suggestions i have been able to find on sdn seem to be only for counting a single characteristic.  Is there a way to count the combination of two?
    Regards,
    TMS

    Hi Create a count using the formula or calculated ket figure for the count unique id like client id for your infocube.
    so you will have a count for each row now. place this count object in your column.
    now select the two char or the group whatever you want a count in your row.
    select query properties and select the display tab and make sure the option - hide repeated key values is selected (normally by default it is selected). Then select each of the char in rows and in free char and set the option under display tab result rows - always suppress.
    Execute the query now. you will get the list of char and their count. sort the count by descending to get the most duplicate entries by their highest number on top in the count coulmn.
    you can also ignore the rows which donot have a duplicate i.e count more than 1 by creating a new condintion on the count key figure > 1 and restricting the condition  by only the group of char you have given in the column. so that you can also do a drill down by free char in your query and it will only show the duplicates group.
    Hope it helps.
    regards,
    Siva

  • Export option in ALV report downloades first two columns blank

    Hi ,
    Before posting this query I searched the solution in SDN but I did't find the solution.
    My problem is  After displaying report in ALV format ,if I press Export --> Local file --->spreadsheet ;  file will downloaded to excel sheet but first two columns(only heading no data ) will be blank  and next two columns with proper data.
    I checked field catalog defination it seems to be ok,  any other mistake ?
    Please suggest.
    Narayan

    Hi
    It's the option you have in the path System->List->Save->Local file
    I means it's the standard option to export an abap list into a local file, so you should try this path too and check if the resul it's the same
    I think you should choose  Export --->spreadsheet: here before saving the file an excel document will be open
    Max

  • Merge Two Rows of a table to One row but into two columns

    Hi
    I Am struck in writing a query to merge two rows into two columns of one row.
    Here is the Sample data i am working with,
    Col 1     Col 2     Col3 Col4 Col Col6
    5000     573-3000 2     0     Phone      
    5000     573-3036 1     0          Fax
    5000     893-5703 3     0     WOrk      
    3000     232-5656     1     0     Phone     
    3000     353-5656     2     0          FAx
    Here Col,Col3,Col4 form the Key.
    now wht i am trying to do is to Merge these type of rows put them into Columns P,F,W,E respectively to achive a Structure as below
    Col1      P     F     W
    5000     573-3000      573-3036      893-5703
    3000     232-5656     353-5656     
    Can you please help me how could i do this.
    I am pretty ordinary at writing SQL's.
    Thanks a Lot in Advance
    Message was edited by:
    Sreebhushan

    Search the forum for PIVOT and you'll find plenty of examples.

  • How to add two columns in criteria(OBIEE 11g)

    Hi,
    I am trying to add two columns in a criteria in obiee
    *"Fact - OLB Processed Invoices"."Invoice Amount - Functional Currency"__"Fact - OLB Processed Invoices"."AR Tax Amount - Invoice Currency"
    but the problem is :-
    The first column have 500000000 and the second column contains NULL values the actual table. I think this might be the problem when I am trying to add them it is giving no output.
    just a blank box.
    Can any one tell me how can we add columns in this condition.
    Thank to one and all.

    Try IFNULL(expr, value)
    for other column
    "Fact - OLB Processed Invoices"."Invoice Amount - Functional Currency"+IFNULL("Fact - OLB Processed Invoices"."AR Tax Amount - Invoice Currency",0)
    Edited by: Srini VEERAVALLI on Mar 20, 2013 10:02 AM

  • How to add two columns in OBIEE report?

    Hi to All,
    Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
    Thanks in Advance,
    Thenmozhi

    Assume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
    For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
    Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
    Let me know if you are looking for something else.
    Thanks

  • Retrieve of data from two columns into one column

    For eg: i have a data in a table with columns A & B of same size
    A B
    1 2
    2
    3 1
    4 2
    5 3
    6 5
    7 1
    8 4
    9
    10 8
    Through a select i want the output of my data in one single
    columns, Well I can do this by using union.
    But my output should be like
    if I select by condition where A=2
    my output should be
    2
    1
    3
    7
    4
    because all these numbers are linked with 2 how do i do this
    because it is like searching the number 2 in two columns and wherever this number 2 is linked i should get all the data relevant to it.
    Hope u got my point what i exactly want
    Can anyone help me it is quite urgent.
    Regards
    Vamsi Mohan

    i do not a concatenated data
    i have a data in a table with columns A & B of same size
    A B
    1 2
    2
    3 1
    4 2
    5 3
    6 5
    7 1
    8 4
    9
    10 8
    if my where condition is 'where A=2'
    my output should be
    1
    2
    3
    4
    5
    6
    8
    10
    i want my query to search as loop so that it keeps on searching
    for related data as in my case it is
    2 is linked to 1
    1 is linked to 3
    3 is linked to 4
    my query should keep on seaching for linked numbers till
    it does not find any mathing linked numbers
    and the resulted output should come in one single column

  • In Pages, how can I make one page have one column on part of the page and two columns on part of the page?

    What I am trying to achieve is a page with one column for all the text I write, but I also want to show two tables (one placed beside the other, not underneath the other) so on the part of the page where I am showing these tables, I would like to have two columns. Is this possible? Underneath the tables, there is more text that should be in one column only.

    Use a layout break.

  • Calendar --  How to view "to do list" in two columns per day in Month view?

    In OSX 10.6.8, my old Calendar would automatically go into two column view to show all my "to do" items, but 10.8.5 Calendar isn't doing this when I put over 12-14 items and just says "2 more..." instead of going to two columns and truncating them.  -- Is there a way to turn this 2x column view on?  or another way to show all of my to items?
    Any ideas/help appreciated.  TIA

    the "Employee Directory" shows you the photos by default. Should not be that hard to add an url via personalizations that points to that directory.
    good luck.

  • Looking for a two-column CSS layout

    I am looking for a two-column CSS layout that is centered
    with blank space
    on the sides, so the layout does not expand across the entire
    screen, but
    instead uses a portion of it (such as 75%). The left column
    would be for
    navigation and I haven't decided if I want it to be liquid or
    fixed, but the
    right column for content would be liquid. There would also be
    a heading div
    and navigation div across the top and a footer across the
    bottom.
    While looking for sample sites I keep finding ones that use
    three columns,
    and I'm worried that if I remove the third column that the
    layout will break
    at some point, even if I don't see it in my test browsers.
    I'm also
    discovering that some of the sample pages out there don't
    respond well when
    I resize the browser window. The columns don't have a minimum
    width or they
    stack on top of each other at some point.
    There are so many different techniques to use when designing
    a layout with
    CSS, some better than others, that I thought maybe some
    people here may
    already know what's tried and true and what should be
    avoided. Are any
    layouts robust enough to allow a third column to be added at
    a future date
    if needed? I also like the idea of putting the content div
    first in the
    code, to improve search engine indexing and also to aid those
    who may be
    using a screen reader, but if that feature makes the coding
    much more
    complex then I could see why I might avoid it for now.

    Sorry Nancy, I didn't see your post for some reason. At least
    we agree (o:
    Jo
    "josie1one" <[email protected]> wrote in message
    news:g4tv32$57f$[email protected]..
    >I have DW8 and am very happy with this:
    >
    http://projectseven.com/products/templates/pagepacks/cssmagic/index.htm
    >
    >
    > --
    > Jo
    >
    >
    > "Matt" <[email protected]> wrote in message
    > news:g4tg96$isq$[email protected]..
    >>I am looking for a two-column CSS layout that is
    centered with blank space
    >>on the sides, so the layout does not expand across
    the entire screen, but
    >>instead uses a portion of it (such as 75%). The left
    column would be for
    >>navigation and I haven't decided if I want it to be
    liquid or fixed, but
    >>the right column for content would be liquid. There
    would also be a
    >>heading div and navigation div across the top and a
    footer across the
    >>bottom.
    >>
    >> While looking for sample sites I keep finding ones
    that use three
    >> columns, and I'm worried that if I remove the third
    column that the
    >> layout will break at some point, even if I don't see
    it in my test
    >> browsers. I'm also discovering that some of the
    sample pages out there
    >> don't respond well when I resize the browser window.
    The columns don't
    >> have a minimum width or they stack on top of each
    other at some point.
    >>
    >> There are so many different techniques to use when
    designing a layout
    >> with CSS, some better than others, that I thought
    maybe some people here
    >> may already know what's tried and true and what
    should be avoided. Are
    >> any layouts robust enough to allow a third column to
    be added at a future
    >> date if needed? I also like the idea of putting the
    content div first in
    >> the code, to improve search engine indexing and also
    to aid those who may
    >> be using a screen reader, but if that feature makes
    the coding much more
    >> complex then I could see why I might avoid it for
    now.
    >>
    >
    >

Maybe you are looking for