SelectOneChoice

Hello,
I have a selectOneChoice wich takes it´s values from a list binded to a table. Defined like this:
<af:selectOneChoice label="#{bindings.Aplicacion1.label}"
binding="#{backing_DoctipUpdate.selectOneChoice1}"
id="selectOneChoice1"
value="#{bindings.Aplicacion1.inputValue}">
<f:selectItems value="#{bindings.Aplicacion1.items}"
binding="#{backing_DoctipUpdate.selectItems2}"
id="selectItems2"/>
</af:selectOneChoice>
The aplicacion1 items are ('A','E','R') I would like that in the SelecOneChice appear the values with a label to make easier to the user to know wich value select. Something like this, but using #{bindings.Aplicacion1.items}:
<af:selectOneChoice label="#{bindings.Aplicacion1.label}"
binding="#{backing_DoctipUpdate.selectOneChoice1}"
id="selectOneChoice1"
value="#{bindings.Aplicacion1.inputValue}">
<af:selectItem label="Enviar" value="E"
binding="#{backing_DoctipUpdate.selectItem1}"
id="selectItem1"/>
<af:selectItem label="Recibir" value="R"
binding="#{backing_DoctipUpdate.selectItem2}"
id="selectItem2"/>
<af:selectItem label="Enviar&amp;Rcibir" value="A"
binding="#{backing_DoctipUpdate.selectItem3}"
id="selectItem3"/>
</af:selectOneChoice>
Any idea is welcome
Thanks
Rowan

Hello Rowan,
In the list of values wizard you can select a different VO property to be used as the label, it does not have to be the same one as the value.
Regards,
~ Simon

Similar Messages

  • How can I pre-define the default selection in a SelectOneChoice?

    How can I pre-define the default selection in a SelectOneChoice?
    (1) Here's my JSF-code:
    <af:selectOneChoice label="#{res['usercreate.input.sex']}"
    value="#{bindings.Sex.inputValue}"
    binding="#{SelectListBean.sexlist}"
    readOnly="false" autoSubmit="false">
    <af:selectItem label="#{res['data.sex.women']}" value="1"/>
    <af:selectItem label="#{res['data.sex.man']}" value="2"/>
    </af:selectOneChoice>
    (2): manged bean: to set the default value to be the first in the list, my managed bean as follows:
    import oracle.adf.view.faces.component.core.input.CoreSelectOneChoice;
    public class MBSListBean {
    private CoreSelectOneChoice sexlist;
    public MBSListBean() {
    public void setSexlist(CoreSelectOneChoice sexlist) {
    this.sexlist = sexlist;
    this.sexlist.setValue(1);
    public CoreSelectOneChoice getSexlist() {
    return sexlist;
    (3) when i launch the page, it often gives me such warnings:
    WARNUNG: Could not find selected item matching value "1" in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=_id7]
    how to solve the problem ?
    Thanks,
    wzzdx

    You could also set the default on your entity or viewobject, in the properties of your attribute.

  • Null Value in af:SelectOneChoice

    HI,
    I want to fetch value from a selectone choice,in backing bean.
    following is my binding.
    <af:selectOneChoice value="#{bindings.ExcelVOCode.inputValue}"
    label="#{bindings.ExcelVOCode.label}"
    validator="#{FileProcessor.selectOneChoice_validator}"
    id="excelTypeList" autoSubmit="true" valuePassThru="true"
    immediate="true"
    binding="#{FileProcessor.excelTypeList}">
    <f:selectItems value="#{bindings.ExcelVOCode.items}" id="selectItems1"
    binding="#{FileProcessor.selectItems1}"/>
    </af:selectOneChoice>
    And i have tried following method to get the values.
    1
    CoreSelectOneChoice exe=getexcelTypeList();
    System.out.println("Id"+exe.getValue().toString());
    2 FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding("#{bindings.ExcelVOCode.inputValue}");
    System.out.println("Value"+vb.getValue(fc));
    But each of these method returns me null,
    Following is my page defination.
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.39.81" id="FileUploadPageDef"
    Package="xml.pageDefs">
    <parameters/>
    <executables>
    <iterator id="ExcelVOIterator" RangeSize="10" Binds="ExcelVO"
    DataControl="AppModuleDataControl"/>
    <iterator id="ExcelVO2Iterator" RangeSize="-1" Binds="ExcelVO2"
    DataControl="AppModuleDataControl"/>
    </executables>
    <bindings>
    <list id="ExcelVOCode" IterBinding="ExcelVOIterator" StaticList="false"
    ListOperMode="0" ListIter="ExcelVO2Iterator">
    <AttrNames>
    <Item Value="Code"/>
    </AttrNames>
    <ListAttrNames>
    <Item Value="Code"/>
    </ListAttrNames>
    <ListDisplayAttrNames>
    <Item Value="Name"/>
    </ListDisplayAttrNames>
    </list>
    </bindings>
    </pageDefinition>
    Please help me with it,
    Thanks

    Hi,
    Any how i was finally able to get the value by implementing somthing like this in the jsp
    <af:selectOneChoice value="#{bindings.ExcelVOCode.inputValue}"
    label="#{bindings.ExcelVOCode.label}"
    id="excelTypeList" autoSubmit="true" valuePassThru="true"
    immediate="false"
    binding="#{FileProcessor.excelTypeList}"
    simple="true" required="false"
    partialTriggers="excelTypeList">
    <af:forEach items="#{bindings.ExcelVO.rangeSet}" var="item">
    <af:selectItem value="#{item.Code}" label="#{item.Name}"
    binding="#{FileProcessor.selectItem}"/>
    </af:forEach>
    </af:selectOneChoice>
    and this in the backing bean.
    CoreSelectItem seq=getSelectItem();
    System.out.println("Item"+seq.getLabel());
    But the problem is when i attach a binding to Selectitem,it doesn't show me all the values in the drop down it only shows the last value in the table ,i.e the drop down have a single entry.
    Please provide some indicator.
    Thanks

  • Removing duplicate values from selectOneChoice bound to List Iterator

    I'm trying to remove duplicate values from a selectOneChoice that i have. The component binds back to a List Iterator on the pageDefinition.
    I have a table on a JSF page with 5 columns; the table is bound to a method iterator on the pageDef. Then above the table, there are 5 separate selectOneChoice components each one of which is bound to the result set of the table's iterator. So this means that each selectOneChoice only contains vales corresponding to the columns in the table which it represents.
    The selectOneChoice components are part of a search facility and allow the user to select values from them and restrict the results that are returned. The concept is fine and i works. However if i have repeating values in the selectOneChoice (which is inevitable given its bound to the table column result set), then i need to remove them. I can remove null values or empty strings using expression language in the rendered attribute as shown:
    <af:forEach var="item"
    items="#{bindings.XXXX.items}">
    <af:selectItem label="#{item.label}" value="#{item.label}"
    rendered="#{item.label != ''}"/>
    </af:forEach>
    But i dont know how i can remove duplicate values easily. I know i can programatically do it in a backing bean etc.... but i want to know if there is perhaps some EL that might do it or another setting that ADF gives which can overcome this.
    Any help would be appreciated.
    Kind Regards

    Hi,
    It'll be little difficult removing duplicates and keeping the context as it is with exixting standard functions. Removing duplicates irrespective of context changes, we can do with available functions. Please try with this UDF code which may help you...
    source>sort>UDF-->Target
    execution type of UDF is Allvalues of a context.
    public void UDF(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    ArrayList aList = new ArrayList();
    aList.add(var1(0));
    result.addValue(var1(0));
    for(int i=1; i<var1.length; i++){
    if(aList.contains(var1(i)))
         continue;
    else{
    aList.add(var1(i));
    result.addValue(var1(i));
    Regards,
    Priyanka

  • Issue when SelectOneChoice is used with Domain data type in JDev 11.1.2.0.0

    Hi,
    I am facing one issue while working with SelectOneChoice along with Custom Domain data type. Sample app to simulate the issue is available at http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Issue Details.
    Base view object’s attribute is of type CustomString, for which another static VO’s attribute is attached as LOV. LOV attribute is of type String. Because of this data type mismatch between LOV VO attribute and Base VO attribute, while working in screen, initially we were facing Class cast exception.
    Cannot convert <<LOV Attr. Val.>> of type class java.lang.String to class model.domain.common.CustomString This is not only for this type of SelectOneChoice but also for InputText field whose underlying VO attribute is of type CustomString (i.e. any Custom Domain type)
    On raising this in Jdeveloper forum, I came to know that adding a default oracle converter against the UI Component will take care of converting to respective data type. After added the converter for InputText and SelectOneChoice components, this issue got resolved. This was our lesson while working in Jdeveloper version 11.1.1.3.0. Converter we used,
    <f:converter converterId="oracle.genericDomain"/> When we try the same scenario in Jdev Version 11.1.1.4.0, without having the oracle converter itself, SelectOneChoice started working fine!! (i.e. it is able to set the base attribute with LOV attribute’s value but with proper base attribute’s domain data type). Anyhow, converter is required for InputText.
    When we try the same scenario in Jdeveloper new version 11.1.2.0.0, it started giving class cast exception when we don’t have oracle converter for SelectOneChoice. But by adding it, though it didn’t give such class cast exception message, though a selection is made in SelectOneChoice, VO attribute has not been updated with the new value. Instead it is updated with null value (Checked the setter method of view row impl by having break point) . Because of this, after a selection is made, when we try to read the attribute value from VO on button click, VO attribute always returns null.
    We have also tried our own converters but there is no change in the behavior.
    The above misbehavior can be tested either by having SOP programmatically or by refreshing the SelectOneChoice by giving its id as Partial trigger to itself with autosubmit set to true, so that the selected value will be reset to null irrespective of the selection made.
    For convenience, Issue details with Sample application is shared. Shared link : http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Shared folder contains
    1. Sample App developed on Jdev 11.1.1.4.0 to ensure it didn’t give this error.
    2. Sample App developed on Jdev 11.1.2.0.0 to simulate this error.
    3. Error details in a document.
    Can anybody have a look at this and tell me why this misbehavior and is it a bug? If so, any workaround available to continue the development?
    Thanks in Advance.
    Raghu
    Edited by: Raguraman on Sep 10, 2011 10:31 AM

    Sorry for the late reply John and Frank. Ya i did. Thank you.
    One more detail:
    I tested the behavior in Jdeveloper 11.1.2.0.0. The recent surprise is Select One Choice is behaving perfectly when it used in Grid layout and fail to work when it is form layout. I am getting surprised why behavior of component varies based on the way it refers the binding.
    for form layout,
    value=#{bindings.
    for grid layout,
    value=#{row.bindings.
    The bug details (#/title) are Bug 12968871 - RUNTIME CONVERSION FAILURE WHEN USING CUSTOM DOMAIN OBJECT VALIDATION IN EO
    Edited by: Raguraman on Sep 12, 2011 8:23 PM
    Edited by: Raguraman on Sep 12, 2011 8:31 PM

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • How to get SelectOneChoice value from a af:Table

    JDeveloper v11.1.2.4.0 - JSF
    Greetings,
    im having a problem getting a column value that is a select one choice object.
    This is not a common problem since i actually did different thing than others so please follow my problem
    description and if you have any answer/questions please reply below.
    I have create a Database View that returns me 3 columns, lets say TestCode, TestDescription, TestValue.
    I have added one extra temporally column in my OV and called Temp.
    I drag & drop my OV, delete Temp value, and its column position, i drag&drop a LOV that is from another View,
    that shows me Doctor's name & surname and return doctor's id as select one choice value.
    Im using a function that go thru the iterator, gets the rows, and save them in database (doesn't matter how).
    The problem is, my selectonechoice, do not have row.bindings.DoctorId.InputValue but bindings.DoctorId.InputValue instead, so i can retrieve the current row's selectonechoice value.
    So when my loop is finish and insert the rows in to my database, all row's doctor's id is the same since the binding do not change thru the loop.
    I don't know how to get the current row's select one choice value to use the correct value on each row loop.
    Here is my loop function:
            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iterator = bc.findIteratorBinding("ExaminationsIterator");
            DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
             RowSetIterator rsi = iterator.getRowSetIterator(); 
             int i=0;
            OperationBinding save_exams = bindings.getOperationBinding("SAVE_EXAMINATION");
            OperationBinding save_exams_commit = bindings.getOperationBinding("SAVE_EXAMINATION_COMMIT");
            try{
             while(i < rsi.getRowCount()){
                 Row r = iterator.getCurrentRow();
                 save_exams.getParamsMap().put("CodeTest", r.getAttribute("CodeTest"));
                 save_exams.getParamsMap().put("Dates", r.getAttribute("Dates"));  
                 save_exams.getParamsMap().put("CodeId", orderid.getValue());  
                 save_exams.getParamsMap().put("Times", r.getAttribute("Times"));   
                 save_exams.getParamsMap().put("DoctorId", resolveExpression("#{bindings.DoctorId.attributeValue}").toString());
                 save_exams.getParamsMap().put("IdPatients", patientid.getValue());  
                 save_exams.execute();
                 rsi.next();
                 i++;
                save_exams_commit.execute();
    I get the current doctor's id binding and not each row's value.
    Can you assist me on this please?

    I have created a work around solution, until any more expert than me come with more advance solution.
    1) I add a LOV at doctor's id on target View object.
    2) On runtime, i populate my Database View
    3) go through all rows in my DB View iterator
    4) add each row on the target View Object (missing the doctor's id, since i want that to be on runtime) & commit rows
    5) after the loop is done and the target view object show me the results of the DB View, i choose on runtime the doctor's id and commit the changes so
    the new rows, with new updated date will be finally populated to the database.
    Hope this helps if anyone have a similar task.
    Please let me know if you find a more direct solution, that working with 2 tables to populate 1.

  • How to get selected value from SelectOneChoice

    Hi,
    I'm facing a problem to get selected value from SelectOneChoice. I have valueChangeListener event on a (SelectOneChoice)item. After user makes a choice I want to store selected value in a bean property to pass it to a method.
    For example List item shows dname from dept table after user makes a choice I want to get deptno and populate into bean which I use to pass into my method.
    If I use valueChangeEvent.getNewValue() I always get negative value instead I want deptno selected. Sample code pasted below.
    public void setDeptno(ValueChangeEvent valueChangeEvent) {
    BindingContainer b = getBindings();
    OperationBinding oB = b.getOperationBinding("setDeptno");
    //Checking instance of because same method is called from another text inputText item.
    if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
    CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
    if (columnName.getId().toString().equals("deptDname")){
    JSFUtils.setManagedBeanValue("dept.deptDeptno",valueChangeEvent.getNewValue());
    }

    if your selectOneChoice has value equal to #{bindings.deptno} bound to the iterator Dept1Iterator,
    then the backing code will look more like
                    public void setDeptno(ValueChangeEvent valueChangeEvent) {
                        BindingContainer b = getBindings();
                        OperationBinding oB = b.getOperationBinding("setDeptno");
                        //Checking instance of because same method is called from another text inputText item.
                        if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
                            CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
                        if (columnName.getId().toString().equals("deptDname")){
                            FacesContext ctx = FacesContext.getCurrentInstance();
                            Application app = ctx.getApplication();
                            ValueBinding bind = app.createValueBinding("#{bindings.Dept1Iterator.currentRow}");
                            Row row = (Row)bind.getValue(ctx);
                            JSFUtils.setManagedBeanValue("dept.deptDeptno", row.getAttribute("deptno"));
                    } I haven't tested it, so it could perfectly not work at all

  • How to use af:selectOneChoice

    hi,
    i want to use a <af:selectOneChoice>
    <af:selectOneChoice id="navListCountry" autoSubmit="false" binding="#{SomeBean.Department}"
    valuePassThru="true">
    <f:selectItems value="#{bindings.DepartmentVo.items}"/>
    </af:selectOneChoice>
    i use bindings.DepartamentosVo.items from a table that has 2 fields(id,name_deparment ) i want to show the name of department and get the id of department and with this id to filter the city`s in another selectOneChoice and get the id of the deparment and id of the city to insert in another table from a bean with another data
    1. how to get the values with a bean
    thansk

    http://thepeninsulasedge.com/frank_nimphius/2008/05/16/blogbuster-treasures-hunt-blog-entries-from-the-lost-orablogs-blog-for-download/

  • SelectOneChoice not showing all values from database

    Hi!
    I have to put a list of values in my select one choice. When I do the query in database, all the values are selected. But, with the same query on JPQL, the select on choice do not show all values in database. Anyone can help me, please?
    P.S.: I am using SelectOneChoice with SelectItems, in JDeveloper 11g
    Code:
    <af:selectOneChoice id="selAction" value="#{row.idCmd}"
    unselectedLabel="&lt;Selecione>">
    <af:forEach var="alertTypeNode"
    items="#{bindings.actionFindAll.iteratorBinding.allRowsInRange}">
    <af:selectItem value="#{alertTypeNode.dataProvider.idCmd}"
    label="#{alertTypeNode.dataProvider.nmCmd}"
    id="si1"/>
    </af:forEach>
    </af:selectOneChoice>

    In your page binding check the rangesize setting for the executable you use - set it to -1.

  • LOV(af:selectOneChoice) with bind variable in af:table

    Hi All,
    I have a table where a column is defined as dropdown(af:selectOneChoice). The query for selectOneChoice has a bind variable which needs to be set as a value from the base view Object corresponding row.
    Suppose a table Employee
    EmpId EmpName EmpType Authorization
    101 John Temp No
    The above table is created as af:table and 'Authorization' is implemented as dropdown(af:selectOneChoice) . The selectOneChoice has a query(AuthorizationLovVVO) with bind variable . For each row of af:table(EmployeeVO) , af:selectOneChoice query(AuthorizationLovVVO) requires
    the corresponding row(EmployeeVO) 'EmpType' to be set as value of bind variable.
    Can you please suggest how can we achieve this functionality.
    Edited by: 907302 on Oct 17, 2012 7:22 AM
    Edited by: 907302 on Oct 17, 2012 7:22 AM

    I have checked the following post where it has been suggested to access the the current row value as groovy expression.
    groovy for bind variable
    Suppose my AM name is 'TestAM' , i have tried the below expressions for value of bind variable but it does not work :
    1) adf.object.TestAM.findViewObject('EmployeeVO1').currentRow.EmpType
    2) adf.object.TestAMDataControl.findViewObject('EmployeeVO1').currentRow.EmpType
    None of the above expressions work and i get the error while running the page as 'Variable NotesAM is not recognized.' / 'Variable NotesAMDataControl is not recognized.' .
    Can you please suggest if we can achieve the functionality using this approach . Also let me know if i am missing something in the above expression.

  • Exporting the label of a  af:selectOneChoice from an applications table

    Hi All,
    JDEV 11g
    I have a problem where a column in an applications table <fnd:applicationsTable>is defined as a select one choice as shown below
                   <af:selectOneChoice value="#{row.bindings.BucketType.inputValue}"
    label="#{row.bindings.BucketType.label}"
    id="soc1">
    <f:selectItems value="#{row.bindings.BucketType.items}"
    id="si1"/>
    </af:selectOneChoice>
    Export has been enabled in the applications table. But when I export it, in the excel, only the value of the column is present and
    not the label?
    I want the label to be exported to the excel. Help is appreciated.
    Thanks in advance.
    Pritom

    As far as I know, the <fnd:> tags aren't available to us mere mortals who don't work for Oracle - perhaps you meant to ask in an internal forum?

  • 10.1.3 Pro: How to get the selectedItem in a selectOneChoice?

    I have a selectOneChoice component on the JSP. It has a list of IDs from 1 to 100 and 19 is skipped (... 17, 18, 20, 21...). I tried the following code to get the real value of the selectedId.
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding valueBinding = fc.getApplication().createValueBinding(
    "#{bindings.RoyMainView1Ke.inputValue}");
    if(valueBinding != null){
    Object selectedId = valueBinding.getValue(fc);
    System.out.println(" selectedId is " + selectedId);
    }else{
    System.out.println(" selectedId is null");
    The problem is: if the seletedId is from 1 to 18, it works fine. But if it is 20, the selectedId is 19. It seems like the selectedId I get from the above code is the index, not the real value.
    Anybody know how to fix it? Thank you so much in advance.
    Best regards,
    Annie
    null

    This is my code
    public static Date getCalendar(Calendar calendar,int getYear) {
    String      formatted_date="";
         int year = getYear;
         int month = calendar.get(Calendar.MONTH+1);
         int day = calendar.get(Calendar.DATE);
         int hour = calendar.get(Calendar.HOUR);
         int min = calendar.get(Calendar.MINUTE);
         int sec = calendar.get(Calendar.SECOND);
         int am_pm =calendar.get(Calendar.AM_PM);
         formatted_date = month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec+" PM";
         System.out.println("formatted_date is "+formatted_date);     
         o/p : formatted_date is 1/4/2006 1:44:21 PM
         SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    //     DateFormat dateFormat =DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
         Date passdate = new Date();
         try {
              passdate = dateFormat.parse(formatted_date);
         } catch (ParseException e) {
              System.out.println("Invalid Date Parser Exception "+e.getLocalizedMessage()+"DateFormat is "+dateFormat);
              System.out.println("The Date inside the function is "+passdate+"and the year passed is "+year);
    o/p : The Date inside the function is Sat Apr 01 00:00:00 IST 2006and the year passed is 2006
         return passdate;
    Expected O/P is 3/1/2006 1:44:12 PM
         }

  • VO LOV (and af:selectOneChoice) refresh. Can it be automatic?

    Hi!
    I'm using the build: JDEVADF_11.1.2.2.0_GENERIC_120418.2212.6183.1
    I defined an attribute in a ViewObject to use a LOV.
    When the page which uses the such attribute is loaded the current database records/information are loaded with no problem.
    But if there is some change in the data from where the LOV comes, it does not reflect in the items available (neither if the underlying record was deleted/inserted/updated). No matter what I do: reload the page, navigate to other and come back and so forth, the only way to refresh the combo box is starting a new session.
    Looking at the pagedef I could not find the iterator used to build the list of items in the combo box, but while debugging the page I could find a iterator (in fact a JUIteratorBinding) that had the name of the underlying view (from where the items to populate the combo box come) and an additional "List_XX" in the end of the name where XX is a number that varies with no apparent logic sometimes is 2, sometimes is 13, sometimes is 87 and so forth. So I guessed ADF generates it automatically.
    I wrote a small function linked to a button and called from there the iterator refresh method.
    Once this was done the refresh is processed and everything looks fine for all operations in the underlying data (insert/update/delete).
    While I found a partial solution, it looks too much complicated.
    What I mean is: Do we need to have all this amount of work to get a simple combo box refreshed?
    Is there any approach that is simpler?
    I can't believe that a framework like ADF don't have an easier way to solve this use case, but I read the documentation and searched a lot this forum and found no solution, although many posts helped me in building this "solution" (did I miss something?).

    Duplicate af:selectOneChoice refresh problem

  • Using a SelectOneChoice to retrieve a value in to a variable...

    AAAAaaah. I've spent far too much time on what should be a very simple operation - can somebody help me....
    (JDeveloper 10.1.3.4. Oracle ADF on Oracle ADF BC.)
    I have a backing bean called HspShopBacking with a simple Date variable "selectedTime":
    public class HspShopBacking
      private oracle.jbo.domain.Date selectedTime;
      getSelectedTime(){...}
      setSelectedTime(oracle.jbo.domain.Date selectedTime){...}
    }I would like to use a SelectOneChoice to display a list of times from my ViewObject: DELIVERY_TIMES and retrieve the value in to my selectedTime attribute.
    Unlike most of the examples I can find I DON'T want my SelectOneChoice to have an existing Iterator as it's base datasource and then to retrieve the selected value from that iterator (because I've got various commits happening that might commit the updated value).
    In Forms this was SO easy.....can somebody PLEASE point me in the direction of the relevant documentation or tell me what I need to do!!

    I have a habit of answering my own questions ... these are the steps I took for retrieving a value from a SelectOneChoice component in to an individual variable, accessible from a backing bean (see the bottom of this post for links to the other posts that assisted me):
    As an example, assume that I have Emp and Dept view objects in my model. I want a SelectOneChoice of departments that will take the selected Department Name in to a separate variable for access in the backing bean (and therefore will not use the Emp view at all).
    1) To easily create a SelectOneChoice object (rather than try to create it manually), open the Emp view's data control up in the Data Control pallette and drag the Deptno column on to your JSPX (somewhere within the af:form tags). This is just so we can create the control using the wizard, we will be removing all references to Emp later.
    2) From the context menu choose Single Selections->ADF Select One Choice
    3) Select the Dept view iterator as the List Data Source
    4) For now (to complete the wizard) select Deptno from the Base Data Source Attribute list, and choose Deptno from the List Data Source Attribute list (we will be changing these values in the XML once the wizard is complete).
    5) Set the display attribute to Dname
    6) Click OK
    7) Open the source of the JSPX page where you created your SelectOneChoice right click and "Go to Page Definition"
    8) In the structure pane, Right-click on executables->Insert inside executables->variableIterator
    9) Right click on the created variables node in the Structure Pane->Insert inside variables->Variable
    10) Give your variable a name (such as selectedDepartmentName)
    11) I gave it a type of java.lang.Object (for maximum flexibility - I will be type checking inside the Backing Bean)
    12) Select the bindings node, and from the right-click menu choose Insert inside bindings->attributeValues
    13) From the wizard choose the "variables" data collection, and the attribute you named earlier (e.g. selectedDepartmentName), click OK
    14) From the source xml of the attributeValues object you just created, change the id to something meaningful (e.g. selectedDepartmentValues)
    15) In the structure pain, open the bindings node and Right click the list iterator binding that was created when you added the SelectOneChoice object (will be called something like EmpDeptNo) and choose "Go To Source"
    15) From the source xml change the IterBinding="EmpIterator" to IterBinding="variables"
    16) Change <Item Value="Deptno"/> to <Item Value="selectedDepartmentName">
    So in summary the JSPX page will have:
                      <af:selectOneChoice value="#{bindings.EmpDeptNo.inputValue}"
                                          label="#{bindings.EmpDeptNo.label}">
                        <f:selectItems value="#{bindings.EmpDeptNo.items}"/>
                      </af:selectOneChoice>The page definition will have:
    <executables>
        <iterator id="DeptIterator" RangeSize="-1"
                  Binds="Dept" DataControl="AppModuleDataControl"/>
        <variableIterator id="variables">
          <variable Name="selectedDepartmentName" Type="java.lang.Object"/>
        </variableIterator>
    </executables>
    <bindings>
        <list id="EmpDeptNo" IterBinding="variables"
              StaticList="false" ListOperMode="0" ListIter="DeptIterator"
              NullValueFlag="1" NullValueId="EmpDeptNo_null">
          <AttrNames>
            <Item Value="selectedDepartmentName"/>
          </AttrNames>
          <ListAttrNames>
            <Item Value="Dname"/>
          </ListAttrNames>
          <ListDisplayAttrNames>
            <Item Value="Dname"/>
          </ListDisplayAttrNames>
        </list>
        <attributeValues IterBinding="variables" id="selectedDepartmentValues">
          <AttrNames>
            <Item Value="selectedDepartmentName"/>
          </AttrNames>
        </attributeValues>
    </bindings>And your backing bean can access the value using:
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding("#{bindings.selectedDepartmentValues}");
        AttributeBinding ab = (AttributeBinding) vb.getValue(fc);
        String dName = (String) ab.getInputValue() ;References:
    Geting variable value in backing bean
    http://www.oracle.com/technology/products/jdev/tips/mills/listvalue/listbindingvalue.html

  • How to assign a default value to a SelectOneChoice

    Hi,
    I'm working with ADF 11g: WebLogic 10.3 and JDeveloper 11.1.1.3.0.
    I wonder how to assign a default value to a SelectOneChoice.
    In a ViewObject I have a field defined as Combo Box. Then drawing the combo in my jspx page:
    +<af:selectOneChoice value="#{bindings.Circularidad.inputValue}"+
    +label="#{bindings.Circularidad.label}:"+
    +required="#{bindings.Circularidad.hints.mandatory}"+
    +shortDesc="#{bindings.Circularidad.hints.tooltip}"+
    +id="soc2">+
    +<f:selectItems value="#{bindings.Circularidad.items}"+
    +id="si2"/>+
    +</af:selectOneChoice>+
    Can anyone help me?
    Thanks.

    Assume u have an LOV relation associated with VO attribute.
    1. Go to Edit List of Values window
    2. Click UI Hints tab
    3. Check Include no selection item check box.
    4. Select Labeled Item ( First of the list) entry form right combo box.
    5. Give ur default value in right text box.
    Regards,
    Dinil Mithra

Maybe you are looking for