DropDownList populated with Objects

I have the following problem when populating a DropDownList with Objects and then calling getSelected():
1. Create a new project.
2. Add options and MyObject to the code:
    private Option[] options;
    public Option[] getOptions() { return options; }
    class MyObject {
        String label;
        public MyObject(String label) {this.label = label;}
        public String toString() {return "from toString():"+label;}
    }3. Initializise the options:
        options = new Option[] {
            new Option(new MyObject("Test1"), "Label1"),
            new Option(new MyObject("Test2"), "Label2")
        };4. Place a DropDownList, a Button and a StaticTextField on the page and reference the options from the DropDownList:
#{Page1.options}5. Call the getSelected() method on the DropDownList:
    public String button1_action() {
        Object o = this.dropDown1.getSelected();
        if (o instanceof String)
            this.getStaticText1().setValue(o);
        return null;
    }6. When clicking the button it reveals that the getSelected() method is not returning the selected object but the String returned from its toString() method.

In case you didn't get an answer to this on another thread. I did some checking and it looks like the online help is incorrect. selected() returns a String, not a object per say. that is why it calls the toString() method to get its value. ie,
        if (o instanceof MyObject)
            this.getStaticText1().setValue("its MyObject");does not return a true value, only instanceof String does.
Hope it helps,
Lark

Similar Messages

  • Checkbox item renderer populated with data from 2 sources

    I have a list object that has a check box and a label (using an inline item renderer).  The list itself is populated with an array of objects and whether the checkbox is selected takes those objects and adds them to another list (for outbound purposes).  Since the selected list can change elsewhere in my app how do I keep the binding of selections consistent?  The dataprovider for my checkbox list is the first array of objects and is binded, but the second one (selected array) is not.  What would be the best way to provide that binding to make sure the selected is consistent when the second array changes.  Some of the code is below to better show...
    <cms:HilightList
         id = "distributorList"
         width = "100%"
         height = "100%"
         drawHighlight="{ViewUtils.drawHighlightIndicator}"
         drawSelection="{ViewUtils.drawHighlightIndicator}"
         dataProvider="{pmDistributors.distributors}">
         <mx:itemRenderer>
              <mx:Component>
                   <mx:HBox>
                        <mx:CheckBox
                                           selected = "{outerDocument.isSelected(data)}"
                               change = "{outerDocument.handleSelectedChange(event)}"/>
                        <mx:Label text="{data.name}"/>
                   </mx:HBox>
              </mx:Component>
         </mx:itemRenderer>
    </cms:HilightList>
    public function isSelected(item:Object):Boolean
         var partner:Partner = item as Partner;
         var selected:Boolean = false;
         for each(var schedPartner:Partner in scheduleAssets.partners)
              if(schedPartner.id == partner.id)
                   selected = true;
         return selected;
    public function handleSelectedChange(event:Event):void
         var partner:Partner = event.currentTarget.parent.data as Partner;
              if(event.currentTarget.selected)
                   addPartnerEvent(partner);
              } else {
                   removePartnerEvent(partner);

    Hi Aakcse,
    In this condition, you need to make use of both the Precedence Constraint between Control Flow Tasks and the Conditional Split Transformation. Supposing you get the value in the flat file and store it in a variable via Script Task, you can create two Data
    Flow Tasks, and connect the Script Task to the two DFTs.
    For the Precedence Constraint between the Script Task and the Data Flow Task 1, set the “Expression and Constraint” expression to @[User::vEntryStatus]=="Y". And for the Precedence Constraint between the Script Task and the Data Flow Task 2, set the “Expression
    and Constraint” expression to @[User::vEntryStatus]=="N".
    In Data Flow Task 1, add a Conditional Split Transformation with this expression [Entry]==”YES”, and direct this output to the destination component. In Data Flow Task 2, also add a Conditional Split Transformation with expression [Entry]==”NO”, and direct
    the output to the destination component.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click here
    Mike Yin
    TechNet Community Support

  • Is this a bug? createdBy populated with value "1"

    I have a field in entity object mapped as historical column "createdBy". once I create a new record, this field populated as login user name. -- this works fine.
    However, after I specify this field "refresh after inserted/updated". this field populated with value "1" automatically once new record created. -- Is this a bug?
    BTW, the historical column "modifiedBy" does not have this problem.
    Thanks

    at javax.swing.JInternalFrame.setMaximum(JInternalFrame.java:890)
    at TestInterface.initComponents(TestInterface.java:48)What you posted there cannot be the entire contents of the method. According to the stack trace, your initComponents method, at line 48, calls the setMaximum method of some JInternalFrame object. However, the problem remains: Why a NullPointerException? It's possible there is a bug in the JVM, but that theory doesn't get your problem solved if it's true. And it's more likely (MUCH more likely for most of us) that it's a bug in your program. But what could that be? I looked at the API documentation for JInternalFrame.setMaximum and noticed this:
    "A maximized frame is resized to fully fit the JDesktopPane area associated with the JInternalFrame."
    I don't know how you would "associate" a JDesktopPane with a JInternalFrame, but possibly if you failed to do that, then references to the JDesktopPane would fail with a NullPointerException.

  • Removing unresolved SIDs from AD Group populated with cross-forest members

    Hi there,
    Looking for a way in PowerShell to remove a specific unresolved SID from a group.
    Having an issue where a group is populated with accounts from a domain in another forrest. When the accounts are deleted the SID remains in the group unresolved.
    I have written a script to generate a list of the unresolved SIDs but I'm unable figure out how to then remove these from the group as Remove-ADGroupMemeber fails to find the account.
    Anyone got any Ideas?

    I don't have a multi-forest environment set up to test any of this, but based on what I'm reading so far, you might need to fall back on using the System.DirectoryServices classes.  Cross-Forest group memberships are accomplished by creating foreignSecurityPrincipal
    objects in the group's domain.  What you need to do is remove the FSPs associated with those unresolved SIDs from your group.  You can do that with ADSI, if the AD cmdlets aren't handling that situation very well.

  • JAXB - Marshalling populated Java object into XML

    I have a populated Java object that I'd like to marshall to an xml file.
    I don't instantiate this object from a DTD, nor do I need to generate the object via unmarshalling an xml. I'm just trying to build something akin to a toXML() method for this object.
    Is JAXB what I should be using?
    Any suggestions?
    Thanks a lot.
    Paul

    Hi Paul,
    Did you ever sort this out?
    I too am now having problems with Marshalling to and from XML.
    I have been able to write my own Marshalling class but can't seem to be able to DeMarshal a XML stream to a SOAP object.
    Please reply to this message if you are able to maybe shed some light on my problem.
    I have a populated Java object that I'd like to
    marshall to an xml file.
    I don't instantiate this object from a DTD, nor do I
    need to generate the object via unmarshalling an xml.
    I'm just trying to build something akin to a toXML()
    method for this object.
    Is JAXB what I should be using?
    Any suggestions?
    Thanks a lot.
    Paul

  • Trying to d/l Kindle ap to new iPad w/retina display.  User ID is pre-populated with incorrect email address. How can I change this to my Apple User ID?

    Trying to d/l Kindle and Amazon aps to new iPad w/Retina Display.  User ID is pre-populated with the incorrect email address for my Apple account.  How can I change this to my correct Apple User ID?

    You should setup as new.
    Settings>General>Reset>Erase all content and settings

  • BAPI_OBJCL_CHANGE error: valuated with object dependencies

    Hi expert,
    having programmed an extension for a customer for automatic maintenance of characteristic values of technical object, we have come across an error.
    When using BAPI_OBJCL_CHANGE to change a characteristic followed by BAPI_TRANSACTION_COMMIT (without wait) we have two scenarios:
    1. if the technical object has no value in the characteristic before calling  BAPI_OBJCL_CHANGE  the characteristic will be set.
    2. if there is already a value set there is an error stating
    Characteristic 'XYZ' valuated with object dependencies (old value '00')
    However, I can't find a dependency definition in CT04. do you know what's wrong here,or what is a usual cause of that?
    thanks
    Stefan

    Hi,
    Please see the given link, It may help you.
    Re: BAPI_OBJCL_CHANGE and BAPI_TRANSACTION_COMMIT
    Regards,
    Shamma

  • PDS Creation with Object Dependency

    Hello Gurus,
    I´ve written a function to run BAPI_PDSSRVAPS_SAVEMULTI in order to create PDS with object dependency (Super BOM). The PDS created by my function looks good in CURTO_SIMU, but it is not respecting the characteristic dependency during PPDS Heuristic. If I take a PDS generated in ECC with the exact same attributes, the heuristics explodes the components correctly. When I run the getlist bapi, it shows both ECC created and function created with all tables (pds_header, pds_component,) filled with the same content. Though, one PDS works and the other doesnt. I am clueless.
    thank you a lot.
    Cheers
    Rafael

    Mainly due locking issues. Added some logic to wait.

  • Batch input with objects

    Hi,
    Exists a standard class to develop a batch input????
    Any ideas???
    Is it possible to create a batch input with objects??

    Hi there
    Why not
    just define your class in the normal way
    decide what variables you need to pass
    in the methods of your class call the fm modules bdc open, bdc dynpro etc etc.
    Incidently the following include will have a decent amount of code for the BDC bits.
    include bdcrecx1.
    A good way is to start sm35 to record what you are doing on the screen. When you've finished  go to your recording in SM35 and click on CREATE PROGRAM - it will create most of the code for you including the screen fields -- you'll need to edit a bit of course as you don't need everything that will be shown.
    Debugging in the CREATE PROGRAM might show you a decent generic way of generating BDC's which you could easily do via a class.
    Note however using BDC's is the LEAST PREFRERRED WAY of performing work and should only be used as a LAST RESORT if there really is no other way. A lot of new BAPI's and Classes are now available which can do away with the need for BDC's  in most cases.
    job done.
    cheers
    jimbo

  • COPA Report Layout with Object List (ALV)

    Hi,
    I have question about the COPA report layout with object list (ALV). Everytime I executed the report with ALV format, the amount for quantity column always shows with 3 decimal number, menwhile for amount column always follow by 2 decimal number.
    Can anyone help me regarding this matter? I do not know how to turn off the decimal number to be 0 in this type of layout, although in the form itself I already put 0 decimal number.
    Thanks.

    Hi,
    Better to raise this issue in CO Forum. You can expect some solution.
    regards

  • How to show shuttle component pre-populated with  SelectedItems

    Well i am trying to get this thing working and literally failed many times.. once the user selects some items in a shuttle... i want to get the selected values and store it somewhere.. Next time when the user logs in for second time the Shuttle should be
    pre - populated with the previously selected items .Can anybody suggest me and guide me about how to get this thing working...
    Please if anyone from oracle Jdeveloper team can show some light on it ...

    Hi,
    assuming the code hasn't changed between 10.1.3 and 11, you can have a look at these examples
    http://thepeninsulasedge.com/frank_nimphius/2007/07/15/adf-faces-adf-faces-shuttle-with-pre-selected-values-from-a-selectoncechoice/
    Let me know in case the code has changed
    Frank

  • Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Select the text, and open the Appearance palette (Come on guys, text highlight is irrelevant, it happens to objects too says the OP), and see what's listed there.  For a simple text object, there should only be a line item "Type", followed by "Characters", and when double-clicked the Characters line item expands to tell you the stroke and fill color.  For a basic object, there should be a fill and/or stroke.
    What happens sometimes, is that you end up adding extra strokes/fills to objects or text, and the appearance palette is where that will be noted.  Especially when you are dealing with groups, and/or picking up a color with the eyedropper, you may inadvertently be adding a fill or stroke on top of something.  You can drag those unwanted thingies from the Appearance palette into its own little trash can.

  • Problem with object view with primary-key based object identifier

    Hello!
    I met such problem.
    t1 is persinstent-capable class:
    class t1 : public PObject { .... };
    T1OV is object view, based on object table T1OT
    I1 is primary key of the table T1OT.
    Next code:
    t1* t = new (conn, "T1OV") t1(...);
    conn->commit();
    try
    t->markDelete();
    conn->commit(); // exception throws here
    Works fine if T1OV defined as:
    create view t1ov of t1 with object identifier default
    as select * from t1ot;
    And throws an exception
    "ORA-22883: object deletion failed"
    if:
    create view t1ov of t1 with object identifier (I1)
    as select * from t1ot;
    Such problem also occurs when object view is based on relational table/view (OID is primary-key based).
    Also it occurs when
    t->markModified() used insted of t->markDelete()
    I am using Oracle 9i second release for windows and
    MS VC++
    Thank You

    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_85a.htm#2065512
    You can specify constraints on views and object views. You define the constraint at the view level using the out_of_line_constraint clause. You define the constraint as part of column or attribute specification using the inline_constraint clause after the appropriate alias.
    Oracle does not enforce view constraints. However, operations on views are subject to the integrity constraints defined on the underlying base tables. This means that you can enforce constraints on views through constraints on base tables.
    Restrictions on View Constraints
    View constraints are a subset of table constraints and are subject to the following restrictions:
    You can specify only unique, primary key, and foreign key constraints on views. However, you can define the view using the WITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.
    Because view constraints are not enforced directly, you cannot specify INITIALLY DEFERRED or DEFERRABLE.
    View constraints are supported only in DISABLE NOVALIDATE mode. You must specify the keywords DISABLE NOVALIDATE when you declare the view constraint, and you cannot specify any other mode.
    You cannot specify the using_index_clause, the exceptions_clause clause, or the ON DELETE clause of the references_clause.
    You cannot define view constraints on attributes of an object column.
    Rgds.

  • Can I group charts with objects in Numbers 3.0?

    In Numbers 2.1 I could group charts with objects and text.  I can't get this to work in Numbers 3.0.  The objects will group but not the charts.
    I used this to create marked-up charts in Numbers and paste them into a Pages document.
    (I just purchased a new iMac and don't have the old Numbers on it.)

    The only way around this is to print to PDF and open in preview, then use the rectangular selection tool to select the are you want to add to pages, then copy, then paste into Pages.
    You can post feedback to Apple using the menu item "Numbers > Provide Numbers Feedback"
    There are several features that were dropped and may be added back in... see this link:
    http://support.apple.com/kb/HT6049?viewlocale=en_US&locale=en_US

  • Docs with  object status

    list of document with object status, can somebody explain how does it work and how to activate a status
    how can we activate new user status for documents, pl help
    Edited by: varada rajan on Apr 3, 2008 7:31 AM
    Edited by: varada rajan on Apr 3, 2008 7:46 AM

    Hi,
    If you are talking about sales order status, this can be configured through status profile.
    SPRO-SD-SALES-SALES DOCUMENTS - DEFINE & ASSIGN STATUS PROFILE.
    Based on the user status you have maintained for your sales document, the status can be viewed in table JEST.
    For this first go to VBAK - get document condition header, and take this document condition header and go to table JEST.
    Here your current status will start with E**** and status inactive flag would be blank.
    Hope this helps you.
    Reward points for contribution if it does.
    Regards
    Ravi

Maybe you are looking for

  • BB pearl no longer receiving emails

    I have hughes for my internet provider.  They just recently upgraded thier email system, since then, I can not get mail on my pearl.  When I go into email settings, it just tells me that there is already an account set up for this pin.  I am so confu

  • Lightroom 5 can't import to a FIXED drive called A: or B: even if that's where your catalog is

    This what I consider a bug for lightroom 5.  It simply does not allow you to import to a fixed hard drive called A: or B: even if that is where the catalog was opened from and where all your other photos are stored.  Yes I know why... A: and B: used

  • Laser jet P3015 printer problems

    I have a HP P3015 and it defaults to Tray 1, and asking for Glossy paper. There is no paper in Tray 1, and it is shut.  For each print job, I have to press OK to change print trays, and OK again to print.  How can I clear these settings so that the p

  • MacOS 10.7 and Subwoofer

    Can anybody help? My 10-year-old Harman/Kardon subwoofer worked fine with my iMac of 2003 (Motorola-based). The new iMac (MacOS 10.7) doesn't recognise the device. H/K-support says the subwoofer was developed in cooperation with Apple and the Apple p

  • The downloads are still not workin

    Noticed on another part of the forum that someone complained some day ago about your downloads. They are still not working, at least I cant get any Audigy drivers down. Just so you now....and also?I can't report to you in anyway about your site malfu