JCombox different display and actual value

friends,
I have database table say car (car_id, car_name)
I want to create a JComboBox in which I want to show car_name but when I do getItem() I want to get the car_id and the number of items and in combox can change at runtime I am also updating car table in program how do I reflect that in combobox.

hi,
in swing every component is using the MVC (model view controller) "pattern".
your combox uses a comboboxmodel as a datasource.
1. so if you add items to your list, use the model and fire changes.
2. the stuff with the name and the id should be realised in a separate class. for example
not sure if this is highlighted correctly.. ;-) it's a long time since I last logged in...
class car {
private int id;
private String name;
public String toString() {
return name;
!! don't forget the getter and setter methods... !!
the toString stuff is the simplest and ugliest way. you can (or better should!) write your own cell renderer..
so getItem returns you an object of the type car. then you can get any information you want.

Similar Messages

  • Cannot display the actual value of ClobDomain variable in jspx

    I have a custom table and three of its fields/columns are of type Clob and they contain xml data. To populate this table I used ADF Business Component and in my application these fields are defined as ClobDomain. Inserting records to this table works fine. When testing my application module or business component, actual data is displaying. However, when retrieving these data in my page, it is being displayed as wrapped object like weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB instead on the actual value.
    I tried to use the converter in my jspx and created ClobConverter class which implements Converter with the following code;
    public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException {
    Reader clobReader = newClob.getCharacterStream();
    char[] buffer = new char[1000];
    StringBuffer sb = new StringBuffer();
    int nchars = 0;
    try {
    while( (nchars = clobReader.read(buffer)) != -1 )
    // Read characters from Clob into buffer
    sb.append(buffer, 0, nchars);
    // Transfer character to StringBuffer from buffer
    System.out.println("sb.toString(): "+sb.toString());
    clobReader.close();
    strClob = sb.toString();
    } catch (Exception e) {               
    System.out.println("Error Encountered."+e);
    return strClob;
    But even this doesn't help resolve the issue.
    Below are the details of my system:
    - Oracle DB Version = 10.2.0.4
    - Weblogic Server Version = 10.3.0.0
    - OSB Version = 10.3.1.0
    Please advise how to fix these problem.

    The output that I saw in the converter during runtime is a wrapped object which is weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB.
    In UI its data type is of ClobDomain since that is how it was defined in my ADF Business component entity and view object. But in the actual db table its data type is only clob. See below sample code taken from my jspx
    <af:inputText value="#{bindings.ErroreventView1Failedmessage.inputValue}"
    required="#{bindings.ErroreventView1Failedmessage.mandatory}"
    columns="120"
    binding="#{backing_edit.failedMess}"
    id="failedMess" readOnly="true" disabled="true"
    rendered = "false"
    wrap="hard" rows="10" converter="#{backing_edit.myClob}">
    <af:validator binding="#{bindings.ErroreventView1Failedmessage.validator}"/>
    </af:inputText>

  • Difference in SUMCT display and available values

    Here is the Scenario for my problem,
    I have Actual(A) and Plan(P) values compared in report in two KFs and Bias calculated as (P-A)/P and some other CKF which require result (SUMCT) of Actual.
    Now my user wants me to force Actual value as zero for zero plan values. I created a CKF for A like,
    A_New = COUNT(P)*A  " return zero for A if P is zero". Now this works fine for individual Actual and Plan comparasion and Bias but at Result level(SUMCT "A_New") this still counts those forced to zero values as of original. This works for display purpose only. So there is no difference in A and A_New at Result or SUMCT level so my other calculations using SUMCT "A_New" getting wrong. Any other idea I can accomplish this?

    Thanks Anil,
    You are right "Calculate result as"  ..Summation, works to bring result as of new total but only for display purpose.
    Any other idea I can globaly filter values based on Plan value = 0.
    Or do you think if this is a critical requirement I should consider populating cube values into new cube forcing Actual values to zero on Plan value = 0 condition in Update rule.

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Problem in Commitment and actual value..

    Dear Experts,
    I am facing a problem in 533 report. i created many purchase orders for a project X.   In me2j report all po's are showing but in 533 report for X project commitment values are not coming.
    i also created GRN for some PO's but actual values are also not coming....
    in our business scenario we are creating PR's thru network. upper problem is coming when we are taking item category L in PR's...
    please give me solution step by step..
    ***its urgent******
    regards

    dear Jaun,
    we are creating PR thru n/w with item category L.we take 3rd party PR. we are not using MRP and BOM procedure. PR's value comes in commitment column in 533 report. but when we are converting these prs in PO in 533 report commitment column values are not coming. this is my problem.
    when we take item category N all things are ok.
    but  users already created many Prs and POs with item category L so i want to know that is there any possibility to come po value in commitment that created thru reference of PR with item category L? (in these PO accnt assg. cat. is Q.)
    help me.

  • Send email notification when the baseline and actual values are different in project

    Hi
    I am working with MS Project 2013 and Project Server 2013.
    I need to the send email notification to the program manager (or to a user) whenever the project manager changes the task finish date for a task. Comparison should happen with the baseline finish and the difference needs to be updated to the Program Manager
    over mail.
    How to configure/customize email notification for changes in MPP.
    Please suggest.
    Regards,
    Sudhir

    If you are not having developer skills it will be complicated for you.
    You need to create event handler by code, as in the below link:
    http://msdn.microsoft.com/en-us/library/office/gg615466%28v=office.14%29.aspx
    Then compare your values and finally send email by code.
    Twitter : @MShoubaki | http://jo.linkedin.com/in/mshoubaki

  • Popup LOV with same display and return values

    Hi
    I have created a List of Value using the following query.
    SELECT partner_name display, partner_name return
    FROM partner_table
    WHERE partner_name is not null
    order by 1
    The above query returns around 3000 rows of data. This has been linked to Item as Popup Key LOV(Displays description, returns key value). When the popup is selected the values are not displayed, only "Row(s) 1 - 10" and pagination buttons are displayed.
    Could anyone please suggest me with a solution.
    Thanks in advance.

    Change the Next button label to remove the > character. This sounds like a familiar problem.
    Scott

  • Array of different (digital and analog) values into multigraph

    Hello everyone,
    So I have an array with a timestamp on the first column, either "off" or "on" string on the second column, and a number value string on another. The columns are based of variables that reads data based on an update rate. My question is, what is the easiest way to separate these values into a digital and analog graphs. This is because the number values are so high that the "off" and "on" signal is being pushed down as the y-axis auto-scales. I'm hoping that I can use a multigraph, but the multigraph puts the data in one graph (since it's one array). 
    Any suggestions or help is appreciated.

    Hi jachy25, 
    Below is a link to a KnowledgeBase article that goes over how to use stacked plots in LabVIEW.
    http://digital.ni.com/public.nsf/allkb/21E8163F259DA2058625703B007511AA
    The second link contains a lot of general information on configuring graphs and charts in LabVIEW, and is a useful document to have when configuring plots.
    http://zone.ni.com/reference/en-XX/help/371361L-01/lvconcepts/customizing_graphs_and_charts/
    I hope this information helps!
    Regards,
    Kelly B.
    Applications Engineering
    National Instruments

  • Passing two values in a column prompt for display and filtering

    Hi All,
    Is there a workaround to use two columns in a prompt for display and passing the input value for a prompt value in dashboard prompt? For eg we want to display the description in the prompt but pass the id to the filter value or presentation variable, just like we have in bi publisher,LOV automatically grab the two value for display and actual value to pass to the query.Therefore, user will click the description and corresponding id will be saved in presentation variable from the prompt .
    Thanks,
    Sushil
    Edited by: 872073 on Apr 5, 2013 11:06 AM

    Check this
    http://www.rittmanmead.com/2010/08/oracle-bi-ee-11g-handling-double-columns-iddescription-interoperability/

  • Actual value in Service PO differs from GR value

    Hello,
    In the Service PO, in item details Limit tab, actual value is incorrect, service entry/ GR value is diffrent and actual value in the limit tab is diffrent, in fact it is showing the same value as overall limt and expected value,
    please suggest.
    thanks for replying,
    -Bala

    Hi,
    Is the value of EKBE-REFWR = RSEG-WRBTR for your PO and invoice? If yes, then what you are seeing is not an error. The values are correct.
    The 'Actual value' in the PO displays the sum of the invoiced amount referred to the PO/item (EKBE-REFWR / EKBE-REFWR).
    But the displayed 'Value in local curr' in the PO's history for each invoice's item (EKBE-WRBTR) is not the invoice item's amount, it includes the following 4 parts:
    1. Invoice item's amount
    2. Non-Deductible Input Tax(NVV)
    3. unplanned Delivery costs
    4. Cash discount amount
    So the 'actual value' in the PO cannot be the same as the totoal invoiced value.
    Regards,
    Purnima.

  • Show actual values before current month and forecast values after

    This is a tricky one (but I guess it will be easy for you clever guys out there), so my apologies for the heading.
    Thanks for reading.
    I need to build a report in BEx (BW3.5) that does the following:
    I will get actual values and forecast values for a year, grouped per period.
    But in the report, I don't want to display the actual and forecast values of every period.
    I want to display the actual values for the past, and the forecast values for the future.
    So, if we are now in period 6 (which is June) all the actual values must be displayed for Jan, Feb, Apr and May.
    But from June onwards to December, only the forecast must be displayed for each month.
    Is this possible?
    Thanks in advance, points will be assigned
    Rudolph
    Edit: This might help. The actual value is based on KF 0AMOUNT, where value type = 10. The forecast is based on the same KF, value type = 20, version = F2

    Hi Rudolph,
    No need to write any code for this one.
    Have done couple of forecast reports using following logic.
    Hope historical data getting from R/3 & Forecast values from APO.
    these are seperate 2 keyfigures.
    1.created restricted key figure (keyfigure1) for historical values & drag drop time characterstic with off set till date (means offset -6 to 0)
    2.created restricted key figure (keyfigure2) for forecast values & drag drop time characterstic with off set till date (means offset +1 to +6).
    create calculated keyfigure Add up above(keyfigure1+keyfigure2) two restricted keyfigure.
    Thnx,
    Vijay Reddy.

  • How can I compare the actual and expected values in Unit testing when they are XML files?

    I have created a unit test for a method in VS 2008. My expected value and actual value are XMLs. Therefore though the output is same as I expect it gives an error as I am doing string comparison now. How can I compare these 2 XMLs in expected output and
    actual output format in Unit Testing?
    mayooran99

    In unit test, when you want to validate XML files, you feed them into the class / struct that you want to feed the XML into and compare the values there (You don't just feed it in XMLReader and feed it line by line, right? But if it really is, that's how
    you should also test it in unit tests).
    In short, how you'd use the XML in your code, that's how you should test it in unit test.

  • How can I get HyperTrend to display the numeric value output of a CHOOSE statement?

    I have non-linear values I need to display on a HyperTrend graph.  I'm currently converting the input raw signal to a Units (Engineering) value and then looking up the actual value (from a calibration chart) using a CHOOSE statement in order to display the actual value on a panel, but I need to display the values output by the CHOOSE statement on a HyperTrend graph, along with other similar values.
    How can I do this?

    I have non-linear values I need to display on a HyperTrend graph.  I'm currently converting the input raw signal to a Units (Engineering) value and then looking up the actual value (from a calibration chart) using a CHOOSE statement in order to display the actual value on a panel, but I need to display the values output by the CHOOSE statement on a HyperTrend graph, along with other similar values.
    How can I do this?

  • Expected/Actual values in test runner

    Hey,
    I've added public test functions to my classes like:
         [Test]
         public function basicTest():void
             Assert.assertEquals("Test is 5 == 5", 5, 5);
    and a test suite takes this class as a variable.
    [Suite]
        [RunWith("org.flexunit.runners.Suite")]   
        public class ModulesTestSuite {
            public var t1:MyClass;
    I use this mxml to run the tests:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        creationComplete="runMe()" xmlns:flexUnitUIRunner="http://www.adobe.com/2009/flexUnitUIRunner"
        styleName="flexUnitApplication" >
        <mx:Script>
            <![CDATA[
                import org.flexunit.runner.notification.async.XMLListener;
                import org.flexunit.listeners.UIListener;
                import org.flexunit.runner.Request;
                import org.flexunit.runner.FlexUnitCore;
                private var core:FlexUnitCore;
                public function runMe():void {
                    core = new FlexUnitCore();
                    core.addListener( new UIListener( uiListener ));
                    core.run(ModulesTestSuite);
    But, when the test runner runs the tests, it categorized them as empty tests and shows blank for expected and actual values. Whereas clearly i've entered '5' for both. The tests complete successfully though.
    Could you please elaborate on what are empty tests and how to pass expected value/ actual value data that will display in the test runner UI.
    Thanks,
    Prannay

    This is mostly UI confusion right now. We are using the FlexUnit1 test runner during the alpha and beta and have not yet customized it well for our needs.
    FlexUnit1 did assertion counting, meaning it knew how many times you made assertions in each method. Right now FlexUnit 4 does not do this, so it believes this test is empty because it doesn't know that you made an assertion.
    This will be fixed in the next release bits, but for now, just look at failed tests or tests that succeeded and try to ignore the empty ones.
    If you change your test to assert that 5 is equal to 6 ( and all is working right) I am guessing you will see a failure, which is just a way to prove all is running fine.
    Mike

  • Calculating the actual value when creating the input schedule on BPC NW 7.0

    Hello Experts,
    I have One questions regarding the calculation when building the input schedule.
    the structure of this input schedule is like this:
    CV: App01-time-entity-account-version-p_datasource ...
                      Plan Value   Actual Value
    Project       1000
    In the backend of BPC ,The Actual value is retrived from other system using BW DTP function, and with the monthly based line item.  We build the BPC-mutiprovider by the actual value cube and the plan data cube.
    From the BPC Office view, we want display the actual value by aggregating historice data till the month which user selected in the current view. These actual data is just the reference for user when they input the plan data. so we dont want these data stored in the application or database.
    Can anyone give us some hints?
    Thanks a lot in advance!
    Best Regards,
    Vivi
    Edited by: Vivi Sun on Jan 19, 2009 1:12 PM

    Vivi,
    Were you able to accomplish what you were looking to do? I would appreciate if you could share that info with us.
    Thanks.

Maybe you are looking for