Error selectOneChoice component

HI All,
My intention is to populate a selectOneChoice component with some selection items
I have posted couple of messages on the same topic, but could not find the solution..
Here is the content that i have got from a blog... i have followed all the steps but am getting an error....
also i could not find what is value="#{ModelData.department}" for <af:selectOneChoice> tag... here in the complete example we dont have any class called ModelData.. what that binding means......
CODE
======
Add the following code in the ADF page.
<af:selectOneChoice label="Department" value="#{ModelData.department}">
<f:selectItems value="#{DepartmentOptions.departments}"/>
</af:selectOneChoice>
In ADF, selectOneChoice is used for drop down list.
selectOneChoice picks the list of values from 'selectItems' tag.
You can define a managed bean to bind an ArrayList of SelectItem objects to 'selectItems'. or can define a view object and bindings. In this example I have defined a managed bean which provides an ArrayList of SelectItem objects.
Department list Backing bean code.
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;
public class DepartmentOptions {
private List departments;
public DepartmentOptions() {
departments = new ArrayList();
SelectItem department = new SelectItem("10", "Electric");
departments.add(department);
department = new SelectItem("20", "Mechanic");
departments.add(department);
department = new SelectItem("30", "Computer");
departments.add(department);
public void setDepartments(List departments) {
this.departments = departments;
public List getDepartments() {
return departments;
In the above code it is clear that value attribute for <f:selectItems\> tag referring to the bean written above...
but what is value="#{ModelData.department}"> for <af:selectOneChoice\> where we do not have ModelData class itself
please Give me some pointers on this ...
Thanks in advance,
Naveen
Message was edited by:
Naveen Kumar Borra

Naveen Kumar Bora,
I agree with you - I've read that blog entry, and it seems to be missing some critical bits of information. I suggest you have a look at either the Oracle ADF Developer's Guide for Forms/4GL Developers section 19.7 (if you're using ADF BC) or Oracle ADF Developer's Guide section 11.7.
Note for the future: if you're asking a question about a blog post, it really helps if you put a link to the post you're asking about, wouldn't you agree?
Hope this helps,
john

Similar Messages

  • How to refresh data in SelectOneChoice component based on backing bean

    Hello.
    I am using JD Studio Edition Version 11.1.1.5.0 on Weblogic 11.1.1.5
    I have page fragment with SelectOneCoice based on backing bean (used as filter)
    <af:selectOneChoice label="#{projectBundle['label.toolbar.spinbox.period']}"
                                        valueChangeListener="#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.onPeriodValueChangeListener}"
                                        binding="#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.soc2}"
                                        id="soc2" value="#{pageFlowScope.ContentMainView.period}" autoSubmit="true">
                      <f:selectItems value="#{pageFlowScope.YearsListBean.yearItems}"
                                     binding="#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.si2}" id="si2"/>
    </af:selectOneChoice>
    there is backing bean which reads data from database and creates list + add null value
    package sk.web.view.bean;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.jbo.Row;
    import sk.web.view.common.utils.ADFUtils;
    * Class is supposed to provide list of years for the af:SelectOneChoice component.
    public class YearsListBean {
        private static final String PERIOD_ITERATOR_NAME = "PeriodView1Iterator"; //auto generated id
        private List<SelectItem> yearItems;
        public YearsListBean() {
            super();
            yearItems = new ArrayList<SelectItem>();
            addYearsToList();
        public void addYearsToList() {
            DCIteratorBinding iter = null;
            iter = ADFUtils.findIterator(PERIOD_ITERATOR_NAME);
            Row[] rows = iter.getAllRowsInRange();
            addYearItemToList("", "");       
            for(int i = 0; i < rows.length; i++){
                Row row = rows[i];
                log.info("row[" + Integer.toString(i) +"]: " + rows[i].getAttribute("Year").toString());
                addYearItemToList( rows[i].getAttribute("Year").toString(), rows[i].getAttribute("Year").toString());
        public void clearYears() {
            log.info("Called.");
            getYearItems().clear();
       private void addYearItemToList(String strInYearLabel, String strInYearValue) {
            SelectItem tObjItem = new SelectItem();
            // Setup object
            tObjItem.setLabel(strInYearLabel);
            tObjItem.setValue(strInYearValue);
            // Add it ro list
            yearItems.add(tObjItem);   
        public List<SelectItem> getYearItems() {       
            // Get Output
            return yearItems;
    When I insert new record into DB table I want to show new value into filter. How to achieve this?
    I tryied get current instance of YearsListBean
         YearsListBean yearsList = (YearsListBean)FacesUtils.getManagedBean("pageFlowScope.YearsListBean");
    then clear and fill it again
         yearsList.clearYears();
         yearsList.addYearsToList();
    at the end I refresh view adding partial target
    AdfFacesContext.getCurrentInstance().addPartialTarget(getSoc1());
    But this procedure doesn't work. Please help me find working method.
    Thanks in advance.

    Why don't you use a model driven list in the first place? Your list gets it's data from a vo do this would be the preferred solution.
    Check out my sample http://wp.me/pcBZk-vM
    Which shows an similar use case.
    Timo

  • Job Mgmt : error "This component cannot be used" when sending job request

    Hi,
    When i try to create a job request (basic job request link from the Job Management Workcenter), I am having an error : "This component cannot be used".
    It seems the component is the number read from the ibase corresponding to the client and the sid. There seems to be ne problem on this side.
    But everything is correctly setup regarding Ibases and components.
    What's more when trying to create a ZLFJ (duplicated from SLFJ) in CRMD_ORDER, there is no problem.
    Any suggestion where it could come from ?

    Hello Hervé ,
    could you please provide me with some more information?
    When exactly do you get the message? When trying to submit the job request? Or when clicking on the link "Create Job Request" in the workcenter?
    If you get the message when submitting, please provide more information on the entered System (IBase). Maybe a screenshot could help.
    Best regards,
    Jonny

  • Error in Component Monitoring(Runtime Workbench)

    Hi,
    I am getting an error in component monitoring section of runtime workbench. I got a note(851711), where it says 'CompilingException' error can be corrected by applying SP14. But I am still getting same error after applying SP14 and redeploying XI ADAPTER FRAMEWORK CORE 3.0 (SAPXIAFC.sca), XI TOOLS 3.0 (SAPXITOOL.sca) and XI ADAPTER FRAMEWORK 3.0 (SAPXIAF.sca). Please advice how to correct this error.
    Error Message:
    com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process: D:/usr/sap/QN7/DVEBMGS00/j2ee/cluster/server0/apps/sap.com/com.sap.xi.rwb/servlet_jsp/rwb/work/jsp_component_monitoring1138903402125.java:27: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier (try -source 1.4 or lower to use 'enum' as an identifier) import com.sapportals.htmlb.enum.TableCellStyle;                            ^ D:/usr/sap/QN7/DVEBMGS00/j2ee/cluster/server0/apps/sap.com/com.sap.xi.rwb/servlet_jsp/rwb/work/jsp_component_monitoring1138903402125.java:947: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier (try -source 1.4 or lower to use 'enum' as an identifier)     compTable.setColumnType(com.sapportals.htmlb.enum.TableColumnType.IMAGELINK,  1);                                                                  ^ D:/usr/sap/QN7/DVEBMGS00/j2ee/cluster/server0/apps/sap.com/com.sap.xi.rwb/servlet_jsp/rwb/work/jsp_component_monitoring1138903402125.java:948: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier (try -source 1.4 or lower to use 'enum' as an identifier) compTable.getColumn(1).setCellHAlignment(-1, com.sapportals.htmlb.enum.CellHAlign.CENTER);                                                                                ^ 3 errors .
    Thanks,
    Ask.

    Hi,
    it can be for some system configured on http destination or the sld system configured for this server.
    take a look at tx sxmb_adm for the http destination to discover witch destination is been used. then, on sm59, find the server that is been called for this http destination and check on that server if this user is ok there.
    to check sld, go to tx sld_apicust discover witch is the sld system configured for this server. After log on to sld system and check the user.
    Maybe the user is ok on the destination system, so, check the password on sm59 (if the problem is with an http dest) or sld_apicust (if the problem is the connection to sld).
    regards.
    roberti

  • Design mode troubles - "Error during component layout."

    Hi all.
    Since this is getting pretty annoying, I thought someone might know the right solution to this. Whenever I try to open Design mode on my AIR app (Spark + MX), I get:
    Design mode: Error during component layout. Choose Design > Refresh to refresh design mode.    MyTestApp.mxml    /MyTestApp/src    Unknown    Problem
    The MXML code for it is as simple as it can get:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                skinClass="spark.skins.spark.SparkChromeWindowedApplicationSkin"
                                >
    </s:WindowedApplication>
    And app descriptor XML only contains transparent set to true and systemChrome to none, even tho it shouldn't make any difference in the Design view anyway. Refresh doesn't solve the error, and sometimes the Design view itself goes into infinite loop of refreshing.
    However, if I remove the skinClass, it all works fine and Design view loads (but then I don't get the window chrome on run-time). Same goes if I declare the skin within <fx:Style /> tag, it only breaks when using skinClass attribute in the WindowedApplication declaration. And the same thing happens if I try to edit some of the Spark skins in the Design view.
    I've tried creating a new project, switching workspaces, building a blank workspace, switching from Flex SDK 4.1 to 4.0 - all to no avail, the same error always occurs and it never goes away.
    Any ideas?

    Instead of declaring the skin within the WindowedApplication tag, you have to call the Skin class from a Style tag right after you close your window tag:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    Xmlns:mx="library://ns.adobe.com/flex/mx"
    title="YOUR APP">
    <fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    s|WindowedApplication
    skinClass:ClassReference("spark.skins.spark.SparkChromeWindowedApplicationSkin");
    background-color:#999999;
    background-alpha:"0.7";
    </fx:Style>
    source: http://help.adobe.com/en_US/air/build/air_buildingapps.pdf

  • IMacros error= NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref], line 3 (Error code: -1001)

    I use Imacros. I got this error NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref], line 3 (Error code: -1001). I think it is because of this version of mozilla firefox 28.0. I read I should downgrade the version to 27, but I have read it is not safety. Will the problem will be resolve? if not I think I should take the risk...

    hello abmporras, please report the issue to the developer's of the addon through the support channels listed at https://addons.mozilla.org/firefox/addon/imacros-for-firefox/. they should be able to address the issue better.

  • Error: Missing Component

    Hi,
    I'm doing the cross component navigation from the DC A to DC B. I imported DC A into the DC B as "Used WDP Components" and embedded the view of DC A. Build and deployed and everything works fine.
    Then i shut down my PC and launch my NWDS, at WDP Used Component which i inserted DC B, it's now having the <Error: Missing Component>. I'm sure i didnt change anything since then.
    When i try to "Edit Component Usage" and choose the DCA again. An error prompted as below:
    Plgin name: Web Dynpro Project Browser
    Plugin ID: com.sap.ide.webdynpro.projectbrowser
    Class: com.sap.ide.webdynpro.projectbrowser.actions.PBEditComponentUsageAction$1
    method: runInternal
    Message: Exception occured
    Exception: java.lang.NullPointerException: null
    How to solve it? Thanks.
    - julius
    Message was edited by:
            julius

    hi
    Remove the DC A from used DCs build and add again to DC B. If not check out DC A, add the Public part again, check in, activate, resync and then add DC A as used DC to DC B. It must work. Hope it helps.
    regards
    LNV

  • CDG-01141 ERROR: Module Component Table Usage ...  Table usage ... requires primary key column for referential integrity

    For some strange reason when I modified a form, (commented out some code in a when-window-activated trigger) I now get the following error.
    CDG-01141 ERROR: Module Component Table Usage GR1130A.CUSTOMER.GR_CUSTOMER.GC: Table usage GR_CUSTOMER requires primary key column for referential integrity
    I am sure this is not related to my change, but do not know what may have caused this or how to fix it.
    Anyone seen this error before? been able to fix it?
    Thanks!
    Windows 7
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Designer Version 6.5.95.4.8

    You know that Developer/Designer 6i is not certified for Windows 7, right? Also, your version is not the latest one, so you can try to install the latest patch set first.
    >Table usage GR_CUSTOMER requires primary key column for referential integrity
    Check if there is a PK in the table definition (not in the database, but in Designer).

  • New Computer, CS4: Fatal Error Missing Component

    Hi,
    I have a new Macbook Pro. I transfered all my programs, including Photoshop CS4 extended, from my old Macbook to the new one. Whenever I try working on...ANYTHING, I get the following message, and then CS4 closes:
    Fatal Error  Missing Component
    /Library/Application Support/Adobe/Adobe Version Cue CS4/Client/4.0.0/VersionCue.framework
    Help!!

    PapaRoll wrote:
    I tried, but keep getting this:
    HTTP ERROR: 404 /support/downloads/dlm/main.jsp
    RequestURI=/support/downloads/dlm/main.jsp
    You must precisely follow the instructions on the download page, otherwise you'll get a 404 instead of access to the files. The download page has countless comments from people who don't follow instructions and get a 404.

  • CS4 Fatal error- missing component

    I just recently transferred my CS4 onto my new Mac desktop. Now, everytime I open CS4 I get the following message, Fatal error - missing component. I can push ok, and go onto my editing in phohtoshop,
    but once I try to save or save as any kind of file, it tells me, can not complete your request because of a photoshop error. Is there anything I can do to fix this problem?

    If I un-instsall and reinstall the app will I still have it on my computer, or will I need the serial number or anything, or will my computer still recognize it?
    I just don't want my CS4 to get lost, and I'm afraid I might not be able to find my serial # I have for my photoshop to reinstall. Not sure what reinstalling consists of.

  • Error in Component Api  Method

    Hi ,
    I getting a error in component Api method.
    Error : The method WDGetContext() is undefined for the type IPrivateDCFAppView
    SO, any body help me out in this regard why this one is happening.
    Thanks,
    William

    Hi,
    Are you trying to access the component controller's context from your view? check if you have added the component controller reference in the "properties" tab of the view.
    Regards,
    Poojith MV

  • WAD: Crashes with Run Time Error '339': Component 'formx.ocx' (missing)

    when using SAPGui 7.10 --> BW3.5x Web Application Designer the
    application fails to start and we get the following error message.
    Run Time Error '339': Component 'formx.ocx' or one of it's dependencies
    is not correctly registered: a file is missing or invalid.
    This works correctly on some machines but on others we get this error
    message. We have applied the latest patch.
    I suspect some non-sap software component has damaged my installation. How can I debug this? Re-installing SAPGUI doesn't do any good.
    Any ideas gratefully received.

    Check the following link. Is your issue related to this???
    Re: Error in WAD

  • Design mode: Error during component layout. Choose Design Refresh to refresh design mode.

    Description Resource Path Location Type
    Design mode: Error during component layout. Choose Design > Refresh to refresh design mode. etPlayer.mxml /etPlayer/src Unknown Problem
    Refreshing wont work..
    any ideas?

    Some elements can cause the design view to break, it recently happened to me and this was my solution.
    I began by commenting out most of the visual elements from code and going back and forth to design view to try and get it working.
    Finally I narrowed it down to the "ToggleButtonBar" component. After I commented this line out the design view was up and running.
    This might not be the solution but it will get you back up and running.

  • Error in Component Loading the File

    Dear Expert,
    Good Morning!
    I tried to import license but error message "Error in component loading the file" appear.  Can anyone help me on this?
    Thanks

    hi Sandra,
    please make sure that your License file is correct and also take note of your SBO version and PL. this maybe the cause.
    i.e
    your SBO is 8.81 PL: 04, then your should use a license file that is for 8.81 version and not the older version of License file.
    regards,
    Fidel

  • Error: ActiveX Component Can't Create Object

    When I run the ADI on Windows Server 2003R2, it show following error when startup:
    Error connecting to Language Object, defaulting to US English.
    Error: ActiveX Component Can't Create Object
    Anyone know how to fix it?
    Many thanks in advance.
    Regards,
    Chris Lee

    Hi,
    You need to enable Trust access to Visual Basic project.
    Tools->Macro->Security->Trusted Publisher
    Enable Trust access to Visual Basic project there.
    Cheers
    Dinesh

Maybe you are looking for