SelectOneChoice SET

Hi All,
I have following code snippet.
<af:selectOneChoice value="#{bindings.TableUsersView1CustId.inputValue}"
label="#{bindings.TableUsersView1CustId.label}"
binding="#{backing_create.selectOneChoice3}"
required="false" valuePassThru="true"
partialTriggers="selectOneChoice1"
immediate="true"
disabled="#{UserTypes.cmaUserTypes == \'cma\'} "
id="selectOneChoice3">
<f:selectItems value="#{bindings.TableUsersView1CustId.items}"
binding="#{backing_create.selectItems4}"
id="selectItems4"/>
</af:selectOneChoice>
Now, I do get a value called "Product" in my backing bean. I want to set this value "Product" SELECTED ALREADY as the jsp page displays.
To achieve this, I know you need to use the
public void setSelectOneChoice3(CoreSelectOneChoice selectOneChoice3) method to set that "Product" item, so the page displays with "Product" already selected.
But, how to do that ?????? How to set "Product" string in setSelectOneChoice3 ????
Bacaz, I guess you cannot do that in selectOneChoice, as you could easily do that, if it would have been a textfield.
REASON: selectOneChoice deals with indexes (like 1, 2 ,3 ...... as items)
How can i set the string "Product" as item so it is already selected when page is displayed
Something like one would do if it would have been textfield. Pl refer following example code for reference. i want to achieve similar effect in selectOneChoice. Please see how I am doing inputText2.setValue(new String(custIdIs)); following.
public void setInputText2(CoreInputText inputText2) {
System.out.println("it is in set of inputText2 1");
String custIdIs = "";
String myUserIs = ((HttpSession)exct.getSession(false)).getAttribute("MyUserType").toString();
if (((HttpSession)exct.getSession(false)).getAttribute("LoggedInUserCustId") != null) {
custIdIs = ((HttpSession)exct.getSession(false)).getAttribute("LoggedInUserCustId").toString();
if (myUserIs.equalsIgnoreCase("cma")) {
inputText2.setValue(new String(custIdIs));
this.inputText2 = inputText2;
this.inputText2.setDisabled(true);
thank,
capa

Hi All,
I was able to get the real selected value of selectOneChoice (its a dynamic LOV) using following. I used second iterator to get the selected vaue.
Also, I wanted to SET the value for selectOneChoice from backing bean on page display. that also i could achieve as follows. Now it is working for me. hope this helps for you.
Wish there could have been a simple way in ADF.
<af:selectOneChoice value="#{bindings.TableUsersView1CustId.inputValue}"
label="#{bindings.TableUsersView1CustId.label}"
binding="#{backing_create.selectOneChoice3}"
required="false"
valuePassThru="true"
immediate="true"
partialTriggers="selectOneChoice1"
disabled="#{UserTypes.cmaUserTypes == \'cma\'}"
readOnly="#{UserTypes.cmaUserTypes == \'cma\'}"
id="selectOneChoice3">
<f:selectItems value="#{bindings.TableUsersView1CustId.items}"
binding="#{backing_create.selectItems4}"
id="selectItems4"/>
</af:selectOneChoice>
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind =app.createValueBinding("#{bindings.TableUsersViewIterator.currentRow}");
Row row = (Row)bind.getValue(ctx);
mycustomerid = (String)row.getAttribute("CustId");
System.out.println("*********************************");
System.out.println("key: " + mycustomerid);
System.out.println("*********************************");
And following code I am using in setSelectOneChoice method to SET the value in selectOneChoice.
BindingContainer bc = this.getBindings();
DCIteratorBinding dcIterBinding = (DCIteratorBinding) bc.get("TableCustomersView1Iterator");
System.out.println ("the dcIterBinding "+dcIterBinding);
System.out.println("after TableCustomersView1Iterator in craete ");
if (dcIterBinding != null) {
Row[] rwarray = dcIterBinding.getAllRowsInRange();
System.out.println ("the dcIterBinding "+rwarray);
if (rwarray != null) {
for (int i = 0; i < rwarray.length; i++)
{ System.out.println("inside for TableCustomersView1Iterator in craete ");
if (((String)rwarray.getAttribute("CustId")).equalsIgnoreCase(custIdIs))
System.out.println("inside if TableCustomersView1Iterator in craete "+(String)rwarray.getAttribute("CustId"));
this.selectOneChoice3.setValue(new Integer(i+1));
//this.selectOneChoice3.setSubmittedValue(new Integer(i+1));
System.out.println("after if TableCustomersView1Iterator in craete ");
// this.selectOneChoice3.setValue((i));
break;

Similar Messages

  • SelectOneChoice set default selected item

    Hi
    I have an edit form, that is loaded from a query. In this form there are some values that are setted using a selectOneChoice
    The thing is that i need to set the selectOneChoice initial selected item acording to the values of the entity retrieved by the query
    How can i do this ???
    Thanks

    Hi,
    Thanks for your reply.
    But I have already called a action on Add button.
    Still I tried the way you suggested,
    RichSelectOneChoice selectOneChoiceBinding = new  RichSelectOneChoice();
          selectOneChoiceBinding.setValue(Integer.toString(1));
          AdfFacesContext.getCurrentInstance().addPartialTarget(selectOneChoiceBinding.getParent());but this doesn't work.
    I have binded(private RichSelectOneChoice customerIDNo;) that SelectOneChoice in bean.
    So, I tried it like this also,
            customerIDNo.setValue(Integer.toString(1));
            AdfFacesContext.getCurrentInstance().addPartialTarget(customerIDNo.getParent());still it doesn't work.
    please help.
    Thanks,
    Madhav.

  • Set a default value for a radio button populated with a List of value

    Hi,
    I am using jdeveloper 11.1.1.3.0. I need to set a default value for a radio button populated with a List of value(Yes/No). Here's the selectonechoice code.
    <af:selectOneRadio value="#{bindings.Code.inputValue}"
    label="#{bindings.Code.label}"
    required="#{bindings.Code.hints.mandatory}"
    shortDesc="#{bindings.Code.hints.tooltip}"
    id="sor1" autoSubmit="true"
    valuePassThru="true" layout="horizontal">
    <f:selectItems value="#{bindings.Code.items}" id="si1"/>
    </af:selectOneRadio>
    I want to have the selectonechoice set to No by default. In the previous versions, I set the default value in the base attribute VO. But it is not working in the new version.
    Thanks

    Hi,
    this should work in JDeveloper 11.1.1.3 the same as in 11.1.1.2. If it doesn't then it is better to file a bug than to work around it
    Frank

  • Problem with Required fields in Panel Tabbed

    Hi ,
    I am using Jdeveloper 11.1.1.2 and i created a jspx page in which i am using <af:panel Tabbed> which has 2 <af:showDetailItem> items.
    Here the problem is in each show detail item i have selectOneChoice set as required fileds. when i am runnin the page and click the second tab it is asking to select a value for SOC.
    Can anyone help me in how to make required fileds show only for that <showdetailitem> item but not for both the showdetailitems.
    Thanks,
    Harika.

    Set the immediate property for the tab to be true.
    Similar forum post:
    Issue with Panel Tabbed and required property
    Thanks,
    Navaneeth

  • How to show default value selected in combo box...

    Hi,
    I need an help...
    I have a combo box and i want to show the default value(coming from DB) selected on combo box on Page Render.
    Thanks,
    Neha

    Hi,
    Will this help?
    database default value in selectOneChoice
    Set default selected value in a SelectOneChoice
    Regards
    Vishal

  • How to limit no of rows in ADF table

    Hi all,
    i want to limit the number of rows displayed in ADf table. I tried using range size, but it didn't work. In the post
    Limiting ADF table number of rows is not working
    it was stated that it is a bug. Is it fixed now or is there any work around to fix this.
    Thanks in advance,
    Nad

    Hi Nad..
    Hope this would help you..
    Suppose you have these..
    Jspx Page - RangeTable.jspx
    Backing Class - RangeTable.java
    Iterator used to load Table in page definition - ViewObjTableData
    First of all In your pagedefinition page change the RangeSize value to -1 to display all rows in your table like
    <iterator id="ViewObjTableDataIterator" RangeSize="-1"
                  Binds="ViewObjTableData" DataControl="AppModuleDataControl"/>Now Goto your Backing bean and there put the setter getter method to limit your Table to show data as you want.. Like..
    public static int rangeSize = 10;   
        public void setRangeSize(int rangeSize) {
            this.rangeSize = rangeSize;
            AdfFacesContext.getCurrentInstance().addPartialTarget(table1);
        public int getRangeSize() {
            return rangeSize;
        }Line having this is your default no of rows which you will get on table load..
    public static int rangeSize = 10;and
    this will forcely refresh your table according to your choise
    AdfFacesContext.getCurrentInstance().addPartialTarget(table1);Now come to Your Jspx page and
    Add af:selectOneChoice to Action facet of your table and add some selectItem having value of *10*,*20*, and *30* According to your choise
    <af:selectOneChoice label="Row Limit" autoSubmit="true"
                                          binding="#{backing_RangeTable.selectOneChoice1}"
                                          id="selectOneChoice1"
                                          value="#{backing_RangeTable.rangeSize}">
               <af:selectItem label="10" value="10"
                                       binding="#{backing_RangeTable.selectItem1}"
                                       id="selectItem1"/>
               <af:selectItem label="20" value="20"
                                       binding="#{backing_RangeTable.selectItem2}"
                                       id="selectItem2"/>
               <af:selectItem label="30" value="30"
                                       binding="#{backing_RangeTable.selectItem3}"
                                       id="selectItem3"/>
    </af:selectOneChoice>set its autoSubmit property to true and bind the value property to the rangeSize of your backing beans
    now in your table change binding property of Rows to your backingbean's rangeSize like
    rows="#{backing_RangeTable.rangeSize}"and also set this
    partialTriggers="selectOneChoice1"That all dear..
    Now check it out and let me know that you got your solution or not?
    and if you got your right answer then dont forget to put \[SOLVED\] tag with your subject line. and mark this answer as correct and helpful.. :-)
    Thanks,
    Fizzz...

  • How can i make the valueChangeListener works for all item under foreach?

    Hi,
    My jspx file have the following content:
    <af:forEach items="#{pageFlowScope.directiveStep.paraItems}"
                                                       var="item">
                                              <af:panelLabelAndMessage label="#{item.name}"
                                                                       id="plam2"
                                                                       for="soc1">
                                                 <af:panelGroupLayout id="pgl2"
                                                                      layout="horizontal">
                                                    <af:selectOneChoice id="soc1"
                                                                        value="#{item.howValue}"
                                                                        required="true"
                                                                        valueChangeListener="#{pageFlowScope.directiveStep.howToSetDirectivePropValueChange}"
                                                                        autoSubmit="true">
                                                       <f:selectItem value="Set Value}"
                                                                      id="si1"/>
                                                      <f:selectItem value="Choose a Value"
                                                                      id="si1"/>
                                                    </af:selectOneChoice>
                                                    <af:switcher facetName="#{item.selectWay}"
                                                                 id="switch1">
                                                       <f:facet name="true">
                                                          <af:selectOneChoice id="soc2"
                                                                              required="true"
                                                                              value="#{item.value}">
                                                             <f:selectItems value="#{pageFlowScope.directiveStep.procVarItems}"
                                                                            id="si2"/>
                                                          </af:selectOneChoice>
                                                       </f:facet>
                                                       <f:facet name="false">
                                                          <af:inputText id="it1"
                                                                        required="true"
                                                                        value="#{item.value}"/>
                                                       </f:facet>
                                                    </af:switcher>
                                                 </af:panelGroupLayout>
                                              </af:panelLabelAndMessage>
                                           </af:forEach>
    The ui is like:
    label name     |    selectOneChoice : 'Set Value' or 'Choose a Value'   |        inputText (if it is 'Set Value') / selectOneChoice (if it is 'Choose a Value')
    The weird thing is when i click the selectOneChoice of the two or later row, the ValueChangeListener will be invoked, it indeed change the value  of 'selectWay' correctly. But the UI will not update. If later i do the same thing to the first row, all other rows in UI will update corrently.
    Any suggestions? Very appreciated for any repiles.
    Thanks.

    Hi,
    on problem I spot is that all your components created by the forEach loop have the same ID value. I suggest you change the ID to e.g. id="soc_#{item.index}" for zhe select one choices. In addition, I don't see where you refresh components after the change
    Frank

  • How to set the value in SelectOneChoice

    Hi,
    I need an help....
    can anyone please tell me how to set the value in SelectOneChoice.
    I want to set the value at index 3
    i am trying selectOneChoice1.setvalue(new Integer(3)); but it is throwing an NullPointerException.
    Thanks,
    Neha

    Hi,
    is it ADF bound? If so then you set the default value to the list binding in the PageDef file. The value of the component must be bound to a method expression, which is why you see an exception. However, I think we need more information
    Frank

  • Set the default value in selectonechoice using bindings property

    Hi,
    I have a question to ask about selectonechoice.  I have scanned the forum but I just cant get this to work by myself.
    My business service is a web service.
    Use Case:
    From the web service data control, I should display a drop down of all available options but I should be able to filter the list of selectItems shown in the dropdown.
    After the data is filtered, the drop down should display the first item in the list.
    so this is what I did.  I drag the iterator in my data control as selectOneChoice.
    <af:selectOneChoice value="#{bindings.codeList.inputValue}"
                      label="Code">
        <f:selectItems value="#{pageFlowScope.codeList.items}"
                       id="si3"/>
    </af:selectOneChoice>
    ...but I cannot include all the data returned by the web service so I used the logic below to filter my data with the assistance of a managed bean.
    <af:selectOneChoice value="#{bindings.codeList.inputValue}"
                      label="Code">
        <f:selectItems value="#{pageFlowScope.myBean.codeTemplates}"
                       id="si3"/>
    </af:selectOneChoice>
    public class MyBean{
        private List<SelectItem> codeList;
        public List<SelectItem> getCodeTemplates(){
            if(codeList==null){
                codeList = new ArrayList<SelectItem>();
                    More Codes and logic..access the iterator and filter the data
                    Data below comes from the web service data control..
                    codeList.add(new SelectItem("90", "Crew"));
                    codeList.add(new SelectItem("91", "Manager"));
                    codeList.add(new SelectItem("94", "Staff"));
                //set the value to the first item in the list
                getBindings().setValue("#{bindings.codeList.inputValue}", 90);
            return codeList;
    My problem is that on first load of the page, I am encountering this problem.
    Could not find selected item matching value "90"  in RichSelectOneChoice.
    I know I can used the value property of my selectonechoice into my managed bean but I dont want to do that for now.
    I have set the valuePassThru property also but it does not help also.  The unselectedLabel is of no use since I dont want that to reflect at all.
    I am just not sure why I cannot set the value of my bindings given the code snippet above.
    #{bindings.codeList.inputValue} is a listBinding defined in my page definition.
    Any hints?

    Hi Frank,
    FrankNimphius wrote:
    Hi,
    did you ensure 90 is in the list and that its of the same data type?
    Frank
    Yes, I haved checked it.  To verify, I set the valuePassThru property to true and then in the generated markup, I used firebug to verify if the value is indeed set to 90.
    If I set the valuePassThru to false then the index value 0,1,2...n is assigned.
    I am doing this during onload operation and using lazy loading of the list.  I have set the immediate attribute as well but still not successful.
    JDEV 11G 11.1.1.7

  • Cannot set selectOneChoice value during reload (value auto become null)

    Dear all,
    I have a problem that getting null value in the SelectOneChoice field in a table binded to
    a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
    of the situation is described as follows:
    I've binded a view objects with 8 attributes to a af:table, then I manually change
    2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
    selectOneChoice. The code is as follow:
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
    sortable="false"
    headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
    id="c1" width="180"
    inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
         <af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
              required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
              columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
              maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
              id="it1"
              model="#{bindings.AcNo2.listOfValuesModel}"
              autoSubmit="false"
              returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
              <f:validator binding="#{row.bindings.AcNo.validator}"/>
         </af:inputListOfValues>
    </af:column>
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
         sortable="false"
         headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
         id="c2">
         <af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
              id="it2" autoSubmit="false"
              partialTriggers="cb1 cb2">
              <f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
         </af:selectOneChoice>
    </af:column>
    And I have binded the returnPopupListener to returnListerner event handler to automatically
    set the Currency field (2nd field) after the user chose the Account field (1st field) from
    the input list of value:
    public void returnListener(ReturnPopupEvent returnPopupEvent) {
         RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
         ListOfValuesModel lovModel = lovField.getModel();
         CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
         JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
         RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
         List tableRowKey = (List)rks.iterator().next();
         DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
         Key key = (Key)tableRowKey.get(0);
         Row row = dciter.findRowByKeyString(key.toStringFormat(true));
         DCBindingContainer bc = getBindingContainer();
         DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
         OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
         FacesContext fctx = FacesContext.getCurrentInstance();
         ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
         ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
         LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
         System.out.println("Return place: search date:" + loginInfo.getSearchDate());
         Row newRow = viewObject.createRow();
         String selectedAcNo = row.getAttribute("AcNo").toString();
         String selectedCurrency = row.getAttribute("CurrencyCode").toString();
         newRow.setAttribute("AcNo", selectedAcNo);
         newRow.setAttribute("CurrencyCode",selectedCurrency);
         newRow.setAttribute("OpenBal", 300);
         newRow.setAttribute("AvailBal", 200);
         newRow.setAttribute("CreateDate", new Date());
         newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
         newRow.setAttribute("LockStatus", "N");
         viewObject.insertRowAtRangeIndex(rowIndex, newRow);
    The problem occurs when I use a 'createInsert' button to create a new row in the table,
    and then choose a value from the inputListOfValues. The new row refresh and get the value
    I chose in the first column in the new row. But the second column (currency field) is left
    as empty (null value). If I change the second column frmo selectOneChoice to inputText,
    the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
    additional tricks in order to set the selectOneChoice value during refresh.
    Additionally I have tried to check the state of the view object attributes during the refresh
    lifecycle and found that the following reload method (else place) is being reached 3 times after I click
    the 'ok' button in the popup up in the inputListOfValue.
    public void beforePhase(PagePhaseEvent event) {
         //System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
         if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
              if (!isPostback()) {
              } else {
                   System.out.println("Post Back on Page Load!");
                   DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
                   OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
                   RowSetIterator iterator = viewObject.createRowSetIterator(null);
                   iterator.reset();
                   while (iterator.hasNext()) {
                        //Row row = viewObject.getCurrentRow();
                        Row row = iterator.next();
                        System.out.print("Account:" + row.getAttribute("AcNo"));
                        System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
                        System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
                        System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
                        System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
                        System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
                        System.out.println("");
                        if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
                             System.out.println("Match <current user> in preload");
                             //row.setAttribute("CurrencyCode", "USD");
                   System.out.println("end of reload");
    During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
    times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
    field is showing correctly without the null issue.
    Anyone can kindly give me some hints? Thanks a lot!!!

    Dear all,
    I have a problem that getting null value in the SelectOneChoice field in a table binded to
    a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
    of the situation is described as follows:
    I've binded a view objects with 8 attributes to a af:table, then I manually change
    2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
    selectOneChoice. The code is as follow:
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
    sortable="false"
    headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
    id="c1" width="180"
    inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
         <af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
              required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
              columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
              maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
              id="it1"
              model="#{bindings.AcNo2.listOfValuesModel}"
              autoSubmit="false"
              returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
              <f:validator binding="#{row.bindings.AcNo.validator}"/>
         </af:inputListOfValues>
    </af:column>
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
         sortable="false"
         headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
         id="c2">
         <af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
              id="it2" autoSubmit="false"
              partialTriggers="cb1 cb2">
              <f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
         </af:selectOneChoice>
    </af:column>
    And I have binded the returnPopupListener to returnListerner event handler to automatically
    set the Currency field (2nd field) after the user chose the Account field (1st field) from
    the input list of value:
    public void returnListener(ReturnPopupEvent returnPopupEvent) {
         RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
         ListOfValuesModel lovModel = lovField.getModel();
         CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
         JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
         RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
         List tableRowKey = (List)rks.iterator().next();
         DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
         Key key = (Key)tableRowKey.get(0);
         Row row = dciter.findRowByKeyString(key.toStringFormat(true));
         DCBindingContainer bc = getBindingContainer();
         DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
         OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
         FacesContext fctx = FacesContext.getCurrentInstance();
         ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
         ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
         LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
         System.out.println("Return place: search date:" + loginInfo.getSearchDate());
         Row newRow = viewObject.createRow();
         String selectedAcNo = row.getAttribute("AcNo").toString();
         String selectedCurrency = row.getAttribute("CurrencyCode").toString();
         newRow.setAttribute("AcNo", selectedAcNo);
         newRow.setAttribute("CurrencyCode",selectedCurrency);
         newRow.setAttribute("OpenBal", 300);
         newRow.setAttribute("AvailBal", 200);
         newRow.setAttribute("CreateDate", new Date());
         newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
         newRow.setAttribute("LockStatus", "N");
         viewObject.insertRowAtRangeIndex(rowIndex, newRow);
    The problem occurs when I use a 'createInsert' button to create a new row in the table,
    and then choose a value from the inputListOfValues. The new row refresh and get the value
    I chose in the first column in the new row. But the second column (currency field) is left
    as empty (null value). If I change the second column frmo selectOneChoice to inputText,
    the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
    additional tricks in order to set the selectOneChoice value during refresh.
    Additionally I have tried to check the state of the view object attributes during the refresh
    lifecycle and found that the following reload method (else place) is being reached 3 times after I click
    the 'ok' button in the popup up in the inputListOfValue.
    public void beforePhase(PagePhaseEvent event) {
         //System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
         if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
              if (!isPostback()) {
              } else {
                   System.out.println("Post Back on Page Load!");
                   DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
                   OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
                   RowSetIterator iterator = viewObject.createRowSetIterator(null);
                   iterator.reset();
                   while (iterator.hasNext()) {
                        //Row row = viewObject.getCurrentRow();
                        Row row = iterator.next();
                        System.out.print("Account:" + row.getAttribute("AcNo"));
                        System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
                        System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
                        System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
                        System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
                        System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
                        System.out.println("");
                        if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
                             System.out.println("Match <current user> in preload");
                             //row.setAttribute("CurrencyCode", "USD");
                   System.out.println("end of reload");
    During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
    times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
    field is showing correctly without the null issue.
    Anyone can kindly give me some hints? Thanks a lot!!!

  • How to set the default value of selectOneChoice

    Hi All,
    I have two selectOneChoice(soc1 and soc2) in two respective pages with the same datacontrol.Now i need to set the default value of soc2 as per the value selected in soc1.
    For eg:-
    if user has selected a value in soc1 say "Bag" in the list then it should set the default value in soc2 as "Bag" when the second page loads.As both the selectOneChoice has been created using same data contol.
    How can i achieve this?
    Please suggest.

    Hi PR/Suresh,
    Thanks for your reply.
    My soc1 shows the employeeId like 100,101,102,103 but it holds the value as employeeName like Navn,Joy,Steve,Mark. I have used valuechangeevent to get the current selected value from soc1 but when i set the value in soc2 in its set property then the log says :-
    *<SimpleSelectOneRenderer> <_getSelectedIndex> Could not find selected item matching value "Navn" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=soc2]*
    My jspx page code of soc2 is :-
    <af:selectOneChoice binding="#{backingBeanScope.backing_temp2.soc2}"
    id="soc2"
    label="#{bindings.FirstName.label}">
    <f:selectItems value="#{bindings.FirstName.items}"
    binding="#{backingBeanScope.backing_temp2.si2}"
    id="si2"/>
    </af:selectOneChoice>
    and in my bean where i am accessing the value from valuechangeevent from soc1:-
    public void getValue(ValueChangeEvent valueChangeEvent) {
    BindingContext bindingContext = BindingContext.getCurrent();
    oracle.binding.BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
    //for iterator name click binding tab in the jsf page
    DCIteratorBinding iter = (DCIteratorBinding) bindings.get("Employees1View1Iterator");
    int curIndex = (Integer)valueChangeEvent.getNewValue();
    Row datRow = iter.getRowAtRangeIndex(curIndex);
    String name = (String)datRow.getAttribute("FirstName");
    System.out.println("the new value is"+name);
    RequestContext requestContext = RequestContext.getCurrentInstance();
    requestContext.getPageFlowScope().put("value", name);
    and then i am setting it to the soc2 in backing bean :-
    public void setSoc2(RichSelectOneChoice soc2) {
    this.soc2 = soc2;
    RequestContext requestContext = RequestContext.getCurrentInstance();
    String val = requestContext.getPageFlowScope().get("value").toString();
    this.soc2.setValue(val);
    In this error i can predict that it is not able to find the 'Navn' in the list of soc2 because in the list it has employeeId which has corresponding value as name of that employee but how do i set the value in soc2 then.
    *<SimpleSelectOneRenderer> <_getSelectedIndex> Could not find selected item matching value "Navn" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=soc2]*
    Any ideas??
    Thanks

  • Set Action path in ValueChangeListener in SelectOneChoice

    Hi,
    I would like to see how to set the action path programatically in my java bean. What I meant is for example, in jspx page:
    <af:commandLink text="#{row.RequestUid}"
    id="cl1"
    action="gotoRequestOverview">
    </af:commandLink>
    I can define "action" in the commandLink. How can I achieve this in the ValueChangeListener in selectOneChoice?
    Thanks
    -Mina

    Many options..
    Check this out (the third option would suit ur need)
    drop down selection implements invoking different pages
    Fouth option: to have a hidden button and invoke it on your valueChange.
    Good luck !

  • Af:SelectOneChoice - how to set

    Hi All,
    I am newbie in ADF world.
    I am trying to do some samples. I created a table with the followind data (Employee_Id, EMployee_Name, Country)
    100     Steven     India
    101     Neena     America
    102     Lex     Australia
    and my jsff contains, here intentially i am using iterator. I dont want to use any adf form etc.
    <af:iterator id="itr5" value="#{bindings.myTable1VO1.collectionModel}" var="row" rows="#{bindings.myTable1VO1.rangeSize}">
    <af:inputText value="#{row.bindings.EmployeeId eq '101' ? row.bindings.EmployeeName : ''}" id="it3">
    </af:inputText>
    <af:selectOneChoice value="#{row.bindings.EmployeeId eq '100' ? row.bindings.Country : bindings.Country1.inputValue}"
    label="#{bindings.Country1.label}"
    id="soc2">
    <f:selectItems value="#{bindings.Country1.items}" id="si2"/>
    </af:selectOneChoice>
    </af:iterator>
    Also I created a countryLOV (Static list view object) with CCODE & COUNTRY and dragged and dropped the country as selectonechoice(as shown above).
    after executing this.
    in the ADF UI I am getting
    texbox(with value Neena)
    dropdown1 (nothing is selected)
    dropdown2 (India is selected)
    dropdown3 (India is selected)
    what i m trying to do here is want to display the employee name and country where employee_id is 101.
    Here I have two questions
    1) How can I set the dropdown value so that It will show 'America' in the dropdown for the employee_id 101.
    2) The textbox is shown only once and dropdowns are shown thrice. is it because that condition is matched for textbox??
    Please clarify these issues. Based on this I need to work on some usecase.
    PS : I have referred some examples related to af:selectonechoice but i found all those are related to this usecase.
    As I want to use iterator only and also dont want to use backing bean(want to set throught EL expressions only).
    Thanks,
    Ravi.

    Hi Frank,
    Thank you very much for your quick reply.
    As I understood that LOV-Switcher was working only when a field(LOV-SWICTHER) is accepting a user input/event.
    But, what will happen in a scenario where at a time need to show two dropdowns with two different static list values and and both static list values are mapped to same column in the table
    The issue is mentioned in the below post ( I dont want to duplicate it here, as the subject of this current post is not proper to this)
    How can we bind Two Static Lists to a single Column.
    Please go through this and provide me your suggestion.
    Thanks,
    Ravi.

  • Setting the selectOneChoice value at runtime

    Hi,
    I need to set the selectOneChoice value at runtime. On Page Load I am creating object of RichSelectOneChoice and currencyCode.setValue("USD");
    When I check on runtime it is not showing "USD" as selected item in dropdown where as in background it is sending USD to downstream application.
    How to get the show the value in SelectOneChoice which is selected at runtime in code?
    Thanks in advance.

    Hi,
    Selected value will be taken from the value property of selectOneChoice component, I guess you don't have specified value property. Create a String instance variable in bean and then set the value 'USD' to this variable and then bind it to value property of selectOneChoice component.
    Sample:
    //inside bean
    private String selectedValue;
    //Getter and Setter methods
    //Replace the currencyCode.setValue("USD"); line with the below code
    this.selectedValue = "USD"
    //Finally in jspx page bind this selectedValue to value property of bean
    <af:selectOneChoice value="#{bean.selectedValue}" ... />Sireesha

  • Unable to set a variable with value of type number from SelectOneChoice

    Hi,
    I am getting javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch error in the below situation
    I have a select list <af:selectOneChoice value="#{bindings.vwCompanyName.inputValue}">
    <f:selectItems value="#{bindings.vwCompanyName.items}"/>
    </af:selectOneChoice>
    and on clicking Search button I pass this value in the actionlistener <af:setActionListener from="#{bindings.Company}"
    to="#{AgrmtSrch.company}"/>
    where AgrmtSrch is my java reference
    In the pageDef file, I have <variableIterator id="variables">
    <variable Name="Company" Type="java.lang.Integer"/>
    </variableIterator>
    <list id="vwCompanyName" IterBinding="variables"
    StaticList="false" ListOperMode="0" ListIter="vwCompanyIterator"
    NullValueFlag="1" NullValueId="vwCompanyName_null">
    <AttrNames>
    <Item Value="Company"/>
    </AttrNames>
    <ListAttrNames>
    <Item Value="Compcd"/>
    </ListAttrNames>
    <ListDisplayAttrNames>
    <Item Value="ShortName"/>
    </ListDisplayAttrNames>
    </list>
    In my Java file I have taken company of type Number(jbo), since the actual company code in DB is in Number. When I select any value and click search, i get the above error.
    I tried changing to <variable Name="Company" Type="java.lang.string"/> in the page def. But then when i select the unselected value in the list I get null pointer exception. How can i handle this.
    PLease help.
    Thanks

    Hi I am serious. This issue is occuring. Please can someone try it out and see if its occuring for you too.
    I have no solution for this. I am using JDeveloper 10.1.3 and my project is ADF BC JSF
    Test case: Have 2 to 3 selectOneChoice in a search page. All three should be populated by view objects. Let Vo_1 and Vo_2 have the key values as 1 and vo_3 can have key value as string. Each selectOneChoice should have "Include labelled Item" in "No Selection Item' in edit binding.
    First select a value on any one of the dropdowns such that the query returns no results. Now the The other dropdowns will still be default labelled item and the one that was selected is still set so. Now when I select an option in any other dropdown and search, it gives the below error
    500 Internal Server Error
    javax.faces.el.EvaluationException: java.lang.NullPointerException     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:190)     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)     at oracle.adf.view.faces.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:55)     at oracle.adf.view.faces.component.UIXComponentBase.getProperty(UIXComponentBase.java:1021)     at oracle.adf.view.faces.component.UIXValue.getValue(UIXValue.java:56)     at oracle.adf.view.faces.component.UIXEditableValue.validate(UIXEditableValue.java:212)     at oracle.adf.view.faces.component.UIXEditableValue._executeValidate(UIXEditableValue.java:522)     at oracle.adf.view.faces.component.UIXEditableValue.processValidators(UIXEditableValue.java:302)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXForm.processValidators(UIXForm.java:59)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:855)     at oracle.adf.view.faces.component.UIXComponentBase.validateChildren(UIXComponentBase.java:839)     at oracle.adf.view.faces.component.UIXComponentBase.processValidators(UIXComponentBase.java:689)     at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:932)     at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:362)     at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:620)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)Caused by: java.lang.NullPointerException     at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:85)     at oracle.jbo.uicli.binding.JUCtrlListBinding.matchTargetWithLov(JUCtrlListBinding.java:868)     at oracle.jbo.uicli.binding.JUCtrlListBinding.findListIndex(JUCtrlListBinding.java:1106)     at oracle.jbo.uicli.binding.JUCtrlListBinding.setValueAt(JUCtrlListBinding.java:1725)     at oracle.jbo.uicli.binding.JUCtrlListBinding.updateValuesFromRow(JUCtrlListBinding.java:1338)     at oracle.jbo.uicli.binding.JUCtrlListBinding.getSelectedIndex(JUCtrlListBinding.java:702)     at oracle.jbo.uicli.binding.JUCtrlListBinding.getInputValue(JUCtrlListBinding.java:1799)     at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.getInputValue(FacesCtrlListBinding.java:73)     at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:1691)     at oracle.jbo.uicli.binding.JUCtrlListBinding.internalGet(JUCtrlListBinding.java:1972)     at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.internalGet(FacesCtrlListBinding.java:89)     at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:649)     at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)     at oracle.adfinternal.view.faces.model.FacesPropertyResolver.getValue(FacesPropertyResolver.java:92)     at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)     at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)     at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)

Maybe you are looking for

  • My external hard drive is not recognized

    I have the apple external disk drive.  I have used it numerous times.  I just plugged it in and the computer is not recognizing it.  I have tried both USB ports.  How can I fix this?

  • Is there any way I can rotate pdf's in Adobe Reader?

    I want to use Adobe Reader to view drawings when out on site, but they often open in portrait when they should be landscape.  Is there any way I can rotate the view?

  • Need ability to group forums into logical groups as a user.

    As heavy reader & contributor of the CRM forums, there are getting to be so many forums it is difficult to look through and assist on so many column headings.  Plus I believe the more novice users frequently submit their question in the wrong forum.

  • Laptop not charging

    Hi all please help I'm experiencing a problem with my laptop when I plug it in on the screen info box it says cherger plugged in but not charging and on the batry it is showing that the plug is plugged in but not showing any movement of it getting fu

  • OT Some thoughts on CSS

    Some interesting thoughts! See Dvorak's column http://www.pcmag.com/article2/0,1895,1987181,00.asp